New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Add support for "options" in DatasourceURI #32833
Conversation
a1af838
to
f9b2c72
Compare
If you want to store it see: https://github.com/qgis/QGIS/blob/master/src/providers/postgres/qgspostgresproviderconnection.cpp#L455 Also, add it to: https://github.com/qgis/QGIS/blob/master/src/providers/postgres/qgspostgresprovider.cpp#L5288 And feel free to deprecate Btw, aren't those "options" partly redundant? I mean, are you sure that they will not override other URI parameters? And if they do, which one is supposed to take precedence? |
I also think that this moves |
My current problem is writing a test for the fix in #32822 The test needs to use 2 different "roles" for the connection, but I'd like NOT to create a new user with login capabilities to do this. The only way I see to do so is to use PGOPTIONS to set a role which is different from the connection user, so there's no overlap. Alternatively I could have the database setup script create a user, with a password, but this would mean exposing the target PostgreSQL cluster to a time window in which people can connect using the hard-coded username/password of the qgis test role... |
Why not remove all the |
Could work, I'll try that in pr #32822 and see if it sticks |
Note, from Travis testing, that QgsDatasourceUri is not able to parse the escape sequence anyway:
From https://travis-ci.org/qgis/QGIS/jobs/611410954#L467 So some work would be needed here anyway |
Removing the special handling for
somewhere those options get lost, and I guess it's wherever some class (Uri itself?) tries to separate connection-oriented parts from other parts, to determine if a pre-existing connection exists |
Found the stripper: it is In turn, QgsPostgresProviderConnection::QgsPostgresProviderConnection initializes the uri to whatever is returned from |
Ok I'm closing this PR as I see you want QgsDatasourceUri deprecated |
See #32832