Database
Database
The Database module in the Breezz APEX API provides safe, transactional DML execution abstractions, flexible sharing rule contexts (WITH SHARING, WITHOUT SHARING, INHERITED), and lazy-loading data caching mechanisms.
Key Components
- DB — Core utility class for DML operations and dynamic sharing rule selection (
SECURED,UNSECURED,INHERITED).- DBResult — Execution result container containing SObject modification status and error collections.
- DBResultItem — Item-level operation result wrapper for individual record execution checks.
- DML — Low-level DML execution driver for direct database operations.
- DataStore — Centralized in-memory caching engine that prevents SOQL governor limit hits and supports custom data loaders.
- ModificationContext — Transactional modification accumulator for bulk inserts, updates, deletes, async DML, lead conversions, and Platform Event publishing.
Primary Capabilities
- Security Controls: Switch between secured user context and unsecured system context dynamically without changing core apex logic.
- Query Caching: Avoid repeated SOQL queries across complex trigger cycles or step executions using
DataStore. - Atomic Batch Modifications: Queue multiple SObject updates, deletes, email sends, and events inside a single
ModificationContextand save them in a unified transaction.