I am reading database.py and I am wondering if something like sqlite3 can be a near-drop-in replacement if someone wanted to host a smaller instance. For example, are the SQL operations used there independent of the specific MySQLdb module?
I don't see anything that would obviously cause problems, but I am pretty much a novice so I can't tell for sure.
Just to be clear, that's not a request for changing anything in the freepost code, or on the freepo.st instance. If changing database backends ends up being possible, I might use it for own purposes and contribute the changes back, for what they will be worth.
I am reading database.py and I am wondering if something like sqlite3 can be a near-drop-in replacement if someone wanted to host a smaller instance. For example, are the SQL operations used there independent of the specific MySQLdb module?
I don't see anything that would obviously cause problems, but I am pretty much a novice so I can't tell for sure.
Just to be clear, that's not a request for changing anything in the freepost code, or on the freepo.st instance. If changing database backends ends up being possible, I might use it for own purposes and contribute the changes back, for what they will be worth.
It should be, yes. There are a couple of constructs, UPDATE IGNORE ... and INSERT ... ON DUPLICATE KEY ..., that probably need to be checked if they work on sqlite. Other than that the queries are fairly basic. The only other thing to check are the types since sqlite has a more restrictive choice. Unfortunately I don't have an automatic script to create the database, so the SQL tables need to be imported manually into a new database.
It should be, yes. There are a couple of constructs, `UPDATE IGNORE ...` and `INSERT ... ON DUPLICATE KEY ...`, that probably need to be checked if they work on sqlite. Other than that the queries are fairly basic. The only other thing to check are the [types](https://notabug.org/zPlus/freepost/src/e7488d01d6fdf17ea9036e9fc367c902315062f3/freepost_freepost.sql) since sqlite has a more restrictive choice. Unfortunately I don't have an automatic script to create the database, so the SQL tables need to be imported manually into a new database.
I am reading database.py and I am wondering if something like sqlite3 can be a near-drop-in replacement if someone wanted to host a smaller instance. For example, are the SQL operations used there independent of the specific MySQLdb module?
I don't see anything that would obviously cause problems, but I am pretty much a novice so I can't tell for sure.
Just to be clear, that's not a request for changing anything in the freepost code, or on the freepo.st instance. If changing database backends ends up being possible, I might use it for own purposes and contribute the changes back, for what they will be worth.
It should be, yes. There are a couple of constructs,
UPDATE IGNORE ...
andINSERT ... ON DUPLICATE KEY ...
, that probably need to be checked if they work on sqlite. Other than that the queries are fairly basic. The only other thing to check are the types since sqlite has a more restrictive choice. Unfortunately I don't have an automatic script to create the database, so the SQL tables need to be imported manually into a new database.Thanks for your answer. I will give it a shot then.