[QGIS-Developer] core API to fetch query output fields from SQL query?

Tim Sutton tim at kartoza.com
Thu Jan 9 14:26:03 PST 2020


>
>
>
> In particular, me an Nyall have been chatting about adding a method to
> factory a QgsVectorLayer from a generic SQL query, the issues I see is that
> we need a PK (at least for PG) and how to decide the geometry column if
> there are more than one.
>

I wonder if you could just transparently add row_number[1] to the query to
give each row a unique id?

Regards

Tim

[1] https://www.postgresqltutorial.com/postgresql-row_number/






-- 
------------------------------------------------------------------------------------------

Tim Sutton
Visit http://kartoza.com to find out about open source:
 * Desktop GIS programming services
 * Geospatial web development
* GIS Training
* Consulting Services
Skype: timlinux Irc: timlinux on #qgis at freenode.net
Tim is a member of the QGIS Project Steering Committee
-------------------------------------------------------------------------------------------
Kartoza is a merger between Linfiniti and Afrispatial
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20200109/2d4789ce/attachment.html>


More information about the QGIS-Developer mailing list