diff options
| author | Joe Carstairs <me@joeac.net> | 2024-09-17 11:28:56 +0100 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2024-09-17 11:28:56 +0100 |
| commit | f0e3e0cfb183253e03b1a61ddecb7b9330d47fdb (patch) | |
| tree | 722eca369743dcfbb95f1efd58cc4cecc0fb8677 /backend/src/queries/accounts/get_all.rs | |
| parent | c737b6df94eae4981bb03dda3583e24046e24865 (diff) | |
Refactors backend
Diffstat (limited to 'backend/src/queries/accounts/get_all.rs')
| -rw-r--r-- | backend/src/queries/accounts/get_all.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/backend/src/queries/accounts/get_all.rs b/backend/src/queries/accounts/get_all.rs new file mode 100644 index 0000000..12941ac --- /dev/null +++ b/backend/src/queries/accounts/get_all.rs @@ -0,0 +1,7 @@ +use diesel::{result::Error, QueryDsl, RunQueryDsl, SelectableHelper, SqliteConnection}; + +use crate::{models::account::Account, schema::accounts::dsl::accounts}; + +pub fn get_all_accounts(connection: &mut SqliteConnection) -> Result<Vec<Account>, Error> { + accounts.select(Account::as_select()).load(connection) +} |
