Expand description
SQLite database stuff – schema, migrations, and CRUD for files and admins.
Structs§
- Admin
User - An admin user from the admins table.
- File
Record - A file record from the files table.
Functions§
- delete_
admin - Delete an admin user by username. Returns true if a row was removed.
- delete_
file - Delete a file record by ID. Returns true if a row was removed.
- delete_
files_ by_ ids - Bulk-delete file records by their IDs. Returns the number of rows deleted.
- get_
admin_ by_ username - Look up an admin by username.
- get_
file - Look up a single file record by its ID.
- get_
files_ by_ ids - Look up multiple file records by their IDs.
- init_db
- Set up the database tables and run any needed migrations.
- insert_
admin - Insert a new admin user.
- insert_
file - Insert a new file record into the database.
- list_
active - List non-expired file records, newest first.
- list_
admins - List all admin users ordered by creation time.
- list_
all_ files - List every file record, newest first.
- list_
all_ storage_ paths - List every storage path in the database.
- list_
expired - List expired file records only.
- renew_
file_ id - Give a file a new ID and update its public URL.