ACCESS-Community-Hub / ACCESS-MOPPeR

A tool to post-process ACCESS Model output using CMOR, based on APP4, work in progress!
https://access-mopper.readthedocs.io/en/latest/
Apache License 2.0
0 stars 0 forks source link

central db settings #118

Closed paolap closed 6 months ago

paolap commented 7 months ago

There are implications on using a centralised access.db included as part of the package data. Once there will be a central installation on the server anyone will be able to query this same database. However, the package has some commands in the "mopdb" module that can write to the database. We still need to make sure all implications of this happening are taken into account.

I think cons surpass pros, so we should find a way to update db separately from repo, which then would allow to create new releases only for db, once updates to db has been tested and confirmed to be safe Looking at https://dbhub.io as an example

In the meantime, to do:

Applying this still leaves a "hole": if a "manager" really wants to update db quickly without new release, all they need to do is to pass the path of central db via --dbname (is this desirable?)

paolap commented 7 months ago

This is now implemented, it can certainly be improved, and still have to test alternative to code repo to store database. DBhub might not yet have implemented the version control, as an alternative we could store the sql dump:

https://stackoverflow.com/questions/33809881/whats-a-good-way-or-tool-to-version-control-a-sqlite-database-schema-only or fossil:

https://fossil-scm.org/home/doc/trunk/www/index.wiki

paolap commented 7 months ago

From sqlite 3.0 documentation, in regard to to write lock: "SQLite version 3.0 allows one process to begin writing the database while other processes continue to read. The writer must still obtain an exclusive lock on the database for a brief interval in order to commit its changes, but the exclusive lock is no longer required for the entire write operation"