Add per-worldmap DB support and custom DB management - #418
Conversation
LarsMichelsen
left a comment
There was a problem hiding this comment.
Thank you for the PR, cool idea! 👍 I just have a few smaller remarks.
| $used_by = array(); | ||
|
|
||
| $selected = $db_name; | ||
| if (function_exists('worldmap_normalize_db_option')) |
There was a problem hiding this comment.
I don't think the normalization should be optional (in case the function does not exist).
Same for the function_exists below.
| 'worldmap.db' => 'worldmap.db (shared default)', | ||
| ); | ||
|
|
||
| $dir = cfg('paths', 'cfg') . 'worldmaps'; |
There was a problem hiding this comment.
There is some duplicate logic with listCustomWorldmapDbs. Can this be unified somehow?
|
Thanks, good points. I removed the optional function_exists() checks and cleaned up the helper handling. |
LarsMichelsen
left a comment
There was a problem hiding this comment.
Good improvements. What about the remaining comment regarding listCustomWorldmapDbs and list_custom_worldmap_dbs code duplication? Can you consolidate this somehow?
Summary
This PR adds per-worldmap SQLite database support and management improvements for NagVis worldmaps.
What is included
worldmap_dbon worldmaps (global map option).worldmap.dbremains the shared default DB.worldmaps/<name>.db..dbsuffix is appended automatically.geomapis stored asworldmaps/geomap.db.lng/lng2(instead oflong/long2) in index creation.worldmap.dbgets demo objects).Manage Maps UI improvements
(unused)or(used by N maps).Motivation
By default, all worldmaps share one object store.
This makes it hard to maintain independent object sets for different worldmaps and to clean up custom DB files safely.
This PR introduces a backward-compatible way to use isolated DBs per worldmap and basic lifecycle management in the UI.
Backward compatibility
worldmap.dbare unchanged.Manual test plan
worldmap_dbto:worldmap.db(default), andgeo2.worldmaps/geo2.db.worldmap_dbvalues and verify object isolation.(unused)/(used by N maps).