Db, refactor start

This commit is contained in:
Julia Lange 2025-05-27 11:47:18 -07:00
parent 556b6b3db6
commit cee9bf78ef
Signed by: Julia
SSH key fingerprint: SHA256:5DJcfxa5/fKCYn57dcabJa2vN2e6eT0pBerYi5SUbto
4 changed files with 24 additions and 14 deletions

8
db/Cargo.toml Normal file
View file

@ -0,0 +1,8 @@
[package]
name = "db"
version = "0.1.0"
edition = "2024"
[dependencies]
sqlx = { version = "0.8.6", features = ["postgres", "runtime-tokio"] }
tokio = "1.45.0"

View file

@ -1,7 +1,3 @@
use crate::atproto::{
Did,
Uri,
}
use sqlx::{
query,
Database,
@ -20,11 +16,6 @@ pub struct Db<Dbimp: Database> {
pool: Pool<Dbimp>
}
pub struct User {
userdid: Did,
handle: Handle,
}
#[non_exhaustive]
enum Role {
Owner,
@ -40,11 +31,6 @@ impl ToString for Role {
}
}
struct Participant {
participantdid: Did,
role: Role,
}
pub struct Session {
sessionuri: Uri,
label: Option<String>,

15
db/src/interfaces.rs Normal file
View file

@ -0,0 +1,15 @@
use atproto::{
Did,
Uri,
};
pub struct User {
userdid: Did,
handle: Handle,
}
struct Participant {
participantdid: Did,
role: Role,
}

1
db/src/lib.rs Normal file
View file

@ -0,0 +1 @@
pub struct db;