summaryrefslogtreecommitdiff
path: root/src/db
Commit message (Collapse)AuthorAge
* Return a distinct error when an invite username is in use.Owen Jacobson2024-10-11
| | | | I've also aligned channel creation with this (it's 409 Conflict). To make server setup more distinct, it now returns 503 Service Unavailable if setup has not been completed.
* Fix invalid migration.Owen Jacobson2024-10-10
| | | | | | The original version of this migration happened to work correctly, by accident, for databases with exactly one login. I missed this, and so did Kit, because both of our test databases _actually do_ contain exactly one login, and because I didn't run the tests before committing the migration. The fixed version works correctly for all scenarios I tested (zero, one, and two users, not super thorough). I've added code to patch out the original migration hash in databases that have it; no further corrective work is needed, as if the migration failed, then it got backed out anyways, and if it succeeded, you fell into the "one user" case.
* Return an instance of the client when opening a channel URL directly.Owen Jacobson2024-10-10
|
* Automatically delete database backups if automatic restore is successful.Owen Jacobson2024-10-10
| | | | Operational experience with the server has shown that leaving the backup in place is not helpful. The near-automatic choice is to immediately delete it, and the server won't start until it has been deleted. If the backup restore succeeded, then we know the user has a copy of their database, since the sqlite3 online backups API promises to make the target database bitwise-identical to the source database, so there's little chance the user will need a duplicate.
* Replace `unsafe` impl of backups with `rusqlite`.Owen Jacobson2024-10-05
| | | | The unsafe code still exists, but I have more faith in the rusqlite authors than in myself to ensure that the code is correct.
* Implement `sqlite3_backup_step`'s multi-step protocol.Owen Jacobson2024-10-05
|
* Use the right functions for determining error messages.Owen Jacobson2024-10-05
|
* Improve ergonomics of `Backup`Owen Jacobson2024-10-05
|
* Limit unsafe{} blocks even more tightly.Owen Jacobson2024-10-05
|
* Remove an unchecked operation in favour of a panicOwen Jacobson2024-10-05
|
* Tighten up `unsafe{}` blocks in backup logic.Owen Jacobson2024-10-05
|
* Use sqlx's API, not SQL groveling, to find unwanted migrations.Owen Jacobson2024-10-05
|
* Make a backup of the `.hi` database before applying migrations.Owen Jacobson2024-10-05
This was motivated by Kit and I both independently discovering that sqlite3 will happily partially apply migrations, leaving the DB in a broken state.