mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Get supported extension to avoid unavailable driver
This commit is contained in:
parent
4232e67c3d
commit
36fe8e64e3
@ -136,7 +136,8 @@ class ExecuteSQL(QgisAlgorithm):
|
||||
# belongs to temporary QgsMapLayerStore, not project.
|
||||
# So, we write them to disk is this is the case.
|
||||
if not QgsProject.instance().mapLayer(layer.id()):
|
||||
tf = tempfile.NamedTemporaryFile(suffix=".gpkg")
|
||||
suffix = "." + QgsVectorFileWriter.supportedFormatExtensions()[0]
|
||||
tf = tempfile.NamedTemporaryFile(suffix=suffix)
|
||||
tmp_path = tf.name
|
||||
QgsVectorFileWriter.writeAsVectorFormat(
|
||||
layer, tmp_path, layer.dataProvider().encoding())
|
||||
|
Loading…
x
Reference in New Issue
Block a user