Feature request #11794

spatialite connection custom name

Added by Luca Lanteri almost 10 years ago. Updated about 9 years ago.

Status:Closed
Priority:Normal
Assignee:Alessandro Pasotti
Category:Data Provider/SpatiaLite
Pull Request or Patch supplied:Yes Resolution:fixed/implemented
Easy fix?:No Copied to github as #:20020

Description

now its' impossible to load two spatialite db with the same name beacause the connection name is the same of db name.
Is it possible to manage user custom connection names in the same way of postgis/wms?

Associated revisions

Revision 325f0992
Added by Alessandro Pasotti about 9 years ago

SQLITE ask for a new name if already exists

If the db name already exists, allow to enter a new name.
Fixes #11794

History

#1 Updated by Alessandro Pasotti about 9 years ago

  • Assignee set to Alessandro Pasotti
  • Status changed from Open to Feedback

I cannot reproduce: a spatialite DB is just a file, if you copy the file to another directory you can load it into QGIS wihout any problem.
Can you please explain what you mean?
Maybe provide a step by step procedure to reproduce it?

#2 Updated by Alessandro Pasotti about 9 years ago

  • Pull Request or Patch supplied changed from No to Yes
  • Resolution set to fixed/implemented
  • Status changed from Feedback to In Progress

#3 Updated by Alessandro Pasotti about 9 years ago

  • Status changed from In Progress to Closed

#4 Updated by Hugo Mercier about 9 years ago

@elpaso I always found very strange this way of dealing with spatialite connections. Is there any good reason to give a "name" to a connection ? The name of the file should be sufficient, no ?

So if the connections are stored with the filename as the key, asking the user for a new name should not even be necessary.

#5 Updated by Alessandro Pasotti about 9 years ago

Agreed.
I don't know why it was written like that in the first place. I've just added a small patch without rewriting the whole class.
My impression, given also #13747 and a couple of crashes I've experienced while testing with spatialite files is that the provider is not really in good shape.

#6 Updated by Alessandro Pasotti about 9 years ago

Well... there is in fact a reason for the "name": to store preferences in QSettings, using the path as a key would result in nested settings (the / is the settings separator). Using a string key doesn't have this problem.

Also available in: Atom PDF