pub struct SqliteProductRepository { /* private fields */ }Available on crate feature
sqlite only.Expand description
SQLite implementation of ProductRepository
Implementations§
Source§impl SqliteProductRepository
impl SqliteProductRepository
pub const fn new(pool: Pool<SqliteConnectionManager>) -> Self
Trait Implementations§
Source§impl Debug for SqliteProductRepository
impl Debug for SqliteProductRepository
Source§impl ProductRepository for SqliteProductRepository
impl ProductRepository for SqliteProductRepository
Source§fn add_variant(
&self,
product_id: ProductId,
variant: CreateProductVariant,
) -> Result<ProductVariant>
fn add_variant( &self, product_id: ProductId, variant: CreateProductVariant, ) -> Result<ProductVariant>
Add variant to product
Source§fn get_variant(&self, id: Uuid) -> Result<Option<ProductVariant>>
fn get_variant(&self, id: Uuid) -> Result<Option<ProductVariant>>
Get variant by ID
Source§fn get_variant_by_sku(&self, sku: &str) -> Result<Option<ProductVariant>>
fn get_variant_by_sku(&self, sku: &str) -> Result<Option<ProductVariant>>
Get variant by SKU
Source§fn update_variant(
&self,
id: Uuid,
variant: CreateProductVariant,
) -> Result<ProductVariant>
fn update_variant( &self, id: Uuid, variant: CreateProductVariant, ) -> Result<ProductVariant>
Update variant
Source§fn get_variants(&self, product_id: ProductId) -> Result<Vec<ProductVariant>>
fn get_variants(&self, product_id: ProductId) -> Result<Vec<ProductVariant>>
Get all variants for product
Source§fn create_batch(
&self,
inputs: Vec<CreateProduct>,
) -> Result<BatchResult<Product>>
fn create_batch( &self, inputs: Vec<CreateProduct>, ) -> Result<BatchResult<Product>>
Create multiple products - partial success allowed
Source§fn create_batch_atomic(
&self,
inputs: Vec<CreateProduct>,
) -> Result<Vec<Product>>
fn create_batch_atomic( &self, inputs: Vec<CreateProduct>, ) -> Result<Vec<Product>>
Create multiple products - atomic (all-or-nothing)
Source§fn update_batch(
&self,
updates: Vec<(ProductId, UpdateProduct)>,
) -> Result<BatchResult<Product>>
fn update_batch( &self, updates: Vec<(ProductId, UpdateProduct)>, ) -> Result<BatchResult<Product>>
Update multiple products - partial success allowed
Source§fn update_batch_atomic(
&self,
updates: Vec<(ProductId, UpdateProduct)>,
) -> Result<Vec<Product>>
fn update_batch_atomic( &self, updates: Vec<(ProductId, UpdateProduct)>, ) -> Result<Vec<Product>>
Update multiple products - atomic (all-or-nothing)
Source§fn delete_batch(&self, ids: Vec<ProductId>) -> Result<BatchResult<ProductId>>
fn delete_batch(&self, ids: Vec<ProductId>) -> Result<BatchResult<ProductId>>
Delete multiple products - partial success allowed
Auto Trait Implementations§
impl !RefUnwindSafe for SqliteProductRepository
impl !UnwindSafe for SqliteProductRepository
impl Freeze for SqliteProductRepository
impl Send for SqliteProductRepository
impl Sync for SqliteProductRepository
impl Unpin for SqliteProductRepository
impl UnsafeUnpin for SqliteProductRepository
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more