summaryrefslogtreecommitdiff
path: root/src/cli.rs
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2024-10-04 22:12:15 -0400
committerOwen Jacobson <owen@grimoire.ca>2024-10-04 22:38:25 -0400
commitb422be184e01b4cc35b9c9a6921379080c24edb3 (patch)
treeb35bec7a4025e9874ba2683e3b9b8da4447c2fb0 /src/cli.rs
parent9bd6d9862b1c243def02200bca2cfbf578ad2a2f (diff)
Start fresh with database migrations.
The migration path from the original project inception to now was complicated and buggy, and stranded _both_ Kit and I with broken databases due to oversights and incomplete migrations. We've agreed to start fresh, once. If this is mistakenly started with an original-schema-flavour DB, startup will be aborted.
Diffstat (limited to 'src/cli.rs')
-rw-r--r--src/cli.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/cli.rs b/src/cli.rs
index 2d9f512..d88916a 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -99,7 +99,7 @@ impl Args {
(self.address.as_str(), self.port)
}
- async fn pool(&self) -> sqlx::Result<SqlitePool> {
+ async fn pool(&self) -> Result<SqlitePool, db::Error> {
db::prepare(&self.database_url).await
}
}
@@ -126,9 +126,6 @@ fn started_msg(listener: &net::TcpListener) -> io::Result<String> {
pub enum Error {
/// Failure due to `io::Error`. See [`io::Error`].
IoError(#[from] io::Error),
- /// Failure due to a database error. See [`sqlx::Error`].
- DatabaseError(#[from] sqlx::Error),
- /// Failure due to a database migration error. See
- /// [`sqlx::migrate::MigrateError`].
- MigrateError(#[from] sqlx::migrate::MigrateError),
+ /// Failure due to a database initialization error. See [`db::Error`].
+ Database(#[from] db::Error),
}