pub struct EffectAdapter {
inner: Arc<dyn DatabaseOperations>,
effects: Vec<Mutation>,
resource: Option<ResourceBinding>,
}Expand description
Binds app-declared inserts to each domain write transaction. Read-only operations never emit effects, and domain result indices remain unchanged.
Fields§
§inner: Arc<dyn DatabaseOperations>§effects: Vec<Mutation>§resource: Option<ResourceBinding>Implementations§
Source§impl EffectAdapter
impl EffectAdapter
Sourcepub fn new(
inner: Arc<dyn DatabaseOperations>,
schema: &AppSchema,
effects: Vec<Mutation>,
) -> Result<Self, DatabaseError>
pub fn new( inner: Arc<dyn DatabaseOperations>, schema: &AppSchema, effects: Vec<Mutation>, ) -> Result<Self, DatabaseError>
Accepts a bounded insertion-only outbox plan with local identity references.
Sourcepub fn with_resource(
self,
schema: &AppSchema,
resource: ResourceBinding,
) -> Result<Self, DatabaseError>
pub fn with_resource( self, schema: &AppSchema, resource: ResourceBinding, ) -> Result<Self, DatabaseError>
Binds one declared resource to its generated domain identity at commit.
Trait Implementations§
Source§impl DatabaseOperations for EffectAdapter
impl DatabaseOperations for EffectAdapter
Source§fn backend_name(&self) -> &'static str
fn backend_name(&self) -> &'static str
Delegates backend name through the same configured operation interface.
Source§fn local_artifact_format(&self) -> Option<&'static str>
fn local_artifact_format(&self) -> Option<&'static str>
Preserves the underlying adapter artifact contract through this wrapper.
Source§fn ensure_database(
&self,
config: &DbBackendConfig,
schema: &AppSchema,
) -> Result<(), DatabaseError>
fn ensure_database( &self, config: &DbBackendConfig, schema: &AppSchema, ) -> Result<(), DatabaseError>
Delegates ensure database through the same configured operation interface.
Source§fn user_credentials(
&self,
config: &DbBackendConfig,
schema: &AppSchema,
username: &str,
) -> Result<Option<UserCredentials>, DatabaseError>
fn user_credentials( &self, config: &DbBackendConfig, schema: &AppSchema, username: &str, ) -> Result<Option<UserCredentials>, DatabaseError>
Delegates user credentials through the same configured operation interface.
Source§fn update_user_password(
&self,
config: &DbBackendConfig,
user_id: i64,
password_hash: &str,
) -> Result<(), DatabaseError>
fn update_user_password( &self, config: &DbBackendConfig, user_id: i64, password_hash: &str, ) -> Result<(), DatabaseError>
Delegates update user password through the same configured operation interface.
Source§fn issue_session(
&self,
config: &DbBackendConfig,
user_id: i64,
session_token_hash: &str,
expires_at: &str,
) -> Result<(), DatabaseError>
fn issue_session( &self, config: &DbBackendConfig, user_id: i64, session_token_hash: &str, expires_at: &str, ) -> Result<(), DatabaseError>
Delegates issue session through the same configured operation interface.
Source§fn revoke_session(
&self,
config: &DbBackendConfig,
session_token_hash: &str,
) -> Result<(), DatabaseError>
fn revoke_session( &self, config: &DbBackendConfig, session_token_hash: &str, ) -> Result<(), DatabaseError>
Delegates revoke session through the same configured operation interface.
Source§fn revoke_user_sessions(
&self,
config: &DbBackendConfig,
user_id: i64,
) -> Result<(), DatabaseError>
fn revoke_user_sessions( &self, config: &DbBackendConfig, user_id: i64, ) -> Result<(), DatabaseError>
Delegates revoke user sessions through the same configured operation interface.
Source§fn active_session(
&self,
config: &DbBackendConfig,
schema: &AppSchema,
session_token_hash: &str,
now_epoch_seconds: u64,
) -> Result<Option<ActiveSession>, DatabaseError>
fn active_session( &self, config: &DbBackendConfig, schema: &AppSchema, session_token_hash: &str, now_epoch_seconds: u64, ) -> Result<Option<ActiveSession>, DatabaseError>
Delegates active session through the same configured operation interface.
Source§fn append_rate_limit_event(
&self,
config: &DbBackendConfig,
policy_key: &str,
bucket_key: &str,
outcome: &str,
) -> Result<(), DatabaseError>
fn append_rate_limit_event( &self, config: &DbBackendConfig, policy_key: &str, bucket_key: &str, outcome: &str, ) -> Result<(), DatabaseError>
Delegates append rate limit event through the same configured operation interface.
Source§fn admit_rate_limited_request(
&self,
config: &DbBackendConfig,
policy_key: &str,
bucket_key: &str,
maximum: usize,
window_seconds: u64,
) -> Result<bool, DatabaseError>
fn admit_rate_limited_request( &self, config: &DbBackendConfig, policy_key: &str, bucket_key: &str, maximum: usize, window_seconds: u64, ) -> Result<bool, DatabaseError>
Delegates admit rate limited request through the same configured operation interface.
Source§fn apply_contract(
&self,
config: &DbBackendConfig,
contract: &AppDataContract,
) -> Result<(), DatabaseError>
fn apply_contract( &self, config: &DbBackendConfig, contract: &AppDataContract, ) -> Result<(), DatabaseError>
Delegates apply contract through the same configured operation interface.
Source§fn migration_ledger(
&self,
config: &DbBackendConfig,
app_id: &str,
) -> Result<BTreeMap<String, String>, DatabaseError>
fn migration_ledger( &self, config: &DbBackendConfig, app_id: &str, ) -> Result<BTreeMap<String, String>, DatabaseError>
Delegates migration ledger through the same configured operation interface.
Source§fn applied_migration_checksum(
&self,
config: &DbBackendConfig,
app_id: &str,
migration_id: &str,
) -> Result<Option<String>, DatabaseError>
fn applied_migration_checksum( &self, config: &DbBackendConfig, app_id: &str, migration_id: &str, ) -> Result<Option<String>, DatabaseError>
Delegates applied migration checksum through the same configured operation interface.
Source§fn verify_contract(
&self,
config: &DbBackendConfig,
contract: &AppDataContract,
) -> Result<(), DatabaseError>
fn verify_contract( &self, config: &DbBackendConfig, contract: &AppDataContract, ) -> Result<(), DatabaseError>
Delegates verify contract through the same configured operation interface.
Source§fn ready(
&self,
config: &DbBackendConfig,
schema: &AppSchema,
) -> Result<(), DatabaseError>
fn ready( &self, config: &DbBackendConfig, schema: &AppSchema, ) -> Result<(), DatabaseError>
Delegates ready through the same configured operation interface.
Source§fn field_exists(
&self,
config: &DbBackendConfig,
schema: &AppSchema,
entity_name: &str,
field_name: &str,
) -> Result<bool, DatabaseError>
fn field_exists( &self, config: &DbBackendConfig, schema: &AppSchema, entity_name: &str, field_name: &str, ) -> Result<bool, DatabaseError>
Delegates field exists through the same configured operation interface.
Source§fn migrate(
&self,
config: &DbBackendConfig,
schema: &AppSchema,
migration: &Migration,
) -> Result<(), DatabaseError>
fn migrate( &self, config: &DbBackendConfig, schema: &AppSchema, migration: &Migration, ) -> Result<(), DatabaseError>
Delegates migrate through the same configured operation interface.
Source§fn adopt_legacy_migration(
&self,
config: &DbBackendConfig,
schema: &AppSchema,
migration: &Migration,
expected_legacy: &BTreeMap<String, String>,
) -> Result<(), DatabaseError>
fn adopt_legacy_migration( &self, config: &DbBackendConfig, schema: &AppSchema, migration: &Migration, expected_legacy: &BTreeMap<String, String>, ) -> Result<(), DatabaseError>
Delegates adopt legacy migration through the same configured operation interface.
Source§fn query(
&self,
config: &DbBackendConfig,
schema: &AppSchema,
query: &Query,
) -> Result<Vec<Map<String, Value>>, DatabaseError>
fn query( &self, config: &DbBackendConfig, schema: &AppSchema, query: &Query, ) -> Result<Vec<Map<String, Value>>, DatabaseError>
Delegates query through the same configured operation interface.
Source§fn join_query(
&self,
config: &DbBackendConfig,
schema: &AppSchema,
request: &JoinedQuery,
) -> Result<Vec<JoinedRecord>, DatabaseError>
fn join_query( &self, config: &DbBackendConfig, schema: &AppSchema, request: &JoinedQuery, ) -> Result<Vec<JoinedRecord>, DatabaseError>
Delegates join query through the same configured operation interface.
Source§fn aggregate(
&self,
config: &DbBackendConfig,
schema: &AppSchema,
query: &AggregateQuery,
) -> Result<Value, DatabaseError>
fn aggregate( &self, config: &DbBackendConfig, schema: &AppSchema, query: &AggregateQuery, ) -> Result<Value, DatabaseError>
Delegates aggregate through the same configured operation interface.
Source§fn transact(
&self,
config: &DbBackendConfig,
schema: &AppSchema,
transaction: &Transaction,
) -> Result<TransactionResult, DatabaseError>
fn transact( &self, config: &DbBackendConfig, schema: &AppSchema, transaction: &Transaction, ) -> Result<TransactionResult, DatabaseError>
Delegates transact through the same configured operation interface.
Source§fn claim_one(
&self,
config: &DbBackendConfig,
schema: &AppSchema,
claim: &Claim,
) -> Result<Option<i64>, DatabaseError>
fn claim_one( &self, config: &DbBackendConfig, schema: &AppSchema, claim: &Claim, ) -> Result<Option<i64>, DatabaseError>
Delegates claim one through the same configured operation interface.
Source§fn export_page(
&self,
config: &DbBackendConfig,
schema: &AppSchema,
entity: &str,
after_identity: Option<Value>,
limit: u32,
) -> Result<Vec<Record>, DatabaseError>
fn export_page( &self, config: &DbBackendConfig, schema: &AppSchema, entity: &str, after_identity: Option<Value>, limit: u32, ) -> Result<Vec<Record>, DatabaseError>
Delegates export page through the same configured operation interface.
Source§fn export_snapshot(
&self,
config: &DbBackendConfig,
schema: &AppSchema,
limits: SnapshotLimits,
) -> Result<Vec<Record>, DatabaseError>
fn export_snapshot( &self, config: &DbBackendConfig, schema: &AppSchema, limits: SnapshotLimits, ) -> Result<Vec<Record>, DatabaseError>
Delegates export snapshot through the same configured operation interface.
Source§fn restore_snapshot(
&self,
config: &DbBackendConfig,
schema: &AppSchema,
records: &[Record],
limits: SnapshotLimits,
counts: &[RestoreCount],
) -> Result<(), DatabaseError>
fn restore_snapshot( &self, config: &DbBackendConfig, schema: &AppSchema, records: &[Record], limits: SnapshotLimits, counts: &[RestoreCount], ) -> Result<(), DatabaseError>
Delegates restore snapshot through the same configured operation interface.
Source§fn import_batch(
&self,
config: &DbBackendConfig,
schema: &AppSchema,
records: &[Record],
) -> Result<(), DatabaseError>
fn import_batch( &self, config: &DbBackendConfig, schema: &AppSchema, records: &[Record], ) -> Result<(), DatabaseError>
Delegates import batch through the same configured operation interface.