[QGIS-Developer] FeatureSink, Processing and Geopackage : define layer primary key

Nyall Dawson nyall.dawson at gmail.com
Mon May 20 15:19:43 PDT 2019


On Mon, 20 May 2019 at 22:03, René-Luc Dhont <rldhont at gmail.com> wrote:
>
> Hi devs,
>
> I'd like to save data in a Geopackage by defining the layername, the
> geometry column and the primary key field with a processing parameter
> feature sink.
>
> I have found in the processing tests, that a feature sink value can be :
> ogr:dbname='/me/a.gpkg' table="d" (geom) sql=
> Is it possible to define the primary key field ?

Everything after "ogr:" is just a standard vector layer url -- looking
at QgsOgrProvider, I can't see any existing way to manually specify a
primary key, so that would need to be added first.

Nyall


More information about the QGIS-Developer mailing list