diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2024-09-11 22:43:14 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2024-09-12 00:26:04 -0400 |
| commit | f2f820370efbd5c6d0f304f781284a9f68990e21 (patch) | |
| tree | 7fb25e676dcd8dc694d0cec4df2cc04cab1120ac /src/app.rs | |
| parent | 8a4e25c2a7d6235d726499d43fd1721104314e86 (diff) | |
Wrap the database pool in an App struct.
This is a jumping-off point for adding logic that needs more than just the DB for state, such as chat message handling.
The name sucks, but it's the best I've got.
Diffstat (limited to 'src/app.rs')
| -rw-r--r-- | src/app.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/app.rs b/src/app.rs new file mode 100644 index 0000000..eff1b5e --- /dev/null +++ b/src/app.rs @@ -0,0 +1,12 @@ +use sqlx::sqlite::SqlitePool; + +#[derive(Clone)] +pub struct App { + pub db: SqlitePool, +} + +impl App { + pub fn from(db: SqlitePool) -> Self { + Self { db } + } +} |
