pub trait Database: Send + Sync {
Show 77 methods
// Required methods
fn orders(&self) -> Box<dyn OrderRepository + '_>;
fn inventory(&self) -> Box<dyn InventoryRepository + '_>;
fn customers(&self) -> Box<dyn CustomerRepository + '_>;
fn products(&self) -> Box<dyn ProductRepository + '_>;
fn custom_objects(&self) -> Box<dyn CustomObjectRepository + '_>;
fn returns(&self) -> Box<dyn ReturnRepository + '_>;
fn bom(&self) -> Box<dyn BomRepository + '_>;
fn work_orders(&self) -> Box<dyn WorkOrderRepository + '_>;
fn shipments(&self) -> Box<dyn ShipmentRepository + '_>;
fn payments(&self) -> Box<dyn PaymentRepository + '_>;
fn warranties(&self) -> Box<dyn WarrantyRepository + '_>;
fn purchase_orders(&self) -> Box<dyn PurchaseOrderRepository + '_>;
fn invoices(&self) -> Box<dyn InvoiceRepository + '_>;
fn carts(&self) -> Box<dyn CartRepository + '_>;
fn analytics(&self) -> Box<dyn AnalyticsRepository + '_>;
fn currency(&self) -> Box<dyn CurrencyRepository + '_>;
fn tax(&self) -> Box<dyn TaxRepository + '_>;
fn promotions(&self) -> Box<dyn PromotionRepository + '_>;
fn subscriptions(&self) -> Box<dyn SubscriptionRepository + '_>;
fn quality(&self) -> Box<dyn QualityRepository + '_>;
fn lots(&self) -> Box<dyn LotRepository + '_>;
fn serials(&self) -> Box<dyn SerialRepository + '_>;
fn warehouse(&self) -> Box<dyn WarehouseRepository + '_>;
fn receiving(&self) -> Box<dyn ReceivingRepository + '_>;
fn fulfillment(&self) -> Box<dyn FulfillmentRepository + '_>;
fn accounts_payable(&self) -> Box<dyn AccountsPayableRepository + '_>;
fn cost_accounting(&self) -> Box<dyn CostAccountingRepository + '_>;
fn credit(&self) -> Box<dyn CreditRepository + '_>;
fn backorder(&self) -> Box<dyn BackorderRepository + '_>;
fn accounts_receivable(&self) -> Box<dyn AccountsReceivableRepository + '_>;
fn general_ledger(&self) -> Box<dyn GeneralLedgerRepository + '_>;
fn x402_payment_intents(&self) -> Box<dyn X402PaymentIntentRepository + '_>;
fn x402_credits(&self) -> Box<dyn X402CreditRepository + '_>;
fn a2a_quotes(&self) -> Box<dyn A2ACommerceRepository + '_>;
fn a2a_purchases(&self) -> Box<dyn A2ACommerceRepository + '_>;
fn agent_cards(&self) -> Box<dyn AgentCardRepository + '_>;
fn agent_identities(&self) -> Box<dyn AgentIdentityRepository + '_>;
fn agent_reputation(&self) -> Box<dyn AgentReputationRepository + '_>;
fn agent_validation(&self) -> Box<dyn AgentValidationRepository + '_>;
fn gift_cards(&self) -> Box<dyn GiftCardRepository + '_>;
fn store_credits(&self) -> Box<dyn StoreCreditRepository + '_>;
fn segments(&self) -> Box<dyn SegmentRepository + '_>;
fn shipping_zones(&self) -> Box<dyn ShippingZoneRepository + '_>;
fn zone_shipping_methods(
&self,
) -> Box<dyn ZoneShippingMethodRepository + '_>;
fn reviews(&self) -> Box<dyn ReviewRepository + '_>;
fn wishlists(&self) -> Box<dyn WishlistRepository + '_>;
fn loyalty_programs(&self) -> Box<dyn LoyaltyProgramRepository + '_>;
fn rewards(&self) -> Box<dyn RewardRepository + '_>;
fn fraud(&self) -> Box<dyn FraudRepository + '_>;
fn search_configs(&self) -> Box<dyn SearchConfigRepository + '_>;
fn channels(&self) -> Box<dyn ChannelRepository + '_>;
fn companies(&self) -> Box<dyn CompanyRepository + '_>;
fn transfer_orders(&self) -> Box<dyn TransferOrderRepository + '_>;
fn units_of_measure(&self) -> Box<dyn UnitOfMeasureRepository + '_>;
fn production_batches(&self) -> Box<dyn ProductionBatchRepository + '_>;
fn supplier_skus(&self) -> Box<dyn SupplierSkuRepository + '_>;
fn vendor_returns(&self) -> Box<dyn VendorReturnRepository + '_>;
fn vendor_credits(&self) -> Box<dyn VendorCreditRepository + '_>;
fn payment_obligations(&self) -> Box<dyn PaymentObligationRepository + '_>;
fn price_levels(&self) -> Box<dyn PriceLevelRepository + '_>;
fn prepayments(&self) -> Box<dyn PrepaymentRepository + '_>;
fn price_schedules(&self) -> Box<dyn PriceScheduleRepository + '_>;
fn activity_logs(&self) -> Box<dyn ActivityLogRepository + '_>;
fn integration_mappings(&self) -> Box<dyn IntegrationMappingRepository + '_>;
fn inbound_shipments(&self) -> Box<dyn InboundShipmentRepository + '_>;
fn purgatory(&self) -> Box<dyn PurgatoryRepository + '_>;
fn print_stations(&self) -> Box<dyn PrintStationRepository + '_>;
fn edi_documents(&self) -> Box<dyn EdiDocumentRepository + '_>;
fn integration_field_mappings(
&self,
) -> Box<dyn IntegrationFieldMappingRepository + '_>;
fn topology_snapshots(&self) -> Box<dyn TopologySnapshotRepository + '_>;
fn stock_snapshots(&self) -> Box<dyn StockSnapshotRepository + '_>;
fn fixed_assets(&self) -> Box<dyn FixedAssetRepository + '_>;
fn revenue_recognition(&self) -> Box<dyn RevenueRecognitionRepository + '_>;
// Provided methods
fn backend_name(&self) -> &'static str { ... }
fn supports_capability(&self, _capability: DatabaseCapability) -> bool { ... }
fn ensure_capability(&self, capability: DatabaseCapability) -> Result<()> { ... }
fn http_idempotency(
&self,
) -> Option<Box<dyn HttpIdempotencyRepository + '_>> { ... }
}Expand description
Unified database trait that both SQLite and PostgreSQL implement. This allows stateset-embedded to work with either backend.
Required Methods§
Sourcefn orders(&self) -> Box<dyn OrderRepository + '_>
fn orders(&self) -> Box<dyn OrderRepository + '_>
Get the order repository
Sourcefn inventory(&self) -> Box<dyn InventoryRepository + '_>
fn inventory(&self) -> Box<dyn InventoryRepository + '_>
Get the inventory repository
Sourcefn customers(&self) -> Box<dyn CustomerRepository + '_>
fn customers(&self) -> Box<dyn CustomerRepository + '_>
Get the customer repository
Sourcefn products(&self) -> Box<dyn ProductRepository + '_>
fn products(&self) -> Box<dyn ProductRepository + '_>
Get the product repository
Sourcefn custom_objects(&self) -> Box<dyn CustomObjectRepository + '_>
fn custom_objects(&self) -> Box<dyn CustomObjectRepository + '_>
Get the custom objects repository (custom states / metaobjects)
Sourcefn returns(&self) -> Box<dyn ReturnRepository + '_>
fn returns(&self) -> Box<dyn ReturnRepository + '_>
Get the return repository
Sourcefn bom(&self) -> Box<dyn BomRepository + '_>
fn bom(&self) -> Box<dyn BomRepository + '_>
Get the BOM (Bill of Materials) repository
Sourcefn work_orders(&self) -> Box<dyn WorkOrderRepository + '_>
fn work_orders(&self) -> Box<dyn WorkOrderRepository + '_>
Get the work order repository
Sourcefn shipments(&self) -> Box<dyn ShipmentRepository + '_>
fn shipments(&self) -> Box<dyn ShipmentRepository + '_>
Get the shipment repository
Sourcefn payments(&self) -> Box<dyn PaymentRepository + '_>
fn payments(&self) -> Box<dyn PaymentRepository + '_>
Get the payment repository
Sourcefn warranties(&self) -> Box<dyn WarrantyRepository + '_>
fn warranties(&self) -> Box<dyn WarrantyRepository + '_>
Get the warranty repository
Sourcefn purchase_orders(&self) -> Box<dyn PurchaseOrderRepository + '_>
fn purchase_orders(&self) -> Box<dyn PurchaseOrderRepository + '_>
Get the purchase order repository
Sourcefn invoices(&self) -> Box<dyn InvoiceRepository + '_>
fn invoices(&self) -> Box<dyn InvoiceRepository + '_>
Get the invoice repository
Sourcefn carts(&self) -> Box<dyn CartRepository + '_>
fn carts(&self) -> Box<dyn CartRepository + '_>
Get the cart/checkout repository
Sourcefn analytics(&self) -> Box<dyn AnalyticsRepository + '_>
fn analytics(&self) -> Box<dyn AnalyticsRepository + '_>
Get the analytics repository
Sourcefn currency(&self) -> Box<dyn CurrencyRepository + '_>
fn currency(&self) -> Box<dyn CurrencyRepository + '_>
Get the currency repository
Sourcefn tax(&self) -> Box<dyn TaxRepository + '_>
fn tax(&self) -> Box<dyn TaxRepository + '_>
Get the tax repository
Sourcefn promotions(&self) -> Box<dyn PromotionRepository + '_>
fn promotions(&self) -> Box<dyn PromotionRepository + '_>
Get the promotions repository
Sourcefn subscriptions(&self) -> Box<dyn SubscriptionRepository + '_>
fn subscriptions(&self) -> Box<dyn SubscriptionRepository + '_>
Get the subscriptions repository
Sourcefn quality(&self) -> Box<dyn QualityRepository + '_>
fn quality(&self) -> Box<dyn QualityRepository + '_>
Get the quality repository
Sourcefn lots(&self) -> Box<dyn LotRepository + '_>
fn lots(&self) -> Box<dyn LotRepository + '_>
Get the lots repository
Sourcefn serials(&self) -> Box<dyn SerialRepository + '_>
fn serials(&self) -> Box<dyn SerialRepository + '_>
Get the serials repository
Sourcefn warehouse(&self) -> Box<dyn WarehouseRepository + '_>
fn warehouse(&self) -> Box<dyn WarehouseRepository + '_>
Get the warehouse repository
Sourcefn receiving(&self) -> Box<dyn ReceivingRepository + '_>
fn receiving(&self) -> Box<dyn ReceivingRepository + '_>
Get the receiving repository
Sourcefn fulfillment(&self) -> Box<dyn FulfillmentRepository + '_>
fn fulfillment(&self) -> Box<dyn FulfillmentRepository + '_>
Get the fulfillment repository
Sourcefn accounts_payable(&self) -> Box<dyn AccountsPayableRepository + '_>
fn accounts_payable(&self) -> Box<dyn AccountsPayableRepository + '_>
Get the accounts payable repository
Sourcefn cost_accounting(&self) -> Box<dyn CostAccountingRepository + '_>
fn cost_accounting(&self) -> Box<dyn CostAccountingRepository + '_>
Get the cost accounting repository
Sourcefn credit(&self) -> Box<dyn CreditRepository + '_>
fn credit(&self) -> Box<dyn CreditRepository + '_>
Get the credit repository
Sourcefn backorder(&self) -> Box<dyn BackorderRepository + '_>
fn backorder(&self) -> Box<dyn BackorderRepository + '_>
Get the backorder repository
Sourcefn accounts_receivable(&self) -> Box<dyn AccountsReceivableRepository + '_>
fn accounts_receivable(&self) -> Box<dyn AccountsReceivableRepository + '_>
Get the accounts receivable repository
Sourcefn general_ledger(&self) -> Box<dyn GeneralLedgerRepository + '_>
fn general_ledger(&self) -> Box<dyn GeneralLedgerRepository + '_>
Get the general ledger repository
Sourcefn x402_payment_intents(&self) -> Box<dyn X402PaymentIntentRepository + '_>
fn x402_payment_intents(&self) -> Box<dyn X402PaymentIntentRepository + '_>
Get the x402 payment intent repository
Sourcefn x402_credits(&self) -> Box<dyn X402CreditRepository + '_>
fn x402_credits(&self) -> Box<dyn X402CreditRepository + '_>
Get the x402 credit ledger repository
Sourcefn a2a_quotes(&self) -> Box<dyn A2ACommerceRepository + '_>
fn a2a_quotes(&self) -> Box<dyn A2ACommerceRepository + '_>
Get the agent-to-agent commerce repository (quotes and purchases)
Sourcefn a2a_purchases(&self) -> Box<dyn A2ACommerceRepository + '_>
fn a2a_purchases(&self) -> Box<dyn A2ACommerceRepository + '_>
Get the agent-to-agent commerce repository (quotes and purchases)
Sourcefn agent_cards(&self) -> Box<dyn AgentCardRepository + '_>
fn agent_cards(&self) -> Box<dyn AgentCardRepository + '_>
Get the agent card repository
Sourcefn agent_identities(&self) -> Box<dyn AgentIdentityRepository + '_>
fn agent_identities(&self) -> Box<dyn AgentIdentityRepository + '_>
Get the agent identity registry repository (ERC-8004)
Sourcefn agent_reputation(&self) -> Box<dyn AgentReputationRepository + '_>
fn agent_reputation(&self) -> Box<dyn AgentReputationRepository + '_>
Get the agent reputation registry repository (ERC-8004)
Sourcefn agent_validation(&self) -> Box<dyn AgentValidationRepository + '_>
fn agent_validation(&self) -> Box<dyn AgentValidationRepository + '_>
Get the agent validation registry repository (ERC-8004)
Sourcefn gift_cards(&self) -> Box<dyn GiftCardRepository + '_>
fn gift_cards(&self) -> Box<dyn GiftCardRepository + '_>
Get the gift card repository
Sourcefn store_credits(&self) -> Box<dyn StoreCreditRepository + '_>
fn store_credits(&self) -> Box<dyn StoreCreditRepository + '_>
Get the store credit repository
Sourcefn segments(&self) -> Box<dyn SegmentRepository + '_>
fn segments(&self) -> Box<dyn SegmentRepository + '_>
Get the customer segment repository
Sourcefn shipping_zones(&self) -> Box<dyn ShippingZoneRepository + '_>
fn shipping_zones(&self) -> Box<dyn ShippingZoneRepository + '_>
Get the shipping zone repository
Sourcefn zone_shipping_methods(&self) -> Box<dyn ZoneShippingMethodRepository + '_>
fn zone_shipping_methods(&self) -> Box<dyn ZoneShippingMethodRepository + '_>
Get the zone shipping method repository
Sourcefn reviews(&self) -> Box<dyn ReviewRepository + '_>
fn reviews(&self) -> Box<dyn ReviewRepository + '_>
Get the product review repository
Sourcefn wishlists(&self) -> Box<dyn WishlistRepository + '_>
fn wishlists(&self) -> Box<dyn WishlistRepository + '_>
Get the wishlist repository
Sourcefn loyalty_programs(&self) -> Box<dyn LoyaltyProgramRepository + '_>
fn loyalty_programs(&self) -> Box<dyn LoyaltyProgramRepository + '_>
Get the loyalty program repository
Sourcefn rewards(&self) -> Box<dyn RewardRepository + '_>
fn rewards(&self) -> Box<dyn RewardRepository + '_>
Get the reward catalog repository
Sourcefn fraud(&self) -> Box<dyn FraudRepository + '_>
fn fraud(&self) -> Box<dyn FraudRepository + '_>
Get the fraud detection repository
Sourcefn search_configs(&self) -> Box<dyn SearchConfigRepository + '_>
fn search_configs(&self) -> Box<dyn SearchConfigRepository + '_>
Get the search configuration repository
Sourcefn channels(&self) -> Box<dyn ChannelRepository + '_>
fn channels(&self) -> Box<dyn ChannelRepository + '_>
Get the sales/fulfillment channel repository
Sourcefn companies(&self) -> Box<dyn CompanyRepository + '_>
fn companies(&self) -> Box<dyn CompanyRepository + '_>
Get the B2B company repository
Sourcefn transfer_orders(&self) -> Box<dyn TransferOrderRepository + '_>
fn transfer_orders(&self) -> Box<dyn TransferOrderRepository + '_>
Get the transfer order repository
Sourcefn units_of_measure(&self) -> Box<dyn UnitOfMeasureRepository + '_>
fn units_of_measure(&self) -> Box<dyn UnitOfMeasureRepository + '_>
Get the units-of-measure repository
Sourcefn production_batches(&self) -> Box<dyn ProductionBatchRepository + '_>
fn production_batches(&self) -> Box<dyn ProductionBatchRepository + '_>
Get the production batch repository
Sourcefn supplier_skus(&self) -> Box<dyn SupplierSkuRepository + '_>
fn supplier_skus(&self) -> Box<dyn SupplierSkuRepository + '_>
Get the supplier SKU repository
Sourcefn vendor_returns(&self) -> Box<dyn VendorReturnRepository + '_>
fn vendor_returns(&self) -> Box<dyn VendorReturnRepository + '_>
Get the vendor return repository
Sourcefn vendor_credits(&self) -> Box<dyn VendorCreditRepository + '_>
fn vendor_credits(&self) -> Box<dyn VendorCreditRepository + '_>
Get the vendor credit repository
Sourcefn payment_obligations(&self) -> Box<dyn PaymentObligationRepository + '_>
fn payment_obligations(&self) -> Box<dyn PaymentObligationRepository + '_>
Get the payment obligation repository
Sourcefn price_levels(&self) -> Box<dyn PriceLevelRepository + '_>
fn price_levels(&self) -> Box<dyn PriceLevelRepository + '_>
Get the price level repository
Sourcefn prepayments(&self) -> Box<dyn PrepaymentRepository + '_>
fn prepayments(&self) -> Box<dyn PrepaymentRepository + '_>
Get the prepayment repository
Sourcefn price_schedules(&self) -> Box<dyn PriceScheduleRepository + '_>
fn price_schedules(&self) -> Box<dyn PriceScheduleRepository + '_>
Get the price schedule repository
Sourcefn activity_logs(&self) -> Box<dyn ActivityLogRepository + '_>
fn activity_logs(&self) -> Box<dyn ActivityLogRepository + '_>
Get the activity log repository
Sourcefn integration_mappings(&self) -> Box<dyn IntegrationMappingRepository + '_>
fn integration_mappings(&self) -> Box<dyn IntegrationMappingRepository + '_>
Get the integration mapping repository
Sourcefn inbound_shipments(&self) -> Box<dyn InboundShipmentRepository + '_>
fn inbound_shipments(&self) -> Box<dyn InboundShipmentRepository + '_>
Get the inbound shipment repository
Sourcefn purgatory(&self) -> Box<dyn PurgatoryRepository + '_>
fn purgatory(&self) -> Box<dyn PurgatoryRepository + '_>
Get the purgatory repository
Sourcefn print_stations(&self) -> Box<dyn PrintStationRepository + '_>
fn print_stations(&self) -> Box<dyn PrintStationRepository + '_>
Get the print station repository
Sourcefn edi_documents(&self) -> Box<dyn EdiDocumentRepository + '_>
fn edi_documents(&self) -> Box<dyn EdiDocumentRepository + '_>
Get the EDI document repository
Sourcefn integration_field_mappings(
&self,
) -> Box<dyn IntegrationFieldMappingRepository + '_>
fn integration_field_mappings( &self, ) -> Box<dyn IntegrationFieldMappingRepository + '_>
Get the integration field-mapping repository
Sourcefn topology_snapshots(&self) -> Box<dyn TopologySnapshotRepository + '_>
fn topology_snapshots(&self) -> Box<dyn TopologySnapshotRepository + '_>
Get the topology snapshot repository
Sourcefn stock_snapshots(&self) -> Box<dyn StockSnapshotRepository + '_>
fn stock_snapshots(&self) -> Box<dyn StockSnapshotRepository + '_>
Get the stock snapshot repository
Sourcefn fixed_assets(&self) -> Box<dyn FixedAssetRepository + '_>
fn fixed_assets(&self) -> Box<dyn FixedAssetRepository + '_>
Get the fixed asset repository
Sourcefn revenue_recognition(&self) -> Box<dyn RevenueRecognitionRepository + '_>
fn revenue_recognition(&self) -> Box<dyn RevenueRecognitionRepository + '_>
Get the revenue recognition repository
Provided Methods§
Sourcefn backend_name(&self) -> &'static str
fn backend_name(&self) -> &'static str
Human-readable backend name.
Sourcefn supports_capability(&self, _capability: DatabaseCapability) -> bool
fn supports_capability(&self, _capability: DatabaseCapability) -> bool
Whether the backend supports a given optional repository domain.
Sourcefn ensure_capability(&self, capability: DatabaseCapability) -> Result<()>
fn ensure_capability(&self, capability: DatabaseCapability) -> Result<()>
Fail fast when a caller requests an unsupported optional repository domain.
Sourcefn http_idempotency(&self) -> Option<Box<dyn HttpIdempotencyRepository + '_>>
fn http_idempotency(&self) -> Option<Box<dyn HttpIdempotencyRepository + '_>>
Get the durable HTTP idempotency repository, if the backend provides
one. Backends without durable idempotency support return None, in
which case callers fall back to in-memory behavior.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".