Skip to content

Commit c15ef22

Browse files
committed
Expose boolean field creation support for other OGR supported drivers
1 parent f64f41a commit c15ef22

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/providers/ogr/qgsogrprovider.cpp

+9-3
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,15 @@ QgsOgrProvider::QgsOgrProvider( QString const &uri )
466466
<< QgsVectorDataProvider::NativeType( tr( "Date & Time" ), QStringLiteral( "datetime" ), QVariant::DateTime );
467467
}
468468

469-
if ( mGDALDriverName == QLatin1String( "GPKG" ) )
470-
{
471-
// boolean data type - likely other drivers also support this
469+
if ( mGDALDriverName == QLatin1String( "GeoJSON" ) ||
470+
mGDALDriverName == QLatin1String( "GML" ) ||
471+
mGDALDriverName == QLatin1String( "CSV" ) ||
472+
mGDALDriverName == QLatin1String( "PostgreSQL" ) ||
473+
mGDALDriverName == QLatin1String( "PGDump" ) ||
474+
mGDALDriverName == QLatin1String( "SQLite" ) ||
475+
mGDALDriverName == QLatin1String( "GPKG" ) )
476+
{
477+
// boolean data type
472478
nativeTypes
473479
<< QgsVectorDataProvider::NativeType( tr( "Boolean" ), QStringLiteral( "bool" ), QVariant::Bool, -1, -1, -1, -1 );
474480
}

0 commit comments

Comments
 (0)