I think that some logic to retrieve a pk for a view would be great to have.

If I'm not wrong, the data source select dialog offers a pk when you select
a view, maybe it's just easy as porting that logic to the provider and use
it to guess the PK if there's no information in the URI.


On Thu, Aug 29, 2019, 17:47 Sandro Santilli <[email protected]> wrote:

> On Thu, Aug 29, 2019 at 12:35:45PM +0100, Jorge Gustavo Rocha wrote:
> >
> > https://cdash.orfeo-toolbox.org/viewTest.php?onlyfailed&buildid=14455
> >
> > That is related to your PR, right?
>
> Ok, it was actually my PR.
> Wasn't easy to spot the problem, because the QgsVectorLayer.isValid()
> call doesn't tell what's invalid about a layer, but at the end the
> problem was that QGIS was not able to find a primary key for a view.
>
> I've added the primary key manually as part of the URI, as the test
> is meant to test something different and didn't want to get distracted
> by that, but if you think QGIS should be capable of finding a working
> primary key in a view I'll file a ticket for that.
>
> Other issue: sslmode needed to be disabled for the test to pass.
>
> My PR is now Travis-Green:
> https://github.com/qgis/QGIS/pull/31468
>
> --strk;
> _______________________________________________
> QGIS-Developer mailing list
> [email protected]
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to