hdus / pg_raster_upload

QGIS plugin for uploading raster data to a PostGIS database.
GNU General Public License v2.0
5 stars 3 forks source link

Do not ask for credentials if not necessary (e.g. when using Windows authentication) #11

Closed effjot closed 1 year ago

effjot commented 1 year ago

With this PR, if init_DB() can connect to the DB without username and password, it will not ask for the credentials. This fixes issue #10.

Additionally, if SERVICE_NAME is the empty string or Null (this happened to me after editing a DB connection in Qgis), it will not be used.

load_raster_layer() drops the credentials form uri_config to avoid the credentials dialog when adding the raster. As I’m not using service files, I am not sure if the existing code deals with that case correctly, because in uri_config there’s just 'service': None.

Adding the layer if I declined to overwrite an existing table seems a bit unexpected to me, so I skipped adding the layer in that case (commit 85a9802844c6027580ceb832411cf62601534f1f).

Also, I fixed a few typos in the Readme.

effjot commented 1 year ago

Thank you!