pub struct DbSet<T: IEntityType> { /* private fields */ }Implementations§
Source§impl<T: IEntityType + IEntitySnapshot> DbSet<T>
impl<T: IEntityType + IEntitySnapshot> DbSet<T>
pub fn new(table_name: impl Into<String>) -> Self
pub fn with_provider( table_name: impl Into<String>, provider: Arc<dyn IDatabaseProvider>, ) -> Self
pub fn set_query_filter(&mut self, filter: BoolExpr)
Sourcepub fn set_filter_map(&mut self, map: Arc<HashMap<String, CompiledFilter>>)
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.
pub fn set_provider(&mut self, provider: Arc<dyn IDatabaseProvider>)
Sourcepub fn remove_all(&mut self)
pub fn remove_all(&mut self)
Convenience inherent method �?delegates to IDbSet::remove_all.
Sourcepub fn remove_at(&mut self, index: usize) -> EFResult<()>
pub fn remove_at(&mut self, index: usize) -> EFResult<()>
Convenience inherent method �?delegates to IDbSet::remove_at.
Sourcepub fn clear_entries(&mut self)
pub fn clear_entries(&mut self)
Convenience inherent method �?delegates to IDbSet::clear_entries.
Sourcepub fn query(&self) -> QueryBuilder<T>
pub fn query(&self) -> QueryBuilder<T>
Convenience inherent method — delegates to IQueryable::query.
Sourcepub fn query_ignore_filters(&self) -> QueryBuilder<T>
pub fn query_ignore_filters(&self) -> QueryBuilder<T>
Returns a query builder that bypasses the configured query filter. Use for administrative / cross-tenant queries.
pub fn attach(&mut self, entity: T)
pub fn tracked_entries(&self) -> impl Iterator<Item = &T>
pub fn tracked_entries_mut(&mut self) -> impl Iterator<Item = &mut T>
pub fn retain(&mut self, f: impl FnMut(&TrackedEntry<T>) -> bool)
Sourcepub fn remove_range(&mut self, entities: &[T])where
T: PartialEq,
pub fn remove_range(&mut self, entities: &[T])where
T: PartialEq,
Marks multiple entities as deleted.
Sourcepub async fn load_all(&mut self) -> EFResult<()>
pub async fn load_all(&mut self) -> EFResult<()>
Loads all rows from the database into the change tracker as Unchanged.
Sourcepub fn upsert(&mut self, entity: T)
pub fn upsert(&mut self, entity: T)
Marks an entity for upsert (INSERT … ON CONFLICT DO UPDATE).
The entity is tracked in Added state with is_upsert = true. During
save_changes, upsert entries are routed to execute_upserts instead
of execute_inserts. The conflict target is the entity’s primary key
column(s).
Sourcepub fn detect_changes(&mut self)where
T: IEntitySnapshot,
pub fn detect_changes(&mut self)where
T: IEntitySnapshot,
Compares attached entities against their original snapshots and marks changes.
Populates modified_properties with the field names that differ from the
original snapshot, enabling partial UPDATEs (SET only dirty columns).
pub async fn exists_by_id( &self, key_values: HashMap<String, DbValue>, ) -> EFResult<bool>
Sourcepub fn filter<F>(&self, apply: F) -> QueryBuilder<T>
pub fn filter<F>(&self, apply: F) -> QueryBuilder<T>
Starts a query filtered by a compile-time LINQ expression tree (linq!(�?).