Db, add atproto error support

This commit is contained in:
Julia Lange 2025-06-17 13:55:30 -07:00
parent 1d1f8ae60f
commit df1da0905d
Signed by: Julia
SSH key fingerprint: SHA256:5DJcfxa5/fKCYn57dcabJa2vN2e6eT0pBerYi5SUbto
2 changed files with 5 additions and 3 deletions

View file

@ -19,7 +19,7 @@ CREATE TABLE session (
label VARCHAR, label VARCHAR,
-- Participants in participant -- Participants in participant
created_at VARCHAR NOT NULL, created_at VARCHAR,
indexed_at VARCHAR NOT NULL, indexed_at VARCHAR NOT NULL,
sort_at VARCHAR GENERATED ALWAYS AS (LEAST(created_at,indexed_at)) STORED NOT NULL sort_at VARCHAR GENERATED ALWAYS AS (LEAST(created_at,indexed_at)) STORED NOT NULL
); );
@ -33,13 +33,13 @@ CREATE TABLE activity (
-- Progress in progress -- Progress in progress
performed_at VARCHAR, performed_at VARCHAR,
created_at VARCHAR NOT NULL, created_at VARCHAR,
indexed_at VARCHAR NOT NULL, indexed_at VARCHAR NOT NULL,
sort_at VARCHAR GENERATED ALWAYS AS (LEAST(created_at,indexed_at)) STORED NOT NULL sort_at VARCHAR GENERATED ALWAYS AS (LEAST(created_at,indexed_at)) STORED NOT NULL
); );
CREATE TABLE participant ( CREATE TABLE participant (
participantdid VARCHAR NOT NULL, participantdid VARCHAR NOT NULL,
session VARCHAR NOT NULL, sessionuri VARCHAR NOT NULL,
role VARCHAR NOT NULL role VARCHAR NOT NULL
); );

View file

@ -3,6 +3,8 @@
pub enum Error { pub enum Error {
#[error("Database Implementation Error: {0}")] #[error("Database Implementation Error: {0}")]
Backend(#[from] sqlx::Error), Backend(#[from] sqlx::Error),
#[error("AT Protocol Implementation Error: {0}")]
Atproto(#[from] atproto::error::Error),
} }
pub type Result<T> = std::result::Result<T, Error>; pub type Result<T> = std::result::Result<T, Error>;