Design and implement the shared database schema crate (shanty-db)
#2
Notifications
Total Time Spent: 22 minutes
connor
22 minutes
No due date set.
Dependencies
No dependencies set.
Reference: Shanty/Main#2
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Shanty uses a shared database to store all music metadata, library state, watchlist entries, and more. Multiple crates need to read from and write to this database. To avoid tight coupling and schema drift, there should be a dedicated
shanty-dbcrate that owns the schema, migrations, and provides a typed access layer.This crate should:
dieselorsea-ormwith SQLite as the default backend (SQLite is lightweight, file-based, and appropriate for a self-hosted music app). The choice should support migrations and be ergonomic for other crates to use.tracks— file path, title, artist, album, album artist, track number, disc number, duration, genre, year, codec/format, bitrate, file size, fingerprint (nullable), added_at, updated_at, musicbrainz_id (nullable)albums— name, album artist, year, genre, cover art path (nullable), musicbrainz_id (nullable)artists— name, musicbrainz_id (nullable), added_at, top_songs, similar_artistswanted_items— references to artist/album/track the user wants to monitor, with status (wanted/available/downloaded)download_queue— items pending download, with status, source URL, error infosearch_cache— optional cache for online search results to avoid excessive API callsDesign Considerations
shanty-dbbut should not define their own tables.r2d2or the ORM's built-in connection pooling.Acceptance Criteria
shanty-dbcrate compiles and is usable as a dependency by other workspace cratestracks,albums,artists,watch_items,download_queue) exist after migrationDependencies