Hi devs,

I'm working on a plugin that connects to a custom table (without geometry) in a GPKG. When I'm sending queries to it, I keep on getting unexpected results. Somehow the id field is missing, sometimes it appears twice (!). And this seems to be different between QGIS 3.10 and 3.25. (I think it changed since 3.22).

Here is a piece of my code:


fn = '/path/to/test.gpkg'
md = QgsProviderRegistry.instance().providerMetadata('ogr')
conn = md.createConnection(fn, {})

q = 'select * from test_table;'
qr = conn.executeSql(q)
print(qr) # No id field in result



Before diving into the QGIS code I'd like to check if this is the way to go. Or should i use another way to query that GPKG (SQLite) db?


Kind regards,
Raymond
_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to