Issue 2551235
Created on 2022-10-20 03:11 by rouilj, last changed 2024-08-03 23:33 by rouilj.
msg7652 |
Author: [hidden] (rouilj) |
Date: 2022-10-20 03:11 |
|
Add a sql command to roundup-admin to allow running sql commands against the database.
Specific use case is to toggle sqlite db from delete to wal journal mode and back.
The admin/upgrading documentation uses sqlite3. If sqlite3 is not installed
(e.g in a docker container) Roundup should provide some alternate method.
If the sql command is run against a non-sql backend it should return an appropriate
error.
Open question:
should the sql command allow arbitrary sql, or should it be filtered (e.g. to rule
out dropping tables)?
|
msg7653 |
Author: [hidden] (ber) |
Date: 2022-10-27 13:09 |
|
> If sqlite3 is not installed
> (e.g in a docker container) Roundup should provide some alternate method.
What about installing sqlite3 in this situation?
(I fear that we need to provide too much for a situation that is too rare.)
|
msg7654 |
Author: [hidden] (rouilj) |
Date: 2022-10-27 13:31 |
|
Hi Bern:
>What about installing sqlite3 in this situation?
>(I fear that we need to provide too much for a situation that is too rare.)
They could install the sqlite3 command line tools and then remove them
from the container. With the current docker container based on alpine
the package manager should make this easy. However the container does
need network access to the alpine repos. Also if somebody opts to
build on a different container base, they might not have easy access
to the sqlite3 cli package.
Tthe implementation of this in roundup-admin should be as simple as
setting up the command framework and calling
self.db.sql('string passed from trusted user on command line')
along with adding docstrings etc.
It does complicate the UI with a new command. Also man pages and other
docs need updating. I also agree this is a bit of an edge case.
|
msg8122 |
Author: [hidden] (rouilj) |
Date: 2024-08-03 23:33 |
|
With python 3.12+ you can:
python -m sqlite3 sqlite.db.file
> pragma journal_mode;
> pragma journal_mode=WAL
without needed any sqlite3 command tools.
I am closing this since 3.12 is used for the docker base images.
While the sql command could be useful for other sql databases, for this
use case it's not needed.
|
|
Date |
User |
Action |
Args |
2024-08-03 23:33:48 | rouilj | set | status: new -> closed resolution: out of date messages:
+ msg8122 |
2022-10-27 13:31:53 | rouilj | set | messages:
+ msg7654 |
2022-10-27 13:09:05 | ber | set | nosy:
+ ber messages:
+ msg7653 |
2022-10-20 03:11:21 | rouilj | create | |
|