Skip to main content

Database

Trait Database 

Source
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<(), CommerceError> { ... } 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§

Source

fn orders(&self) -> Box<dyn OrderRepository + '_>

Get the order repository

Source

fn inventory(&self) -> Box<dyn InventoryRepository + '_>

Get the inventory repository

Source

fn customers(&self) -> Box<dyn CustomerRepository + '_>

Get the customer repository

Source

fn products(&self) -> Box<dyn ProductRepository + '_>

Get the product repository

Source

fn custom_objects(&self) -> Box<dyn CustomObjectRepository + '_>

Get the custom objects repository (custom states / metaobjects)

Source

fn returns(&self) -> Box<dyn ReturnRepository + '_>

Get the return repository

Source

fn bom(&self) -> Box<dyn BomRepository + '_>

Get the BOM (Bill of Materials) repository

Source

fn work_orders(&self) -> Box<dyn WorkOrderRepository + '_>

Get the work order repository

Source

fn shipments(&self) -> Box<dyn ShipmentRepository + '_>

Get the shipment repository

Source

fn payments(&self) -> Box<dyn PaymentRepository + '_>

Get the payment repository

Source

fn warranties(&self) -> Box<dyn WarrantyRepository + '_>

Get the warranty repository

Source

fn purchase_orders(&self) -> Box<dyn PurchaseOrderRepository + '_>

Get the purchase order repository

Source

fn invoices(&self) -> Box<dyn InvoiceRepository + '_>

Get the invoice repository

Source

fn carts(&self) -> Box<dyn CartRepository + '_>

Get the cart/checkout repository

Source

fn analytics(&self) -> Box<dyn AnalyticsRepository + '_>

Get the analytics repository

Source

fn currency(&self) -> Box<dyn CurrencyRepository + '_>

Get the currency repository

Source

fn tax(&self) -> Box<dyn TaxRepository + '_>

Get the tax repository

Source

fn promotions(&self) -> Box<dyn PromotionRepository + '_>

Get the promotions repository

Source

fn subscriptions(&self) -> Box<dyn SubscriptionRepository + '_>

Get the subscriptions repository

Source

fn quality(&self) -> Box<dyn QualityRepository + '_>

Get the quality repository

Source

fn lots(&self) -> Box<dyn LotRepository + '_>

Get the lots repository

Source

fn serials(&self) -> Box<dyn SerialRepository + '_>

Get the serials repository

Source

fn warehouse(&self) -> Box<dyn WarehouseRepository + '_>

Get the warehouse repository

Source

fn receiving(&self) -> Box<dyn ReceivingRepository + '_>

Get the receiving repository

Source

fn fulfillment(&self) -> Box<dyn FulfillmentRepository + '_>

Get the fulfillment repository

Source

fn accounts_payable(&self) -> Box<dyn AccountsPayableRepository + '_>

Get the accounts payable repository

Source

fn cost_accounting(&self) -> Box<dyn CostAccountingRepository + '_>

Get the cost accounting repository

Source

fn credit(&self) -> Box<dyn CreditRepository + '_>

Get the credit repository

Source

fn backorder(&self) -> Box<dyn BackorderRepository + '_>

Get the backorder repository

Source

fn accounts_receivable(&self) -> Box<dyn AccountsReceivableRepository + '_>

Get the accounts receivable repository

Source

fn general_ledger(&self) -> Box<dyn GeneralLedgerRepository + '_>

Get the general ledger repository

Source

fn x402_payment_intents(&self) -> Box<dyn X402PaymentIntentRepository + '_>

Get the x402 payment intent repository

Source

fn x402_credits(&self) -> Box<dyn X402CreditRepository + '_>

Get the x402 credit ledger repository

Source

fn a2a_quotes(&self) -> Box<dyn A2ACommerceRepository + '_>

Get the agent-to-agent commerce repository (quotes and purchases)

Source

fn a2a_purchases(&self) -> Box<dyn A2ACommerceRepository + '_>

Get the agent-to-agent commerce repository (quotes and purchases)

Source

fn agent_cards(&self) -> Box<dyn AgentCardRepository + '_>

Get the agent card repository

Source

fn agent_identities(&self) -> Box<dyn AgentIdentityRepository + '_>

Get the agent identity registry repository (ERC-8004)

Source

fn agent_reputation(&self) -> Box<dyn AgentReputationRepository + '_>

Get the agent reputation registry repository (ERC-8004)

Source

fn agent_validation(&self) -> Box<dyn AgentValidationRepository + '_>

Get the agent validation registry repository (ERC-8004)

Source

fn gift_cards(&self) -> Box<dyn GiftCardRepository + '_>

Get the gift card repository

Source

fn store_credits(&self) -> Box<dyn StoreCreditRepository + '_>

Get the store credit repository

Source

fn segments(&self) -> Box<dyn SegmentRepository + '_>

Get the customer segment repository

Source

fn shipping_zones(&self) -> Box<dyn ShippingZoneRepository + '_>

Get the shipping zone repository

Source

fn zone_shipping_methods(&self) -> Box<dyn ZoneShippingMethodRepository + '_>

Get the zone shipping method repository

Source

fn reviews(&self) -> Box<dyn ReviewRepository + '_>

Get the product review repository

Source

fn wishlists(&self) -> Box<dyn WishlistRepository + '_>

Get the wishlist repository

Source

fn loyalty_programs(&self) -> Box<dyn LoyaltyProgramRepository + '_>

Get the loyalty program repository

Source

fn rewards(&self) -> Box<dyn RewardRepository + '_>

Get the reward catalog repository

Source

fn fraud(&self) -> Box<dyn FraudRepository + '_>

Get the fraud detection repository

Source

fn search_configs(&self) -> Box<dyn SearchConfigRepository + '_>

Get the search configuration repository

Source

fn channels(&self) -> Box<dyn ChannelRepository + '_>

Get the sales/fulfillment channel repository

Source

fn companies(&self) -> Box<dyn CompanyRepository + '_>

Get the B2B company repository

Source

fn transfer_orders(&self) -> Box<dyn TransferOrderRepository + '_>

Get the transfer order repository

Source

fn units_of_measure(&self) -> Box<dyn UnitOfMeasureRepository + '_>

Get the units-of-measure repository

Source

fn production_batches(&self) -> Box<dyn ProductionBatchRepository + '_>

Get the production batch repository

Source

fn supplier_skus(&self) -> Box<dyn SupplierSkuRepository + '_>

Get the supplier SKU repository

Source

fn vendor_returns(&self) -> Box<dyn VendorReturnRepository + '_>

Get the vendor return repository

Source

fn vendor_credits(&self) -> Box<dyn VendorCreditRepository + '_>

Get the vendor credit repository

Source

fn payment_obligations(&self) -> Box<dyn PaymentObligationRepository + '_>

Get the payment obligation repository

Source

fn price_levels(&self) -> Box<dyn PriceLevelRepository + '_>

Get the price level repository

Source

fn prepayments(&self) -> Box<dyn PrepaymentRepository + '_>

Get the prepayment repository

Source

fn price_schedules(&self) -> Box<dyn PriceScheduleRepository + '_>

Get the price schedule repository

Source

fn activity_logs(&self) -> Box<dyn ActivityLogRepository + '_>

Get the activity log repository

Source

fn integration_mappings(&self) -> Box<dyn IntegrationMappingRepository + '_>

Get the integration mapping repository

Source

fn inbound_shipments(&self) -> Box<dyn InboundShipmentRepository + '_>

Get the inbound shipment repository

Source

fn purgatory(&self) -> Box<dyn PurgatoryRepository + '_>

Get the purgatory repository

Source

fn print_stations(&self) -> Box<dyn PrintStationRepository + '_>

Get the print station repository

Source

fn edi_documents(&self) -> Box<dyn EdiDocumentRepository + '_>

Get the EDI document repository

Source

fn integration_field_mappings( &self, ) -> Box<dyn IntegrationFieldMappingRepository + '_>

Get the integration field-mapping repository

Source

fn topology_snapshots(&self) -> Box<dyn TopologySnapshotRepository + '_>

Get the topology snapshot repository

Source

fn stock_snapshots(&self) -> Box<dyn StockSnapshotRepository + '_>

Get the stock snapshot repository

Source

fn fixed_assets(&self) -> Box<dyn FixedAssetRepository + '_>

Get the fixed asset repository

Source

fn revenue_recognition(&self) -> Box<dyn RevenueRecognitionRepository + '_>

Get the revenue recognition repository

Provided Methods§

Source

fn backend_name(&self) -> &'static str

Human-readable backend name.

Source

fn supports_capability(&self, _capability: DatabaseCapability) -> bool

Whether the backend supports a given optional repository domain.

Source

fn ensure_capability( &self, capability: DatabaseCapability, ) -> Result<(), CommerceError>

Fail fast when a caller requests an unsupported optional repository domain.

Source

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".

Implementors§