Skip to content

Commit

Permalink
[ogr] Advertise boolean field support for GPKG layers
Browse files Browse the repository at this point in the history
Likely other drivers also support this, so the list should be
extended for these
  • Loading branch information
nyalldawson committed Dec 12, 2017
1 parent af64734 commit f64f41a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/providers/ogr/qgsogrprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,14 @@ QgsOgrProvider::QgsOgrProvider( QString const &uri )
<< QgsVectorDataProvider::NativeType( tr( "Date & Time" ), QStringLiteral( "datetime" ), QVariant::DateTime );
}

if ( mGDALDriverName == QLatin1String( "GPKG" ) )
{
// boolean data type - likely other drivers also support this
nativeTypes
<< QgsVectorDataProvider::NativeType( tr( "Boolean" ), QStringLiteral( "bool" ), QVariant::Bool, -1, -1, -1, -1 );
}


setNativeTypes( nativeTypes );

QgsOgrConnPool::instance()->ref( QgsOgrProviderUtils::connectionPoolId( dataSourceUri( true ) ) );
Expand Down

0 comments on commit f64f41a

Please sign in to comment.