pub struct SystemConfigDbStore { /* private fields */ }Expand description
SeaORM-backed system configuration store.
Implementations§
Source§impl SystemConfigDbStore
impl SystemConfigDbStore
Sourcepub const fn new(
db: DatabaseConnection,
registry: &'static ConfigRegistry,
deprecated_keys: &'static [&'static str],
) -> Self
pub const fn new( db: DatabaseConnection, registry: &'static ConfigRegistry, deprecated_keys: &'static [&'static str], ) -> Self
Creates a store from a database connection and product config registry.
Sourcepub async fn find_cursor(
&self,
limit: u64,
after_id: Option<i64>,
) -> Result<SystemConfigCursorSlice>
pub async fn find_cursor( &self, limit: u64, after_id: Option<i64>, ) -> Result<SystemConfigCursorSlice>
Lists one id-cursor page by stable id order.
Sourcepub async fn find_visible_custom(
&self,
include_authenticated: bool,
) -> Result<Vec<Model>>
pub async fn find_visible_custom( &self, include_authenticated: bool, ) -> Result<Vec<Model>>
Lists visible custom rows ordered by key.
Sourcepub async fn lock_by_key(&self, key: &str) -> Result<()>
pub async fn lock_by_key(&self, key: &str) -> Result<()>
Locks one row by key where the database supports row locks.
Sourcepub async fn upsert(&self, request: SystemConfigUpsert<'_>) -> Result<Model>
pub async fn upsert(&self, request: SystemConfigUpsert<'_>) -> Result<Model>
Upserts one row using registry metadata for known system keys.
Sourcepub async fn delete_by_key(&self, key: &str) -> Result<()>
pub async fn delete_by_key(&self, key: &str) -> Result<()>
Deletes a custom row.
Sourcepub async fn ensure_system_value_if_missing(
&self,
key: &str,
value: &str,
) -> Result<bool>
pub async fn ensure_system_value_if_missing( &self, key: &str, value: &str, ) -> Result<bool>
Inserts one system value if no row exists.
Sourcepub async fn delete_deprecated_keys(&self) -> Result<u64>
pub async fn delete_deprecated_keys(&self) -> Result<u64>
Deletes deprecated system keys configured by the product.
Sourcepub async fn ensure_defaults(&self) -> Result<usize>
pub async fn ensure_defaults(&self) -> Result<usize>
Ensures default rows exist and repairs metadata for existing system rows.
Trait Implementations§
Source§impl Clone for SystemConfigDbStore
impl Clone for SystemConfigDbStore
Source§fn clone(&self) -> SystemConfigDbStore
fn clone(&self) -> SystemConfigDbStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SystemConfigDbStore
impl !RefUnwindSafe for SystemConfigDbStore
impl Send for SystemConfigDbStore
impl Sync for SystemConfigDbStore
impl Unpin for SystemConfigDbStore
impl UnsafeUnpin for SystemConfigDbStore
impl !UnwindSafe for SystemConfigDbStore
Blanket Implementations§
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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