Skip to main content

DbSet

Struct DbSet 

Source
pub struct DbSet<T: IEntityType> { /* private fields */ }

Implementations§

Source§

impl<T: IEntityType + IEntitySnapshot> DbSet<T>

Source

pub fn new(table_name: impl Into<String>) -> Self

Source

pub fn with_provider( table_name: impl Into<String>, provider: Arc<dyn IDatabaseProvider>, ) -> Self

Source

pub fn set_query_filter(&mut self, filter: BoolExpr)

Source

pub fn set_filter_map(&mut self, map: Arc<HashMap<String, CompiledFilter>>)

Sets the global filter map (table_name → BoolExpr) used by NavigationLoader to scope secondary queries.

Source

pub fn set_provider(&mut self, provider: Arc<dyn IDatabaseProvider>)

Source

pub fn tracked_entries(&self) -> impl Iterator<Item = &T>

Returns an iterator over entity references.

Source

pub fn tracked_entries_mut(&mut self) -> impl Iterator<Item = &mut T>

Returns a mutable iterator over entity references.

Source

pub fn retain(&mut self, f: impl FnMut(&DbSetEntry<T>) -> bool)

Retains entries matching the predicate (drops others).

Source

pub fn clear_entries(&mut self)

Convenience inherent method — delegates to IDbSet::clear_entries.

Source

pub fn len(&self) -> usize

Convenience inherent method — delegates to IDbSet::len.

Source

pub fn is_empty(&self) -> bool

Convenience inherent method — delegates to IDbSet::is_empty.

Source

pub fn query(&self) -> QueryBuilder<T>

Convenience inherent method — delegates to IQueryable::query.

Source

pub fn query_ignore_filters(&self) -> QueryBuilder<T>

Returns a query builder that bypasses the configured query filter. Use for administrative / cross-tenant queries.

Source

pub fn filter<F>(&self, apply: F) -> QueryBuilder<T>
where F: FnOnce(QueryBuilder<T>) -> QueryBuilder<T>,

Starts a query filtered by a compile-time LINQ expression tree (linq!())

Source

pub async fn exists_by_id( &self, key_values: HashMap<String, DbValue>, ) -> EFResult<bool>

Checks whether an entity with the given key values exists in the database.

Trait Implementations§

Source§

impl<T: IEntityType + IEntitySnapshot> IDbSet<T> for DbSet<T>

Source§

fn clear_entries(&mut self)

Clears all entries from the set (does not affect ChangeTracker).
Source§

fn len(&self) -> usize

Returns the number of entries.
Source§

fn is_empty(&self) -> bool

Returns whether the set is empty.
Source§

impl<T: IEntityType> IQueryable<T> for DbSet<T>

Source§

fn query(&self) -> QueryBuilder<T>

Source§

impl<T: IEntityType> LinqSource for DbSet<T>

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for DbSet<T>

§

impl<T> !UnwindSafe for DbSet<T>

§

impl<T> Freeze for DbSet<T>

§

impl<T> Send for DbSet<T>

§

impl<T> Sync for DbSet<T>

§

impl<T> Unpin for DbSet<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for DbSet<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.