pub struct SqliteUserStore { /* private fields */ }Expand description
User store backed by a shared SqlitePool. Mirrors
super::postgres::PostgresUserStore in shape so callers swap one
for the other based on the engine’s selected backend.
Implementations§
Source§impl SqliteUserStore
impl SqliteUserStore
pub fn new(pool: SqlitePool) -> Self
Sourcepub fn into_dyn(self) -> Arc<dyn UserStore>
pub fn into_dyn(self) -> Arc<dyn UserStore>
Wrap into an Arc<dyn UserStore> for crate::ctx::AuthCtx.
Trait Implementations§
Source§impl Clone for SqliteUserStore
impl Clone for SqliteUserStore
Source§fn clone(&self) -> SqliteUserStore
fn clone(&self) -> SqliteUserStore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl UserStore for SqliteUserStore
impl UserStore for SqliteUserStore
fn create_user<'life0, 'life1, 'async_trait>(
&'life0 self,
user: &'life1 User,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_user_by_id<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<User>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_user_by_email<'life0, 'life1, 'async_trait>(
&'life0 self,
email: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<User>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_user<'life0, 'life1, 'async_trait>(
&'life0 self,
user: &'life1 User,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn set_password_hash<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
hash: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_password_hash<'life0, 'life1, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_passkeys<'life0, 'life1, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<PasskeyCred>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn add_passkey<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
cred: &'life2 PasskeyCred,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn remove_passkey<'life0, 'life1, 'async_trait>(
&'life0 self,
credential_id: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn link_upstream<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
provider: &'life2 str,
subject: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn get_user_by_upstream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
provider: &'life1 str,
subject: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<User>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn list_users<'life0, 'life1, 'async_trait>(
&'life0 self,
limit: i64,
offset: i64,
search: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<User>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_users<'life0, 'life1, 'async_trait>(
&'life0 self,
limit: i64,
offset: i64,
search: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<User>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Admin: paginated user list.
limit is clamped by the impl;
offset may be 0. search is an optional case-insensitive
substring match on email (or display_name when email is
NULL). Returns rows sorted by created_at DESC.Source§fn count_users<'life0, 'life1, 'async_trait>(
&'life0 self,
search: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<i64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn count_users<'life0, 'life1, 'async_trait>(
&'life0 self,
search: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<i64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Admin: total user count (after applying
search if provided).
Used by the dashboard’s pagination + the Lua wrapper.Source§fn delete_user<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_user<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Admin: hard-delete a user row + cascade dependents. Returns
Ok(true) iff a row was removed. The schema’s
ON DELETE CASCADE foreign keys handle the dependents
(auth.passkeys, auth.sessions, auth.user_upstream).Source§fn list_upstream_for_user<'life0, 'life1, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, String)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_upstream_for_user<'life0, 'life1, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, String)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Admin: list every (provider, subject) link for a user. Used by
the dashboard’s user-detail pane to show federated identities.
Auto Trait Implementations§
impl Freeze for SqliteUserStore
impl !RefUnwindSafe for SqliteUserStore
impl Send for SqliteUserStore
impl Sync for SqliteUserStore
impl Unpin for SqliteUserStore
impl UnsafeUnpin for SqliteUserStore
impl !UnwindSafe for SqliteUserStore
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more