Db, add core user functionality and tests; db mod

Adds all the basic user functions, and tests for them.

This is also intializes the DB Module, which will have more things in it
This commit is contained in:
Julia Lange 2026-02-05 13:10:21 -08:00
parent eb21bf0d51
commit ce95a54227
Signed by: Julia
SSH key fingerprint: SHA256:5DJcfxa5/fKCYn57dcabJa2vN2e6eT0pBerYi5SUbto
4 changed files with 185 additions and 0 deletions

View file

@ -1,11 +1,24 @@
#![cfg(test)]
use crate::{
Adapter,
AdapterBuilder,
};
use chrono::{
Utc,
TimeZone,
DateTime
};
pub const USERNAME: &str = "Alice";
pub const USERNAME2: &str = "Bob";
pub fn get_datetime() -> DateTime<Utc> {
Utc.with_ymd_and_hms(2020,1,1,0,0,0).unwrap()
}
pub async fn setup_adapter() -> Adapter {
AdapterBuilder::new()
.database_url("sqlite::memory:")
.create().await.unwrap()
}