models

package
v0.0.0-...-f5ca578 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2022 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package models contains generated code for schema 'public'.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Errorf

func Errorf(s string, v ...interface{})

Errorf logs an error message using the package error logger.

func Logf

func Logf(s string, v ...interface{})

Logf logs a message using the package logger.

func SetErrorLogger

func SetErrorLogger(logger interface{})

SetErrorLogger sets the package error logger. Valid logger types:

io.Writer
func(string, ...interface{}) (int, error) // fmt.Printf
func(string, ...interface{}) // log.Printf

func SetLogger

func SetLogger(logger interface{})

SetLogger sets the package logger. Valid logger types:

io.Writer
func(string, ...interface{}) (int, error) // fmt.Printf
func(string, ...interface{}) // log.Printf

Types

type AddressKind

type AddressKind uint16

AddressKind is the 'address_kind' enum type from schema 'public'.

const (
	// AddressKindBilling is the 'billing' address_kind.
	AddressKindBilling AddressKind = 1
	// AddressKindShipping is the 'shipping' address_kind.
	AddressKindShipping AddressKind = 2
	// AddressKindMailing is the 'mailing' address_kind.
	AddressKindMailing AddressKind = 3
)

AddressKind values.

func (AddressKind) MarshalText

func (ak AddressKind) MarshalText() ([]byte, error)

MarshalText marshals AddressKind into text.

func (*AddressKind) Scan

func (ak *AddressKind) Scan(v interface{}) error

Scan satisfies the sql.Scanner interface.

func (AddressKind) String

func (ak AddressKind) String() string

String satisfies the fmt.Stringer interface.

func (*AddressKind) UnmarshalText

func (ak *AddressKind) UnmarshalText(buf []byte) error

UnmarshalText unmarshals AddressKind from text.

func (AddressKind) Value

func (ak AddressKind) Value() (driver.Value, error)

Value satisfies the driver.Valuer interface.

type Archetype

type Archetype struct {
	ID      int64  `json:"id" db:"id"`             // id
	StoreID int64  `json:"store_id" db:"store_id"` // store_id
	Name    string `json:"name" db:"name"`         // name
	// contains filtered or unexported fields
}

Archetype represents a row from 'public.archetype'.

func ArchetypeByID

func ArchetypeByID(ctx context.Context, db DB, id int64) (*Archetype, error)

ArchetypeByID retrieves a row from 'public.archetype' as a Archetype.

Generated from index 'archetype_pkey'.

func ArchetypeByName

func ArchetypeByName(ctx context.Context, db DB, name string) (*Archetype, error)

ArchetypeByName retrieves a row from 'public.archetype' as a Archetype.

Generated from index 'archetype_name_key'.

func (*Archetype) Delete

func (a *Archetype) Delete(ctx context.Context, db DB) error

Delete deletes the Archetype from the database.

func (*Archetype) Deleted

func (a *Archetype) Deleted() bool

Deleted returns true when the Archetype has been marked for deletion from the database.

func (*Archetype) Exists

func (a *Archetype) Exists() bool

Exists returns true when the Archetype exists in the database.

func (*Archetype) Insert

func (a *Archetype) Insert(ctx context.Context, db DB) error

Insert inserts the Archetype to the database.

func (*Archetype) Save

func (a *Archetype) Save(ctx context.Context, db DB) error

Save saves the Archetype to the database.

func (*Archetype) Update

func (a *Archetype) Update(ctx context.Context, db DB) error

Update updates a Archetype in the database.

func (*Archetype) Upsert

func (a *Archetype) Upsert(ctx context.Context, db DB) error

Upsert performs an upsert for Archetype.

type ArchetypeCategory

type ArchetypeCategory struct {
	ArchetypeID int64 `json:"archetype_id" db:"archetype_id"` // archetype_id
	CategoryID  int64 `json:"category_id" db:"category_id"`   // category_id
	// contains filtered or unexported fields
}

ArchetypeCategory represents a row from 'public.archetype_category'.

func ArchetypeCategoryByArchetypeIDCategoryID

func ArchetypeCategoryByArchetypeIDCategoryID(ctx context.Context, db DB, archetypeID, categoryID int64) (*ArchetypeCategory, error)

ArchetypeCategoryByArchetypeIDCategoryID retrieves a row from 'public.archetype_category' as a ArchetypeCategory.

Generated from index 'archetype_category_pkey'.

func (*ArchetypeCategory) Archetype

func (ac *ArchetypeCategory) Archetype(ctx context.Context, db DB) (*Archetype, error)

Archetype returns the Archetype associated with the ArchetypeCategory's (ArchetypeID).

Generated from foreign key 'archetype_category_archetype_id_fkey'.

func (*ArchetypeCategory) Category

func (ac *ArchetypeCategory) Category(ctx context.Context, db DB) (*Category, error)

Category returns the Category associated with the ArchetypeCategory's (CategoryID).

Generated from foreign key 'archetype_category_category_id_fkey'.

func (*ArchetypeCategory) Delete

func (ac *ArchetypeCategory) Delete(ctx context.Context, db DB) error

Delete deletes the ArchetypeCategory from the database.

func (*ArchetypeCategory) Deleted

func (ac *ArchetypeCategory) Deleted() bool

Deleted returns true when the ArchetypeCategory has been marked for deletion from the database.

func (*ArchetypeCategory) Exists

func (ac *ArchetypeCategory) Exists() bool

Exists returns true when the ArchetypeCategory exists in the database.

func (*ArchetypeCategory) Insert

func (ac *ArchetypeCategory) Insert(ctx context.Context, db DB) error

Insert inserts the ArchetypeCategory to the database.

type ArchetypeOption

type ArchetypeOption struct {
	ArchetypeID int64 `json:"archetype_id" db:"archetype_id"` // archetype_id
	OptionID    int64 `json:"option_id" db:"option_id"`       // option_id
	// contains filtered or unexported fields
}

ArchetypeOption represents a row from 'public.archetype_option'.

func ArchetypeOptionByArchetypeIDOptionID

func ArchetypeOptionByArchetypeIDOptionID(ctx context.Context, db DB, archetypeID, optionID int64) (*ArchetypeOption, error)

ArchetypeOptionByArchetypeIDOptionID retrieves a row from 'public.archetype_option' as a ArchetypeOption.

Generated from index 'archetype_option_pkey'.

func (*ArchetypeOption) Archetype

func (ao *ArchetypeOption) Archetype(ctx context.Context, db DB) (*Archetype, error)

Archetype returns the Archetype associated with the ArchetypeOption's (ArchetypeID).

Generated from foreign key 'archetype_option_archetype_id_fkey'.

func (*ArchetypeOption) Delete

func (ao *ArchetypeOption) Delete(ctx context.Context, db DB) error

Delete deletes the ArchetypeOption from the database.

func (*ArchetypeOption) Deleted

func (ao *ArchetypeOption) Deleted() bool

Deleted returns true when the ArchetypeOption has been marked for deletion from the database.

func (*ArchetypeOption) Exists

func (ao *ArchetypeOption) Exists() bool

Exists returns true when the ArchetypeOption exists in the database.

func (*ArchetypeOption) Insert

func (ao *ArchetypeOption) Insert(ctx context.Context, db DB) error

Insert inserts the ArchetypeOption to the database.

func (*ArchetypeOption) Option

func (ao *ArchetypeOption) Option(ctx context.Context, db DB) (*Option, error)

Option returns the Option associated with the ArchetypeOption's (OptionID).

Generated from foreign key 'archetype_option_option_id_fkey'.

type ArchetypeProperty

type ArchetypeProperty struct {
	ArchetypeID int64 `json:"archetype_id" db:"archetype_id"` // archetype_id
	PropertyID  int64 `json:"property_id" db:"property_id"`   // property_id
	// contains filtered or unexported fields
}

ArchetypeProperty represents a row from 'public.archetype_property'.

func ArchetypePropertyByArchetypeIDPropertyID

func ArchetypePropertyByArchetypeIDPropertyID(ctx context.Context, db DB, archetypeID, propertyID int64) (*ArchetypeProperty, error)

ArchetypePropertyByArchetypeIDPropertyID retrieves a row from 'public.archetype_property' as a ArchetypeProperty.

Generated from index 'archetype_property_pkey'.

func (*ArchetypeProperty) Archetype

func (ap *ArchetypeProperty) Archetype(ctx context.Context, db DB) (*Archetype, error)

Archetype returns the Archetype associated with the ArchetypeProperty's (ArchetypeID).

Generated from foreign key 'archetype_property_archetype_id_fkey'.

func (*ArchetypeProperty) Delete

func (ap *ArchetypeProperty) Delete(ctx context.Context, db DB) error

Delete deletes the ArchetypeProperty from the database.

func (*ArchetypeProperty) Deleted

func (ap *ArchetypeProperty) Deleted() bool

Deleted returns true when the ArchetypeProperty has been marked for deletion from the database.

func (*ArchetypeProperty) Exists

func (ap *ArchetypeProperty) Exists() bool

Exists returns true when the ArchetypeProperty exists in the database.

func (*ArchetypeProperty) Insert

func (ap *ArchetypeProperty) Insert(ctx context.Context, db DB) error

Insert inserts the ArchetypeProperty to the database.

func (*ArchetypeProperty) Property

func (ap *ArchetypeProperty) Property(ctx context.Context, db DB) (*Property, error)

Property returns the Property associated with the ArchetypeProperty's (PropertyID).

Generated from foreign key 'archetype_property_property_id_fkey'.

type Asset

type Asset struct {
	ID          int64          `json:"id" db:"id"`                     // id
	StoreID     int64          `json:"store_id" db:"store_id"`         // store_id
	ProductID   int64          `json:"product_id" db:"product_id"`     // product_id
	VariantID   int64          `json:"variant_id" db:"variant_id"`     // variant_id
	Name        string         `json:"name" db:"name"`                 // name
	URL         string         `json:"url" db:"url"`                   // url
	DisplayName sql.NullString `json:"display_name" db:"display_name"` // display_name
	Kind        int            `json:"kind" db:"kind"`                 // kind
	ContentType string         `json:"content_type" db:"content_type"` // content_type
	SortOrder   sql.NullInt64  `json:"sort_order" db:"sort_order"`     // sort_order
	Sizes       []byte         `json:"sizes" db:"sizes"`               // sizes
	// contains filtered or unexported fields
}

Asset represents a row from 'public.asset'.

func AssetByID

func AssetByID(ctx context.Context, db DB, id int64) (*Asset, error)

AssetByID retrieves a row from 'public.asset' as a Asset.

Generated from index 'asset_pkey'.

func AssetByProductID

func AssetByProductID(ctx context.Context, db DB, productID int64) ([]*Asset, error)

AssetByProductID retrieves a row from 'public.asset' as a Asset.

Generated from index 'idx_asset_product_id'.

func AssetByProductIDKind

func AssetByProductIDKind(ctx context.Context, db DB, productID int64, kind int) ([]*Asset, error)

AssetByProductIDKind retrieves a row from 'public.asset' as a Asset.

Generated from index 'idx_asset_product_id_kind'.

func AssetBySizes

func AssetBySizes(ctx context.Context, db DB, sizes []byte) ([]*Asset, error)

AssetBySizes retrieves a row from 'public.asset' as a Asset.

Generated from index 'idx_asset_sizes'.

func AssetByStoreIDName

func AssetByStoreIDName(ctx context.Context, db DB, storeID int64, name string) (*Asset, error)

AssetByStoreIDName retrieves a row from 'public.asset' as a Asset.

Generated from index 'asset_store_id_name_key'.

func AssetByVariantID

func AssetByVariantID(ctx context.Context, db DB, variantID int64) ([]*Asset, error)

AssetByVariantID retrieves a row from 'public.asset' as a Asset.

Generated from index 'idx_asset_variant_id'.

func (*Asset) Delete

func (a *Asset) Delete(ctx context.Context, db DB) error

Delete deletes the Asset from the database.

func (*Asset) Deleted

func (a *Asset) Deleted() bool

Deleted returns true when the Asset has been marked for deletion from the database.

func (*Asset) Exists

func (a *Asset) Exists() bool

Exists returns true when the Asset exists in the database.

func (*Asset) Insert

func (a *Asset) Insert(ctx context.Context, db DB) error

Insert inserts the Asset to the database.

func (*Asset) Save

func (a *Asset) Save(ctx context.Context, db DB) error

Save saves the Asset to the database.

func (*Asset) Update

func (a *Asset) Update(ctx context.Context, db DB) error

Update updates a Asset in the database.

func (*Asset) Upsert

func (a *Asset) Upsert(ctx context.Context, db DB) error

Upsert performs an upsert for Asset.

type Cart

type Cart struct {
	ID              uuid.UUID      `json:"id" db:"id"`                             // id
	StoreID         int64          `json:"store_id" db:"store_id"`                 // store_id
	CustomerID      sql.NullInt64  `json:"customer_id" db:"customer_id"`           // customer_id
	FirstName       sql.NullString `json:"first_name" db:"first_name"`             // first_name
	LastName        sql.NullString `json:"last_name" db:"last_name"`               // last_name
	Company         sql.NullString `json:"company" db:"company"`                   // company
	Phone           sql.NullString `json:"phone" db:"phone"`                       // phone
	Email           sql.NullString `json:"email" db:"email"`                       // email
	BillingAddress  []byte         `json:"billing_address" db:"billing_address"`   // billing_address
	ShippingAddress []byte         `json:"shipping_address" db:"shipping_address"` // shipping_address
	DiscountID      sql.NullInt64  `json:"discount_id" db:"discount_id"`           // discount_id
	Status          CartStatus     `json:"status" db:"status"`                     // status
	Currency        sql.NullString `json:"currency" db:"currency"`                 // currency
	ExpiresAt       sql.NullTime   `json:"expires_at" db:"expires_at"`             // expires_at
	AbandonedAt     sql.NullTime   `json:"abandoned_at" db:"abandoned_at"`         // abandoned_at
	// contains filtered or unexported fields
}

Cart represents a row from 'public.cart'.

func CartByCustomerID

func CartByCustomerID(ctx context.Context, db DB, customerID sql.NullInt64) ([]*Cart, error)

CartByCustomerID retrieves a row from 'public.cart' as a Cart.

Generated from index 'idx_cart_customer_id'.

func CartByID

func CartByID(ctx context.Context, db DB, id uuid.UUID) (*Cart, error)

CartByID retrieves a row from 'public.cart' as a Cart.

Generated from index 'cart_pkey'.

func CartByStoreID

func CartByStoreID(ctx context.Context, db DB, storeID int64) ([]*Cart, error)

CartByStoreID retrieves a row from 'public.cart' as a Cart.

Generated from index 'idx_cart_store_id'.

func (*Cart) Customer

func (c *Cart) Customer(ctx context.Context, db DB) (*Customer, error)

Customer returns the Customer associated with the Cart's (CustomerID).

Generated from foreign key 'cart_customer_id_fkey'.

func (*Cart) Delete

func (c *Cart) Delete(ctx context.Context, db DB) error

Delete deletes the Cart from the database.

func (*Cart) Deleted

func (c *Cart) Deleted() bool

Deleted returns true when the Cart has been marked for deletion from the database.

func (*Cart) Exists

func (c *Cart) Exists() bool

Exists returns true when the Cart exists in the database.

func (*Cart) Insert

func (c *Cart) Insert(ctx context.Context, db DB) error

Insert inserts the Cart to the database.

func (*Cart) Save

func (c *Cart) Save(ctx context.Context, db DB) error

Save saves the Cart to the database.

func (*Cart) Store

func (c *Cart) Store(ctx context.Context, db DB) (*Store, error)

Store returns the Store associated with the Cart's (StoreID).

Generated from foreign key 'cart_store_id_fkey'.

func (*Cart) Update

func (c *Cart) Update(ctx context.Context, db DB) error

Update updates a Cart in the database.

func (*Cart) Upsert

func (c *Cart) Upsert(ctx context.Context, db DB) error

Upsert performs an upsert for Cart.

type CartItem

type CartItem struct {
	CartID      uuid.UUID      `json:"cart_id" db:"cart_id"`           // cart_id
	Sku         string         `json:"sku" db:"sku"`                   // sku
	Quantity    int            `json:"quantity" db:"quantity"`         // quantity
	Price       int64          `json:"price" db:"price"`               // price
	Currency    sql.NullString `json:"currency" db:"currency"`         // currency
	ExpiresAt   sql.NullTime   `json:"expires_at" db:"expires_at"`     // expires_at
	AbandonedAt sql.NullTime   `json:"abandoned_at" db:"abandoned_at"` // abandoned_at
	// contains filtered or unexported fields
}

CartItem represents a row from 'public.cart_item'.

func CartItemByAbandonedAt

func CartItemByAbandonedAt(ctx context.Context, db DB, abandonedAt sql.NullTime) ([]*CartItem, error)

CartItemByAbandonedAt retrieves a row from 'public.cart_item' as a CartItem.

Generated from index 'idx_cart_item_abandoned_at'.

func CartItemByCartID

func CartItemByCartID(ctx context.Context, db DB, cartID uuid.UUID) ([]*CartItem, error)

CartItemByCartID retrieves a row from 'public.cart_item' as a CartItem.

Generated from index 'idx_cart_item_cart_id'.

func CartItemByCartIDSku

func CartItemByCartIDSku(ctx context.Context, db DB, cartID uuid.UUID, sku string) (*CartItem, error)

CartItemByCartIDSku retrieves a row from 'public.cart_item' as a CartItem.

Generated from index 'cart_item_pkey'.

func CartItemBySku

func CartItemBySku(ctx context.Context, db DB, sku string) ([]*CartItem, error)

CartItemBySku retrieves a row from 'public.cart_item' as a CartItem.

Generated from index 'idx_cart_item_sku'.

func (*CartItem) Cart

func (ci *CartItem) Cart(ctx context.Context, db DB) (*Cart, error)

Cart returns the Cart associated with the CartItem's (CartID).

Generated from foreign key 'cart_item_cart_id_fkey'.

func (*CartItem) Delete

func (ci *CartItem) Delete(ctx context.Context, db DB) error

Delete deletes the CartItem from the database.

func (*CartItem) Deleted

func (ci *CartItem) Deleted() bool

Deleted returns true when the CartItem has been marked for deletion from the database.

func (*CartItem) Exists

func (ci *CartItem) Exists() bool

Exists returns true when the CartItem exists in the database.

func (*CartItem) Insert

func (ci *CartItem) Insert(ctx context.Context, db DB) error

Insert inserts the CartItem to the database.

func (*CartItem) Save

func (ci *CartItem) Save(ctx context.Context, db DB) error

Save saves the CartItem to the database.

func (*CartItem) Update

func (ci *CartItem) Update(ctx context.Context, db DB) error

Update updates a CartItem in the database.

func (*CartItem) Upsert

func (ci *CartItem) Upsert(ctx context.Context, db DB) error

Upsert performs an upsert for CartItem.

func (*CartItem) Variant

func (ci *CartItem) Variant(ctx context.Context, db DB) (*Variant, error)

Variant returns the Variant associated with the CartItem's (Sku).

Generated from foreign key 'cart_item_sku_fkey'.

type CartStatus

type CartStatus uint16

CartStatus is the 'cart_status' enum type from schema 'public'.

const (
	// CartStatusNew is the 'new' cart_status.
	CartStatusNew CartStatus = 1
	// CartStatusCheckout is the 'checkout' cart_status.
	CartStatusCheckout CartStatus = 2
	// CartStatusPaid is the 'paid' cart_status.
	CartStatusPaid CartStatus = 3
	// CartStatusComplete is the 'complete' cart_status.
	CartStatusComplete CartStatus = 4
	// CartStatusAbandoned is the 'abandoned' cart_status.
	CartStatusAbandoned CartStatus = 5
)

CartStatus values.

func (CartStatus) MarshalText

func (cs CartStatus) MarshalText() ([]byte, error)

MarshalText marshals CartStatus into text.

func (*CartStatus) Scan

func (cs *CartStatus) Scan(v interface{}) error

Scan satisfies the sql.Scanner interface.

func (CartStatus) String

func (cs CartStatus) String() string

String satisfies the fmt.Stringer interface.

func (*CartStatus) UnmarshalText

func (cs *CartStatus) UnmarshalText(buf []byte) error

UnmarshalText unmarshals CartStatus from text.

func (CartStatus) Value

func (cs CartStatus) Value() (driver.Value, error)

Value satisfies the driver.Valuer interface.

type Category

type Category struct {
	ID              int64          `json:"id" db:"id"`                             // id
	ParentID        sql.NullInt64  `json:"parent_id" db:"parent_id"`               // parent_id
	StoreID         int64          `json:"store_id" db:"store_id"`                 // store_id
	Slug            string         `json:"slug" db:"slug"`                         // slug
	Name            string         `json:"name" db:"name"`                         // name
	Description     sql.NullString `json:"description" db:"description"`           // description
	MetaTitle       sql.NullString `json:"meta_title" db:"meta_title"`             // meta_title
	MetaDescription sql.NullString `json:"meta_description" db:"meta_description"` // meta_description
	MetaKeywords    sql.NullString `json:"meta_keywords" db:"meta_keywords"`       // meta_keywords
	HideFromNav     sql.NullBool   `json:"hide_from_nav" db:"hide_from_nav"`       // hide_from_nav
	Lft             sql.NullInt64  `json:"lft" db:"lft"`                           // lft
	Rgt             sql.NullInt64  `json:"rgt" db:"rgt"`                           // rgt
	Depth           sql.NullInt64  `json:"depth" db:"depth"`                       // depth
	SortOrder       sql.NullInt64  `json:"sort_order" db:"sort_order"`             // sort_order
	// contains filtered or unexported fields
}

Category represents a row from 'public.category'.

func CategoryByDepth

func CategoryByDepth(ctx context.Context, db DB, depth sql.NullInt64) ([]*Category, error)

CategoryByDepth retrieves a row from 'public.category' as a Category.

Generated from index 'idx_category_depth'.

func CategoryByID

func CategoryByID(ctx context.Context, db DB, id int64) (*Category, error)

CategoryByID retrieves a row from 'public.category' as a Category.

Generated from index 'category_pkey'.

func CategoryByLft

func CategoryByLft(ctx context.Context, db DB, lft sql.NullInt64) ([]*Category, error)

CategoryByLft retrieves a row from 'public.category' as a Category.

Generated from index 'idx_category_lft'.

func CategoryByParentID

func CategoryByParentID(ctx context.Context, db DB, parentID sql.NullInt64) ([]*Category, error)

CategoryByParentID retrieves a row from 'public.category' as a Category.

Generated from index 'idx_category_parent_id'.

func CategoryByRgt

func CategoryByRgt(ctx context.Context, db DB, rgt sql.NullInt64) ([]*Category, error)

CategoryByRgt retrieves a row from 'public.category' as a Category.

Generated from index 'idx_category_rgt'.

func CategoryByStoreID

func CategoryByStoreID(ctx context.Context, db DB, storeID int64) ([]*Category, error)

CategoryByStoreID retrieves a row from 'public.category' as a Category.

Generated from index 'idx_category_store_id'.

func CategoryByStoreIDSlug

func CategoryByStoreIDSlug(ctx context.Context, db DB, storeID int64, slug string) (*Category, error)

CategoryByStoreIDSlug retrieves a row from 'public.category' as a Category.

Generated from index 'category_store_id_slug_key'.

func (*Category) Category

func (c *Category) Category(ctx context.Context, db DB) (*Category, error)

Category returns the Category associated with the Category's (ParentID).

Generated from foreign key 'category_parent_id_fkey'.

func (*Category) Delete

func (c *Category) Delete(ctx context.Context, db DB) error

Delete deletes the Category from the database.

func (*Category) Deleted

func (c *Category) Deleted() bool

Deleted returns true when the Category has been marked for deletion from the database.

func (*Category) Exists

func (c *Category) Exists() bool

Exists returns true when the Category exists in the database.

func (*Category) Insert

func (c *Category) Insert(ctx context.Context, db DB) error

Insert inserts the Category to the database.

func (*Category) Save

func (c *Category) Save(ctx context.Context, db DB) error

Save saves the Category to the database.

func (*Category) Update

func (c *Category) Update(ctx context.Context, db DB) error

Update updates a Category in the database.

func (*Category) Upsert

func (c *Category) Upsert(ctx context.Context, db DB) error

Upsert performs an upsert for Category.

type Customer

type Customer struct {
	ID         int64          `json:"id" db:"id"`                   // id
	StoreID    int64          `json:"store_id" db:"store_id"`       // store_id
	FirstName  string         `json:"first_name" db:"first_name"`   // first_name
	LastName   string         `json:"last_name" db:"last_name"`     // last_name
	Company    sql.NullString `json:"company" db:"company"`         // company
	Phone      sql.NullString `json:"phone" db:"phone"`             // phone
	Email      string         `json:"email" db:"email"`             // email
	Password   sql.NullString `json:"password" db:"password"`       // password
	IsVerified bool           `json:"is_verified" db:"is_verified"` // is_verified
	// contains filtered or unexported fields
}

Customer represents a row from 'public.customer'.

func CustomerByEmail

func CustomerByEmail(ctx context.Context, db DB, email string) (*Customer, error)

CustomerByEmail retrieves a row from 'public.customer' as a Customer.

Generated from index 'customer_email_key'.

func CustomerByID

func CustomerByID(ctx context.Context, db DB, id int64) (*Customer, error)

CustomerByID retrieves a row from 'public.customer' as a Customer.

Generated from index 'customer_pkey'.

func CustomerByStoreID

func CustomerByStoreID(ctx context.Context, db DB, storeID int64) ([]*Customer, error)

CustomerByStoreID retrieves a row from 'public.customer' as a Customer.

Generated from index 'idx_customer_store_id'.

func CustomerByStoreIDEmail

func CustomerByStoreIDEmail(ctx context.Context, db DB, storeID int64, email string) (*Customer, error)

CustomerByStoreIDEmail retrieves a row from 'public.customer' as a Customer.

Generated from index 'customer_store_id_email_key'.

func (*Customer) Delete

func (c *Customer) Delete(ctx context.Context, db DB) error

Delete deletes the Customer from the database.

func (*Customer) Deleted

func (c *Customer) Deleted() bool

Deleted returns true when the Customer has been marked for deletion from the database.

func (*Customer) Exists

func (c *Customer) Exists() bool

Exists returns true when the Customer exists in the database.

func (*Customer) Insert

func (c *Customer) Insert(ctx context.Context, db DB) error

Insert inserts the Customer to the database.

func (*Customer) Save

func (c *Customer) Save(ctx context.Context, db DB) error

Save saves the Customer to the database.

func (*Customer) Update

func (c *Customer) Update(ctx context.Context, db DB) error

Update updates a Customer in the database.

func (*Customer) Upsert

func (c *Customer) Upsert(ctx context.Context, db DB) error

Upsert performs an upsert for Customer.

type CustomerAddress

type CustomerAddress struct {
	ID            int64          `json:"id" db:"id"`                         // id
	StoreID       int64          `json:"store_id" db:"store_id"`             // store_id
	CustomerID    int64          `json:"customer_id" db:"customer_id"`       // customer_id
	Kind          AddressKind    `json:"kind" db:"kind"`                     // kind
	IsDefault     bool           `json:"is_default" db:"is_default"`         // is_default
	Street        string         `json:"street" db:"street"`                 // street
	AptSuite      sql.NullString `json:"apt_suite" db:"apt_suite"`           // apt_suite
	City          string         `json:"city" db:"city"`                     // city
	StateProvince string         `json:"state_province" db:"state_province"` // state_province
	Country       string         `json:"country" db:"country"`               // country
	PostalCode    string         `json:"postal_code" db:"postal_code"`       // postal_code
	// contains filtered or unexported fields
}

CustomerAddress represents a row from 'public.customer_address'.

func CustomerAddressByCustomerIDKind

func CustomerAddressByCustomerIDKind(ctx context.Context, db DB, customerID int64, kind AddressKind) ([]*CustomerAddress, error)

CustomerAddressByCustomerIDKind retrieves a row from 'public.customer_address' as a CustomerAddress.

Generated from index 'idx_customer_address_customer_id_kind'.

func CustomerAddressByID

func CustomerAddressByID(ctx context.Context, db DB, id int64) (*CustomerAddress, error)

CustomerAddressByID retrieves a row from 'public.customer_address' as a CustomerAddress.

Generated from index 'customer_address_pkey'.

func CustomerAddressByStoreID

func CustomerAddressByStoreID(ctx context.Context, db DB, storeID int64) ([]*CustomerAddress, error)

CustomerAddressByStoreID retrieves a row from 'public.customer_address' as a CustomerAddress.

Generated from index 'idx_customer_address_store_id'.

func (*CustomerAddress) Delete

func (ca *CustomerAddress) Delete(ctx context.Context, db DB) error

Delete deletes the CustomerAddress from the database.

func (*CustomerAddress) Deleted

func (ca *CustomerAddress) Deleted() bool

Deleted returns true when the CustomerAddress has been marked for deletion from the database.

func (*CustomerAddress) Exists

func (ca *CustomerAddress) Exists() bool

Exists returns true when the CustomerAddress exists in the database.

func (*CustomerAddress) Insert

func (ca *CustomerAddress) Insert(ctx context.Context, db DB) error

Insert inserts the CustomerAddress to the database.

func (*CustomerAddress) Save

func (ca *CustomerAddress) Save(ctx context.Context, db DB) error

Save saves the CustomerAddress to the database.

func (*CustomerAddress) Update

func (ca *CustomerAddress) Update(ctx context.Context, db DB) error

Update updates a CustomerAddress in the database.

func (*CustomerAddress) Upsert

func (ca *CustomerAddress) Upsert(ctx context.Context, db DB) error

Upsert performs an upsert for CustomerAddress.

type CustomerPasswordReset

type CustomerPasswordReset struct {
	ID         int64        `json:"id" db:"id"`                   // id
	StoreID    int64        `json:"store_id" db:"store_id"`       // store_id
	CustomerID int64        `json:"customer_id" db:"customer_id"` // customer_id
	Token      string       `json:"token" db:"token"`             // token
	RedeemedAt sql.NullTime `json:"redeemed_at" db:"redeemed_at"` // redeemed_at
	ExpiredAt  sql.NullTime `json:"expired_at" db:"expired_at"`   // expired_at
	// contains filtered or unexported fields
}

CustomerPasswordReset represents a row from 'public.customer_password_reset'.

func CustomerPasswordResetByID

func CustomerPasswordResetByID(ctx context.Context, db DB, id int64) (*CustomerPasswordReset, error)

CustomerPasswordResetByID retrieves a row from 'public.customer_password_reset' as a CustomerPasswordReset.

Generated from index 'customer_password_reset_pkey'.

func CustomerPasswordResetByStoreID

func CustomerPasswordResetByStoreID(ctx context.Context, db DB, storeID int64) ([]*CustomerPasswordReset, error)

CustomerPasswordResetByStoreID retrieves a row from 'public.customer_password_reset' as a CustomerPasswordReset.

Generated from index 'idx_customer_password_reset_store_id'.

func CustomerPasswordResetByToken

func CustomerPasswordResetByToken(ctx context.Context, db DB, token string) (*CustomerPasswordReset, error)

CustomerPasswordResetByToken retrieves a row from 'public.customer_password_reset' as a CustomerPasswordReset.

Generated from index 'customer_password_reset_token_key'.

func (*CustomerPasswordReset) Customer

func (cpr *CustomerPasswordReset) Customer(ctx context.Context, db DB) (*Customer, error)

Customer returns the Customer associated with the CustomerPasswordReset's (CustomerID).

Generated from foreign key 'customer_password_reset_customer_id_fkey'.

func (*CustomerPasswordReset) Delete

func (cpr *CustomerPasswordReset) Delete(ctx context.Context, db DB) error

Delete deletes the CustomerPasswordReset from the database.

func (*CustomerPasswordReset) Deleted

func (cpr *CustomerPasswordReset) Deleted() bool

Deleted returns true when the CustomerPasswordReset has been marked for deletion from the database.

func (*CustomerPasswordReset) Exists

func (cpr *CustomerPasswordReset) Exists() bool

Exists returns true when the CustomerPasswordReset exists in the database.

func (*CustomerPasswordReset) Insert

func (cpr *CustomerPasswordReset) Insert(ctx context.Context, db DB) error

Insert inserts the CustomerPasswordReset to the database.

func (*CustomerPasswordReset) Save

func (cpr *CustomerPasswordReset) Save(ctx context.Context, db DB) error

Save saves the CustomerPasswordReset to the database.

func (*CustomerPasswordReset) Update

func (cpr *CustomerPasswordReset) Update(ctx context.Context, db DB) error

Update updates a CustomerPasswordReset in the database.

func (*CustomerPasswordReset) Upsert

func (cpr *CustomerPasswordReset) Upsert(ctx context.Context, db DB) error

Upsert performs an upsert for CustomerPasswordReset.

type DB

type DB interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

DB is the common interface for database operations that can be used with types from schema 'public'.

This works with both database/sql.DB and database/sql.Tx.

type ErrDecodeFailed

type ErrDecodeFailed struct {
	Err error
}

ErrDecodeFailed is the decode failed error.

func (*ErrDecodeFailed) Error

func (err *ErrDecodeFailed) Error() string

Error satisfies the error interface.

func (*ErrDecodeFailed) Unwrap

func (err *ErrDecodeFailed) Unwrap() error

Unwrap satisfies the unwrap interface.

type ErrInsertFailed

type ErrInsertFailed struct {
	Err error
}

ErrInsertFailed is the insert failed error.

func (*ErrInsertFailed) Error

func (err *ErrInsertFailed) Error() string

Error satisfies the error interface.

func (*ErrInsertFailed) Unwrap

func (err *ErrInsertFailed) Unwrap() error

Unwrap satisfies the unwrap interface.

type ErrInvalidAddressKind

type ErrInvalidAddressKind string

ErrInvalidAddressKind is the invalid AddressKind error.

func (ErrInvalidAddressKind) Error

func (err ErrInvalidAddressKind) Error() string

Error satisfies the error interface.

type ErrInvalidCartStatus

type ErrInvalidCartStatus string

ErrInvalidCartStatus is the invalid CartStatus error.

func (ErrInvalidCartStatus) Error

func (err ErrInvalidCartStatus) Error() string

Error satisfies the error interface.

type ErrInvalidTransactionKind

type ErrInvalidTransactionKind string

ErrInvalidTransactionKind is the invalid TransactionKind error.

func (ErrInvalidTransactionKind) Error

func (err ErrInvalidTransactionKind) Error() string

Error satisfies the error interface.

type ErrUpdateFailed

type ErrUpdateFailed struct {
	Err error
}

ErrUpdateFailed is the update failed error.

func (*ErrUpdateFailed) Error

func (err *ErrUpdateFailed) Error() string

Error satisfies the error interface.

func (*ErrUpdateFailed) Unwrap

func (err *ErrUpdateFailed) Unwrap() error

Unwrap satisfies the unwrap interface.

type ErrUpsertFailed

type ErrUpsertFailed struct {
	Err error
}

ErrUpsertFailed is the upsert failed error.

func (*ErrUpsertFailed) Error

func (err *ErrUpsertFailed) Error() string

Error satisfies the error interface.

func (*ErrUpsertFailed) Unwrap

func (err *ErrUpsertFailed) Unwrap() error

Unwrap satisfies the unwrap interface.

type Error

type Error string

Error is an error.

const (
	// ErrAlreadyExists is the already exists error.
	ErrAlreadyExists Error = "already exists"
	// ErrDoesNotExist is the does not exist error.
	ErrDoesNotExist Error = "does not exist"
	// ErrMarkedForDeletion is the marked for deletion error.
	ErrMarkedForDeletion Error = "marked for deletion"
)

Error values.

const ErrInvalidStringSlice Error = "invalid StringSlice"

ErrInvalidStringSlice is the invalid StringSlice error.

func (Error) Error

func (err Error) Error() string

Error satisfies the error interface.

type InventoryBrand

type InventoryBrand struct {
	ID      int64  `json:"id" db:"id"`             // id
	StoreID int64  `json:"store_id" db:"store_id"` // store_id
	Name    string `json:"name" db:"name"`         // name
	// contains filtered or unexported fields
}

InventoryBrand represents a row from 'public.inventory_brand'.

func InventoryBrandByID

func InventoryBrandByID(ctx context.Context, db DB, id int64) (*InventoryBrand, error)

InventoryBrandByID retrieves a row from 'public.inventory_brand' as a InventoryBrand.

Generated from index 'inventory_brand_pkey'.

func (*InventoryBrand) Delete

func (ib *InventoryBrand) Delete(ctx context.Context, db DB) error

Delete deletes the InventoryBrand from the database.

func (*InventoryBrand) Deleted

func (ib *InventoryBrand) Deleted() bool

Deleted returns true when the InventoryBrand has been marked for deletion from the database.

func (*InventoryBrand) Exists

func (ib *InventoryBrand) Exists() bool

Exists returns true when the InventoryBrand exists in the database.

func (*InventoryBrand) Insert

func (ib *InventoryBrand) Insert(ctx context.Context, db DB) error

Insert inserts the InventoryBrand to the database.

func (*InventoryBrand) Save

func (ib *InventoryBrand) Save(ctx context.Context, db DB) error

Save saves the InventoryBrand to the database.

func (*InventoryBrand) Update

func (ib *InventoryBrand) Update(ctx context.Context, db DB) error

Update updates a InventoryBrand in the database.

func (*InventoryBrand) Upsert

func (ib *InventoryBrand) Upsert(ctx context.Context, db DB) error

Upsert performs an upsert for InventoryBrand.

type InventoryItem

type InventoryItem struct {
	ID         int64  `json:"id" db:"id"`                   // id
	StoreID    int64  `json:"store_id" db:"store_id"`       // store_id
	Sku        string `json:"sku" db:"sku"`                 // sku
	Name       string `json:"name" db:"name"`               // name
	SupplierID int64  `json:"supplier_id" db:"supplier_id"` // supplier_id
	BrandID    int64  `json:"brand_id" db:"brand_id"`       // brand_id
	// contains filtered or unexported fields
}

InventoryItem represents a row from 'public.inventory_item'.

func InventoryItemByID

func InventoryItemByID(ctx context.Context, db DB, id int64) (*InventoryItem, error)

InventoryItemByID retrieves a row from 'public.inventory_item' as a InventoryItem.

Generated from index 'inventory_item_pkey'.

func (*InventoryItem) Delete

func (ii *InventoryItem) Delete(ctx context.Context, db DB) error

Delete deletes the InventoryItem from the database.

func (*InventoryItem) Deleted

func (ii *InventoryItem) Deleted() bool

Deleted returns true when the InventoryItem has been marked for deletion from the database.

func (*InventoryItem) Exists

func (ii *InventoryItem) Exists() bool

Exists returns true when the InventoryItem exists in the database.

func (*InventoryItem) Insert

func (ii *InventoryItem) Insert(ctx context.Context, db DB) error

Insert inserts the InventoryItem to the database.

func (*InventoryItem) Save

func (ii *InventoryItem) Save(ctx context.Context, db DB) error

Save saves the InventoryItem to the database.

func (*InventoryItem) Update

func (ii *InventoryItem) Update(ctx context.Context, db DB) error

Update updates a InventoryItem in the database.

func (*InventoryItem) Upsert

func (ii *InventoryItem) Upsert(ctx context.Context, db DB) error

Upsert performs an upsert for InventoryItem.

type InventoryStock

type InventoryStock struct {
	ID              int64 `json:"id" db:"id"`                               // id
	StoreID         int64 `json:"store_id" db:"store_id"`                   // store_id
	WarehouseID     int64 `json:"warehouse_id" db:"warehouse_id"`           // warehouse_id
	InventoryItemID int64 `json:"inventory_item_id" db:"inventory_item_id"` // inventory_item_id
	Quantity        int   `json:"quantity" db:"quantity"`                   // quantity
	// contains filtered or unexported fields
}

InventoryStock represents a row from 'public.inventory_stock'.

func InventoryStockByID

func InventoryStockByID(ctx context.Context, db DB, id int64) (*InventoryStock, error)

InventoryStockByID retrieves a row from 'public.inventory_stock' as a InventoryStock.

Generated from index 'inventory_stock_pkey'.

func (*InventoryStock) Delete

func (is *InventoryStock) Delete(ctx context.Context, db DB) error

Delete deletes the InventoryStock from the database.

func (*InventoryStock) Deleted

func (is *InventoryStock) Deleted() bool

Deleted returns true when the InventoryStock has been marked for deletion from the database.

func (*InventoryStock) Exists

func (is *InventoryStock) Exists() bool

Exists returns true when the InventoryStock exists in the database.

func (*InventoryStock) Insert

func (is *InventoryStock) Insert(ctx context.Context, db DB) error

Insert inserts the InventoryStock to the database.

func (*InventoryStock) Save

func (is *InventoryStock) Save(ctx context.Context, db DB) error

Save saves the InventoryStock to the database.

func (*InventoryStock) Update

func (is *InventoryStock) Update(ctx context.Context, db DB) error

Update updates a InventoryStock in the database.

func (*InventoryStock) Upsert

func (is *InventoryStock) Upsert(ctx context.Context, db DB) error

Upsert performs an upsert for InventoryStock.

type InventorySupplier

type InventorySupplier struct {
	ID      int64  `json:"id" db:"id"`             // id
	StoreID int64  `json:"store_id" db:"store_id"` // store_id
	Name    string `json:"name" db:"name"`         // name
	// contains filtered or unexported fields
}

InventorySupplier represents a row from 'public.inventory_supplier'.

func InventorySupplierByID

func InventorySupplierByID(ctx context.Context, db DB, id int64) (*InventorySupplier, error)

InventorySupplierByID retrieves a row from 'public.inventory_supplier' as a InventorySupplier.

Generated from index 'inventory_supplier_pkey'.

func (*InventorySupplier) Delete

func (is *InventorySupplier) Delete(ctx context.Context, db DB) error

Delete deletes the InventorySupplier from the database.

func (*InventorySupplier) Deleted

func (is *InventorySupplier) Deleted() bool

Deleted returns true when the InventorySupplier has been marked for deletion from the database.

func (*InventorySupplier) Exists

func (is *InventorySupplier) Exists() bool

Exists returns true when the InventorySupplier exists in the database.

func (*InventorySupplier) Insert

func (is *InventorySupplier) Insert(ctx context.Context, db DB) error

Insert inserts the InventorySupplier to the database.

func (*InventorySupplier) Save

func (is *InventorySupplier) Save(ctx context.Context, db DB) error

Save saves the InventorySupplier to the database.

func (*InventorySupplier) Update

func (is *InventorySupplier) Update(ctx context.Context, db DB) error

Update updates a InventorySupplier in the database.

func (*InventorySupplier) Upsert

func (is *InventorySupplier) Upsert(ctx context.Context, db DB) error

Upsert performs an upsert for InventorySupplier.

type NullAddressKind

type NullAddressKind struct {
	AddressKind AddressKind
	// Valid is true if AddressKind is not null.
	Valid bool
}

NullAddressKind represents a null 'address_kind' enum for schema 'public'.

func (*NullAddressKind) Scan

func (nak *NullAddressKind) Scan(v interface{}) error

Scan satisfies the sql.Scanner interface.

func (NullAddressKind) Value

func (nak NullAddressKind) Value() (driver.Value, error)

Value satisfies the driver.Valuer interface.

type NullCartStatus

type NullCartStatus struct {
	CartStatus CartStatus
	// Valid is true if CartStatus is not null.
	Valid bool
}

NullCartStatus represents a null 'cart_status' enum for schema 'public'.

func (*NullCartStatus) Scan

func (ncs *NullCartStatus) Scan(v interface{}) error

Scan satisfies the sql.Scanner interface.

func (NullCartStatus) Value

func (ncs NullCartStatus) Value() (driver.Value, error)

Value satisfies the driver.Valuer interface.

type NullTransactionKind

type NullTransactionKind struct {
	TransactionKind TransactionKind
	// Valid is true if TransactionKind is not null.
	Valid bool
}

NullTransactionKind represents a null 'transaction_kind' enum for schema 'public'.

func (*NullTransactionKind) Scan

func (ntk *NullTransactionKind) Scan(v interface{}) error

Scan satisfies the sql.Scanner interface.

func (NullTransactionKind) Value

func (ntk NullTransactionKind) Value() (driver.Value, error)

Value satisfies the driver.Valuer interface.

type Option

type Option struct {
	ID          int64  `json:"id" db:"id"`                     // id
	StoreID     int64  `json:"store_id" db:"store_id"`         // store_id
	Name        string `json:"name" db:"name"`                 // name
	DisplayName string `json:"display_name" db:"display_name"` // display_name
	// contains filtered or unexported fields
}

Option represents a row from 'public.option'.

func OptionByID

func OptionByID(ctx context.Context, db DB, id int64) (*Option, error)

OptionByID retrieves a row from 'public.option' as a Option.

Generated from index 'option_pkey'.

func OptionByName

func OptionByName(ctx context.Context, db DB, name string) (*Option, error)

OptionByName retrieves a row from 'public.option' as a Option.

Generated from index 'option_name_key'.

func (*Option) Delete

func (o *Option) Delete(ctx context.Context, db DB) error

Delete deletes the Option from the database.

func (*Option) Deleted

func (o *Option) Deleted() bool

Deleted returns true when the Option has been marked for deletion from the database.

func (*Option) Exists

func (o *Option) Exists() bool

Exists returns true when the Option exists in the database.

func (*Option) Insert

func (o *Option) Insert(ctx context.Context, db DB) error

Insert inserts the Option to the database.

func (*Option) Save

func (o *Option) Save(ctx context.Context, db DB) error

Save saves the Option to the database.

func (*Option) Update

func (o *Option) Update(ctx context.Context, db DB) error

Update updates a Option in the database.

func (*Option) Upsert

func (o *Option) Upsert(ctx context.Context, db DB) error

Upsert performs an upsert for Option.

type OptionItem

type OptionItem struct {
	ID          int64  `json:"id" db:"id"`                     // id
	OptionID    int64  `json:"option_id" db:"option_id"`       // option_id
	Name        string `json:"name" db:"name"`                 // name
	DisplayName string `json:"display_name" db:"display_name"` // display_name
	SortOrder   int    `json:"sort_order" db:"sort_order"`     // sort_order
	// contains filtered or unexported fields
}

OptionItem represents a row from 'public.option_item'.

func OptionItemByID

func OptionItemByID(ctx context.Context, db DB, id int64) (*OptionItem, error)

OptionItemByID retrieves a row from 'public.option_item' as a OptionItem.

Generated from index 'option_item_pkey'.

func OptionItemByName

func OptionItemByName(ctx context.Context, db DB, name string) (*OptionItem, error)

OptionItemByName retrieves a row from 'public.option_item' as a OptionItem.

Generated from index 'option_item_name_key'.

func (*OptionItem) Delete

func (oi *OptionItem) Delete(ctx context.Context, db DB) error

Delete deletes the OptionItem from the database.

func (*OptionItem) Deleted

func (oi *OptionItem) Deleted() bool

Deleted returns true when the OptionItem has been marked for deletion from the database.

func (*OptionItem) Exists

func (oi *OptionItem) Exists() bool

Exists returns true when the OptionItem exists in the database.

func (*OptionItem) Insert

func (oi *OptionItem) Insert(ctx context.Context, db DB) error

Insert inserts the OptionItem to the database.

func (*OptionItem) Option

func (oi *OptionItem) Option(ctx context.Context, db DB) (*Option, error)

Option returns the Option associated with the OptionItem's (OptionID).

Generated from foreign key 'option_item_option_id_fkey'.

func (*OptionItem) Save

func (oi *OptionItem) Save(ctx context.Context, db DB) error

Save saves the OptionItem to the database.

func (*OptionItem) Update

func (oi *OptionItem) Update(ctx context.Context, db DB) error

Update updates a OptionItem in the database.

func (*OptionItem) Upsert

func (oi *OptionItem) Upsert(ctx context.Context, db DB) error

Upsert performs an upsert for OptionItem.

type PaymentGateway

type PaymentGateway struct {
	ID      int64  `json:"id" db:"id"`             // id
	StoreID int64  `json:"store_id" db:"store_id"` // store_id
	Name    string `json:"name" db:"name"`         // name
	// contains filtered or unexported fields
}

PaymentGateway represents a row from 'public.payment_gateway'.

func PaymentGatewayByID

func PaymentGatewayByID(ctx context.Context, db DB, id int64) (*PaymentGateway, error)

PaymentGatewayByID retrieves a row from 'public.payment_gateway' as a PaymentGateway.

Generated from index 'payment_gateway_pkey'.

func (*PaymentGateway) Delete

func (pg *PaymentGateway) Delete(ctx context.Context, db DB) error

Delete deletes the PaymentGateway from the database.

func (*PaymentGateway) Deleted

func (pg *PaymentGateway) Deleted() bool

Deleted returns true when the PaymentGateway has been marked for deletion from the database.

func (*PaymentGateway) Exists

func (pg *PaymentGateway) Exists() bool

Exists returns true when the PaymentGateway exists in the database.

func (*PaymentGateway) Insert

func (pg *PaymentGateway) Insert(ctx context.Context, db DB) error

Insert inserts the PaymentGateway to the database.

func (*PaymentGateway) Save

func (pg *PaymentGateway) Save(ctx context.Context, db DB) error

Save saves the PaymentGateway to the database.

func (*PaymentGateway) Update

func (pg *PaymentGateway) Update(ctx context.Context, db DB) error

Update updates a PaymentGateway in the database.

func (*PaymentGateway) Upsert

func (pg *PaymentGateway) Upsert(ctx context.Context, db DB) error

Upsert performs an upsert for PaymentGateway.

type PaymentTransaction

type PaymentTransaction struct {
	ID            int64           `json:"id" db:"id"`                         // id
	StoreID       int64           `json:"store_id" db:"store_id"`             // store_id
	GatewayID     sql.NullInt64   `json:"gateway_id" db:"gateway_id"`         // gateway_id
	ReferenceCode string          `json:"reference_code" db:"reference_code"` // reference_code
	AuthCode      string          `json:"auth_code" db:"auth_code"`           // auth_code
	Response      string          `json:"response" db:"response"`             // response
	Amount        sql.NullInt64   `json:"amount" db:"amount"`                 // amount
	Currency      sql.NullString  `json:"currency" db:"currency"`             // currency
	Kind          TransactionKind `json:"kind" db:"kind"`                     // kind
	IsRecurring   sql.NullBool    `json:"is_recurring" db:"is_recurring"`     // is_recurring
	// contains filtered or unexported fields
}

PaymentTransaction represents a row from 'public.payment_transaction'.

func PaymentTransactionByID

func PaymentTransactionByID(ctx context.Context, db DB, id int64) (*PaymentTransaction, error)

PaymentTransactionByID retrieves a row from 'public.payment_transaction' as a PaymentTransaction.

Generated from index 'payment_transaction_pkey'.

func PaymentTransactionByKind

func PaymentTransactionByKind(ctx context.Context, db DB, kind TransactionKind) ([]*PaymentTransaction, error)

PaymentTransactionByKind retrieves a row from 'public.payment_transaction' as a PaymentTransaction.

Generated from index 'idx_payment_transaction_kind'.

func PaymentTransactionByReferenceCode

func PaymentTransactionByReferenceCode(ctx context.Context, db DB, referenceCode string) ([]*PaymentTransaction, error)

PaymentTransactionByReferenceCode retrieves a row from 'public.payment_transaction' as a PaymentTransaction.

Generated from index 'idx_payment_transaction_reference_code'.

func (*PaymentTransaction) Delete

func (pt *PaymentTransaction) Delete(ctx context.Context, db DB) error

Delete deletes the PaymentTransaction from the database.

func (*PaymentTransaction) Deleted

func (pt *PaymentTransaction) Deleted() bool

Deleted returns true when the PaymentTransaction has been marked for deletion from the database.

func (*PaymentTransaction) Exists

func (pt *PaymentTransaction) Exists() bool

Exists returns true when the PaymentTransaction exists in the database.

func (*PaymentTransaction) Insert

func (pt *PaymentTransaction) Insert(ctx context.Context, db DB) error

Insert inserts the PaymentTransaction to the database.

func (*PaymentTransaction) Save

func (pt *PaymentTransaction) Save(ctx context.Context, db DB) error

Save saves the PaymentTransaction to the database.

func (*PaymentTransaction) Update

func (pt *PaymentTransaction) Update(ctx context.Context, db DB) error

Update updates a PaymentTransaction in the database.

func (*PaymentTransaction) Upsert

func (pt *PaymentTransaction) Upsert(ctx context.Context, db DB) error

Upsert performs an upsert for PaymentTransaction.

type PermissionGroup

type PermissionGroup struct {
	ID        int64  `json:"id" db:"id"`                 // id
	GroupName string `json:"group_name" db:"group_name"` // group_name
	// contains filtered or unexported fields
}

PermissionGroup represents a row from 'public.permission_group'.

func PermissionGroupByGroupName

func PermissionGroupByGroupName(ctx context.Context, db DB, groupName string) (*PermissionGroup, error)

PermissionGroupByGroupName retrieves a row from 'public.permission_group' as a PermissionGroup.

Generated from index 'permission_group_group_name_key'.

func PermissionGroupByID

func PermissionGroupByID(ctx context.Context, db DB, id int64) (*PermissionGroup, error)

PermissionGroupByID retrieves a row from 'public.permission_group' as a PermissionGroup.

Generated from index 'permission_group_pkey'.

func (*PermissionGroup) Delete

func (pg *PermissionGroup) Delete(ctx context.Context, db DB) error

Delete deletes the PermissionGroup from the database.

func (*PermissionGroup) Deleted

func (pg *PermissionGroup) Deleted() bool

Deleted returns true when the PermissionGroup has been marked for deletion from the database.

func (*PermissionGroup) Exists

func (pg *PermissionGroup) Exists() bool

Exists returns true when the PermissionGroup exists in the database.

func (*PermissionGroup) Insert

func (pg *PermissionGroup) Insert(ctx context.Context, db DB) error

Insert inserts the PermissionGroup to the database.

func (*PermissionGroup) Save

func (pg *PermissionGroup) Save(ctx context.Context, db DB) error

Save saves the PermissionGroup to the database.

func (*PermissionGroup) Update

func (pg *PermissionGroup) Update(ctx context.Context, db DB) error

Update updates a PermissionGroup in the database.

func (*PermissionGroup) Upsert

func (pg *PermissionGroup) Upsert(ctx context.Context, db DB) error

Upsert performs an upsert for PermissionGroup.

type Price

type Price struct {
	ID          int64          `json:"id" db:"id"`                     // id
	VariantID   int64          `json:"variant_id" db:"variant_id"`     // variant_id
	SalePrice   int64          `json:"sale_price" db:"sale_price"`     // sale_price
	RetailPrice sql.NullInt64  `json:"retail_price" db:"retail_price"` // retail_price
	Currency    sql.NullString `json:"currency" db:"currency"`         // currency
	// contains filtered or unexported fields
}

Price represents a row from 'public.price'.

func PriceByID

func PriceByID(ctx context.Context, db DB, id int64) (*Price, error)

PriceByID retrieves a row from 'public.price' as a Price.

Generated from index 'price_pkey'.

func PriceByVariantID

func PriceByVariantID(ctx context.Context, db DB, variantID int64) ([]*Price, error)

PriceByVariantID retrieves a row from 'public.price' as a Price.

Generated from index 'idx_price_variant_id'.

func (*Price) Delete

func (p *Price) Delete(ctx context.Context, db DB) error

Delete deletes the Price from the database.

func (*Price) Deleted

func (p *Price) Deleted() bool

Deleted returns true when the Price has been marked for deletion from the database.

func (*Price) Exists

func (p *Price) Exists() bool

Exists returns true when the Price exists in the database.

func (*Price) Insert

func (p *Price) Insert(ctx context.Context, db DB) error

Insert inserts the Price to the database.

func (*Price) Save

func (p *Price) Save(ctx context.Context, db DB) error

Save saves the Price to the database.

func (*Price) Update

func (p *Price) Update(ctx context.Context, db DB) error

Update updates a Price in the database.

func (*Price) Upsert

func (p *Price) Upsert(ctx context.Context, db DB) error

Upsert performs an upsert for Price.

func (*Price) Variant

func (p *Price) Variant(ctx context.Context, db DB) (*Variant, error)

Variant returns the Variant associated with the Price's (VariantID).

Generated from foreign key 'price_variant_id_fkey'.

type Product

type Product struct {
	ID               int64          `json:"id" db:"id"`                               // id
	StoreID          int64          `json:"store_id" db:"store_id"`                   // store_id
	Slug             string         `json:"slug" db:"slug"`                           // slug
	Name             string         `json:"name" db:"name"`                           // name
	ShortDescription sql.NullString `json:"short_description" db:"short_description"` // short_description
	Description      sql.NullString `json:"description" db:"description"`             // description
	MetaTitle        sql.NullString `json:"meta_title" db:"meta_title"`               // meta_title
	MetaDescription  sql.NullString `json:"meta_description" db:"meta_description"`   // meta_description
	MetaKeywords     sql.NullString `json:"meta_keywords" db:"meta_keywords"`         // meta_keywords
	Promotionable    bool           `json:"promotionable" db:"promotionable"`         // promotionable
	Featured         bool           `json:"featured" db:"featured"`                   // featured
	AvailableOn      sql.NullTime   `json:"available_on" db:"available_on"`           // available_on
	DiscontinueOn    sql.NullTime   `json:"discontinue_on" db:"discontinue_on"`       // discontinue_on
	// contains filtered or unexported fields
}

Product represents a row from 'public.product'.

func ProductByID

func ProductByID(ctx context.Context, db DB, id int64) (*Product, error)

ProductByID retrieves a row from 'public.product' as a Product.

Generated from index 'product_pkey'.

func ProductBySlug

func ProductBySlug(ctx context.Context, db DB, slug string) (*Product, error)

ProductBySlug retrieves a row from 'public.product' as a Product.

Generated from index 'product_slug_key'.

func ProductByStoreID

func ProductByStoreID(ctx context.Context, db DB, storeID int64) ([]*Product, error)

ProductByStoreID retrieves a row from 'public.product' as a Product.

Generated from index 'idx_product_store_id'.

func (*Product) Delete

func (p *Product) Delete(ctx context.Context, db DB) error

Delete deletes the Product from the database.

func (*Product) Deleted

func (p *Product) Deleted() bool

Deleted returns true when the Product has been marked for deletion from the database.

func (*Product) Exists

func (p *Product) Exists() bool

Exists returns true when the Product exists in the database.

func (*Product) Insert

func (p *Product) Insert(ctx context.Context, db DB) error

Insert inserts the Product to the database.

func (*Product) Save

func (p *Product) Save(ctx context.Context, db DB) error

Save saves the Product to the database.

func (*Product) Update

func (p *Product) Update(ctx context.Context, db DB) error

Update updates a Product in the database.

func (*Product) Upsert

func (p *Product) Upsert(ctx context.Context, db DB) error

Upsert performs an upsert for Product.

type ProductCategory

type ProductCategory struct {
	ProductID  int64 `json:"product_id" db:"product_id"`   // product_id
	CategoryID int64 `json:"category_id" db:"category_id"` // category_id
	// contains filtered or unexported fields
}

ProductCategory represents a row from 'public.product_category'.

func ProductCategoryByProductIDCategoryID

func ProductCategoryByProductIDCategoryID(ctx context.Context, db DB, productID, categoryID int64) (*ProductCategory, error)

ProductCategoryByProductIDCategoryID retrieves a row from 'public.product_category' as a ProductCategory.

Generated from index 'product_category_pkey'.

func (*ProductCategory) Category

func (pc *ProductCategory) Category(ctx context.Context, db DB) (*Category, error)

Category returns the Category associated with the ProductCategory's (CategoryID).

Generated from foreign key 'product_category_category_id_fkey'.

func (*ProductCategory) Delete

func (pc *ProductCategory) Delete(ctx context.Context, db DB) error

Delete deletes the ProductCategory from the database.

func (*ProductCategory) Deleted

func (pc *ProductCategory) Deleted() bool

Deleted returns true when the ProductCategory has been marked for deletion from the database.

func (*ProductCategory) Exists

func (pc *ProductCategory) Exists() bool

Exists returns true when the ProductCategory exists in the database.

func (*ProductCategory) Insert

func (pc *ProductCategory) Insert(ctx context.Context, db DB) error

Insert inserts the ProductCategory to the database.

func (*ProductCategory) Product

func (pc *ProductCategory) Product(ctx context.Context, db DB) (*Product, error)

Product returns the Product associated with the ProductCategory's (ProductID).

Generated from foreign key 'product_category_product_id_fkey'.

type ProductOption

type ProductOption struct {
	ProductID int64 `json:"product_id" db:"product_id"` // product_id
	OptionID  int64 `json:"option_id" db:"option_id"`   // option_id
	// contains filtered or unexported fields
}

ProductOption represents a row from 'public.product_option'.

func ProductOptionByProductIDOptionID

func ProductOptionByProductIDOptionID(ctx context.Context, db DB, productID, optionID int64) (*ProductOption, error)

ProductOptionByProductIDOptionID retrieves a row from 'public.product_option' as a ProductOption.

Generated from index 'product_option_pkey'.

func (*ProductOption) Delete

func (po *ProductOption) Delete(ctx context.Context, db DB) error

Delete deletes the ProductOption from the database.

func (*ProductOption) Deleted

func (po *ProductOption) Deleted() bool

Deleted returns true when the ProductOption has been marked for deletion from the database.

func (*ProductOption) Exists

func (po *ProductOption) Exists() bool

Exists returns true when the ProductOption exists in the database.

func (*ProductOption) Insert

func (po *ProductOption) Insert(ctx context.Context, db DB) error

Insert inserts the ProductOption to the database.

func (*ProductOption) Option

func (po *ProductOption) Option(ctx context.Context, db DB) (*Option, error)

Option returns the Option associated with the ProductOption's (OptionID).

Generated from foreign key 'product_option_option_id_fkey'.

func (*ProductOption) Product

func (po *ProductOption) Product(ctx context.Context, db DB) (*Product, error)

Product returns the Product associated with the ProductOption's (ProductID).

Generated from foreign key 'product_option_product_id_fkey'.

type ProductProperty

type ProductProperty struct {
	ProductID  int64 `json:"product_id" db:"product_id"`   // product_id
	PropertyID int64 `json:"property_id" db:"property_id"` // property_id
	// contains filtered or unexported fields
}

ProductProperty represents a row from 'public.product_property'.

func ProductPropertyByProductIDPropertyID

func ProductPropertyByProductIDPropertyID(ctx context.Context, db DB, productID, propertyID int64) (*ProductProperty, error)

ProductPropertyByProductIDPropertyID retrieves a row from 'public.product_property' as a ProductProperty.

Generated from index 'product_property_pkey'.

func (*ProductProperty) Delete

func (pp *ProductProperty) Delete(ctx context.Context, db DB) error

Delete deletes the ProductProperty from the database.

func (*ProductProperty) Deleted

func (pp *ProductProperty) Deleted() bool

Deleted returns true when the ProductProperty has been marked for deletion from the database.

func (*ProductProperty) Exists

func (pp *ProductProperty) Exists() bool

Exists returns true when the ProductProperty exists in the database.

func (*ProductProperty) Insert

func (pp *ProductProperty) Insert(ctx context.Context, db DB) error

Insert inserts the ProductProperty to the database.

func (*ProductProperty) Product

func (pp *ProductProperty) Product(ctx context.Context, db DB) (*Product, error)

Product returns the Product associated with the ProductProperty's (ProductID).

Generated from foreign key 'product_property_product_id_fkey'.

func (*ProductProperty) Property

func (pp *ProductProperty) Property(ctx context.Context, db DB) (*Property, error)

Property returns the Property associated with the ProductProperty's (PropertyID).

Generated from foreign key 'product_property_property_id_fkey'.

type Property

type Property struct {
	ID          int64  `json:"id" db:"id"`                     // id
	StoreID     int64  `json:"store_id" db:"store_id"`         // store_id
	Name        string `json:"name" db:"name"`                 // name
	DisplayName string `json:"display_name" db:"display_name"` // display_name
	Fiterable   bool   `json:"fiterable" db:"fiterable"`       // fiterable
	FilterParam string `json:"filter_param" db:"filter_param"` // filter_param
	// contains filtered or unexported fields
}

Property represents a row from 'public.property'.

func PropertyByID

func PropertyByID(ctx context.Context, db DB, id int64) (*Property, error)

PropertyByID retrieves a row from 'public.property' as a Property.

Generated from index 'property_pkey'.

func PropertyByName

func PropertyByName(ctx context.Context, db DB, name string) (*Property, error)

PropertyByName retrieves a row from 'public.property' as a Property.

Generated from index 'property_name_key'.

func (*Property) Delete

func (p *Property) Delete(ctx context.Context, db DB) error

Delete deletes the Property from the database.

func (*Property) Deleted

func (p *Property) Deleted() bool

Deleted returns true when the Property has been marked for deletion from the database.

func (*Property) Exists

func (p *Property) Exists() bool

Exists returns true when the Property exists in the database.

func (*Property) Insert

func (p *Property) Insert(ctx context.Context, db DB) error

Insert inserts the Property to the database.

func (*Property) Save

func (p *Property) Save(ctx context.Context, db DB) error

Save saves the Property to the database.

func (*Property) Update

func (p *Property) Update(ctx context.Context, db DB) error

Update updates a Property in the database.

func (*Property) Upsert

func (p *Property) Upsert(ctx context.Context, db DB) error

Upsert performs an upsert for Property.

type Store

type Store struct {
	ID          int64          `json:"id" db:"id"`                   // id
	IsDefault   bool           `json:"is_default" db:"is_default"`   // is_default
	Name        string         `json:"name" db:"name"`               // name
	Description sql.NullString `json:"description" db:"description"` // description
	URL         string         `json:"url" db:"url"`                 // url
	// contains filtered or unexported fields
}

Store represents a row from 'public.store'.

func StoreByID

func StoreByID(ctx context.Context, db DB, id int64) (*Store, error)

StoreByID retrieves a row from 'public.store' as a Store.

Generated from index 'store_pkey'.

func StoreByNameURL

func StoreByNameURL(ctx context.Context, db DB, name, url string) (*Store, error)

StoreByNameURL retrieves a row from 'public.store' as a Store.

Generated from index 'store_name_url_key'.

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, db DB) error

Delete deletes the Store from the database.

func (*Store) Deleted

func (s *Store) Deleted() bool

Deleted returns true when the Store has been marked for deletion from the database.

func (*Store) Exists

func (s *Store) Exists() bool

Exists returns true when the Store exists in the database.

func (*Store) Insert

func (s *Store) Insert(ctx context.Context, db DB) error

Insert inserts the Store to the database.

func (*Store) Save

func (s *Store) Save(ctx context.Context, db DB) error

Save saves the Store to the database.

func (*Store) Update

func (s *Store) Update(ctx context.Context, db DB) error

Update updates a Store in the database.

func (*Store) Upsert

func (s *Store) Upsert(ctx context.Context, db DB) error

Upsert performs an upsert for Store.

type StoreAddress

type StoreAddress struct {
	ID            int64          `json:"id" db:"id"`                         // id
	StoreID       int64          `json:"store_id" db:"store_id"`             // store_id
	Kind          AddressKind    `json:"kind" db:"kind"`                     // kind
	IsDefault     bool           `json:"is_default" db:"is_default"`         // is_default
	Address       sql.NullString `json:"address" db:"address"`               // address
	City          sql.NullString `json:"city" db:"city"`                     // city
	StateProvince sql.NullString `json:"state_province" db:"state_province"` // state_province
	PostalCode    sql.NullString `json:"postal_code" db:"postal_code"`       // postal_code
	Country       sql.NullString `json:"country" db:"country"`               // country
	// contains filtered or unexported fields
}

StoreAddress represents a row from 'public.store_address'.

func StoreAddressByID

func StoreAddressByID(ctx context.Context, db DB, id int64) (*StoreAddress, error)

StoreAddressByID retrieves a row from 'public.store_address' as a StoreAddress.

Generated from index 'store_address_pkey'.

func (*StoreAddress) Delete

func (sa *StoreAddress) Delete(ctx context.Context, db DB) error

Delete deletes the StoreAddress from the database.

func (*StoreAddress) Deleted

func (sa *StoreAddress) Deleted() bool

Deleted returns true when the StoreAddress has been marked for deletion from the database.

func (*StoreAddress) Exists

func (sa *StoreAddress) Exists() bool

Exists returns true when the StoreAddress exists in the database.

func (*StoreAddress) Insert

func (sa *StoreAddress) Insert(ctx context.Context, db DB) error

Insert inserts the StoreAddress to the database.

func (*StoreAddress) Save

func (sa *StoreAddress) Save(ctx context.Context, db DB) error

Save saves the StoreAddress to the database.

func (*StoreAddress) Update

func (sa *StoreAddress) Update(ctx context.Context, db DB) error

Update updates a StoreAddress in the database.

func (*StoreAddress) Upsert

func (sa *StoreAddress) Upsert(ctx context.Context, db DB) error

Upsert performs an upsert for StoreAddress.

type StoreProduct

type StoreProduct struct {
	StoreID   int64 `json:"store_id" db:"store_id"`     // store_id
	ProductID int64 `json:"product_id" db:"product_id"` // product_id
	// contains filtered or unexported fields
}

StoreProduct represents a row from 'public.store_product'.

func StoreProductByStoreIDProductID

func StoreProductByStoreIDProductID(ctx context.Context, db DB, storeID, productID int64) (*StoreProduct, error)

StoreProductByStoreIDProductID retrieves a row from 'public.store_product' as a StoreProduct.

Generated from index 'store_product_pkey'.

func (*StoreProduct) Delete

func (sp *StoreProduct) Delete(ctx context.Context, db DB) error

Delete deletes the StoreProduct from the database.

func (*StoreProduct) Deleted

func (sp *StoreProduct) Deleted() bool

Deleted returns true when the StoreProduct has been marked for deletion from the database.

func (*StoreProduct) Exists

func (sp *StoreProduct) Exists() bool

Exists returns true when the StoreProduct exists in the database.

func (*StoreProduct) Insert

func (sp *StoreProduct) Insert(ctx context.Context, db DB) error

Insert inserts the StoreProduct to the database.

func (*StoreProduct) Product

func (sp *StoreProduct) Product(ctx context.Context, db DB) (*Product, error)

Product returns the Product associated with the StoreProduct's (ProductID).

Generated from foreign key 'store_product_product_id_fkey'.

func (*StoreProduct) Store

func (sp *StoreProduct) Store(ctx context.Context, db DB) (*Store, error)

Store returns the Store associated with the StoreProduct's (StoreID).

Generated from foreign key 'store_product_store_id_fkey'.

type StoreSetting

type StoreSetting struct {
	ID      int64  `json:"id" db:"id"`             // id
	StoreID int64  `json:"store_id" db:"store_id"` // store_id
	Config  []byte `json:"config" db:"config"`     // config
	// contains filtered or unexported fields
}

StoreSetting represents a row from 'public.store_setting'.

func StoreSettingByID

func StoreSettingByID(ctx context.Context, db DB, id int64) (*StoreSetting, error)

StoreSettingByID retrieves a row from 'public.store_setting' as a StoreSetting.

Generated from index 'store_setting_pkey'.

func StoreSettingByStoreID

func StoreSettingByStoreID(ctx context.Context, db DB, storeID int64) (*StoreSetting, error)

StoreSettingByStoreID retrieves a row from 'public.store_setting' as a StoreSetting.

Generated from index 'store_setting_store_id_key'.

func (*StoreSetting) Delete

func (ss *StoreSetting) Delete(ctx context.Context, db DB) error

Delete deletes the StoreSetting from the database.

func (*StoreSetting) Deleted

func (ss *StoreSetting) Deleted() bool

Deleted returns true when the StoreSetting has been marked for deletion from the database.

func (*StoreSetting) Exists

func (ss *StoreSetting) Exists() bool

Exists returns true when the StoreSetting exists in the database.

func (*StoreSetting) Insert

func (ss *StoreSetting) Insert(ctx context.Context, db DB) error

Insert inserts the StoreSetting to the database.

func (*StoreSetting) Save

func (ss *StoreSetting) Save(ctx context.Context, db DB) error

Save saves the StoreSetting to the database.

func (*StoreSetting) Store

func (ss *StoreSetting) Store(ctx context.Context, db DB) (*Store, error)

Store returns the Store associated with the StoreSetting's (StoreID).

Generated from foreign key 'store_setting_store_id_fkey'.

func (*StoreSetting) Update

func (ss *StoreSetting) Update(ctx context.Context, db DB) error

Update updates a StoreSetting in the database.

func (*StoreSetting) Upsert

func (ss *StoreSetting) Upsert(ctx context.Context, db DB) error

Upsert performs an upsert for StoreSetting.

type StringSlice

type StringSlice []string

StringSlice is a slice of strings.

func (*StringSlice) Scan

func (ss *StringSlice) Scan(v interface{}) error

Scan satisfies the sql.Scanner interface for StringSlice.

func (StringSlice) Value

func (ss StringSlice) Value() (driver.Value, error)

Value satisfies the sql/driver.Valuer interface.

type TransactionKind

type TransactionKind uint16

TransactionKind is the 'transaction_kind' enum type from schema 'public'.

const (
	// TransactionKindUnknown is the 'unknown' transaction_kind.
	TransactionKindUnknown TransactionKind = 1
	// TransactionKindSale is the 'sale' transaction_kind.
	TransactionKindSale TransactionKind = 2
	// TransactionKindRefund is the 'refund' transaction_kind.
	TransactionKindRefund TransactionKind = 3
	// TransactionKindChargeback is the 'chargeback' transaction_kind.
	TransactionKindChargeback TransactionKind = 4
)

TransactionKind values.

func (TransactionKind) MarshalText

func (tk TransactionKind) MarshalText() ([]byte, error)

MarshalText marshals TransactionKind into text.

func (*TransactionKind) Scan

func (tk *TransactionKind) Scan(v interface{}) error

Scan satisfies the sql.Scanner interface.

func (TransactionKind) String

func (tk TransactionKind) String() string

String satisfies the fmt.Stringer interface.

func (*TransactionKind) UnmarshalText

func (tk *TransactionKind) UnmarshalText(buf []byte) error

UnmarshalText unmarshals TransactionKind from text.

func (TransactionKind) Value

func (tk TransactionKind) Value() (driver.Value, error)

Value satisfies the driver.Valuer interface.

type User

type User struct {
	ID        int64  `json:"id" db:"id"`                 // id
	FirstName string `json:"first_name" db:"first_name"` // first_name
	LastName  string `json:"last_name" db:"last_name"`   // last_name
	Email     string `json:"email" db:"email"`           // email
	Password  string `json:"password" db:"password"`     // password
	// contains filtered or unexported fields
}

User represents a row from 'public.users'.

func UserByEmail

func UserByEmail(ctx context.Context, db DB, email string) (*User, error)

UserByEmail retrieves a row from 'public.users' as a User.

Generated from index 'users_email_key'.

func UserByID

func UserByID(ctx context.Context, db DB, id int64) (*User, error)

UserByID retrieves a row from 'public.users' as a User.

Generated from index 'users_pkey'.

func (*User) Delete

func (u *User) Delete(ctx context.Context, db DB) error

Delete deletes the User from the database.

func (*User) Deleted

func (u *User) Deleted() bool

Deleted returns true when the User has been marked for deletion from the database.

func (*User) Exists

func (u *User) Exists() bool

Exists returns true when the User exists in the database.

func (*User) Insert

func (u *User) Insert(ctx context.Context, db DB) error

Insert inserts the User to the database.

func (*User) Save

func (u *User) Save(ctx context.Context, db DB) error

Save saves the User to the database.

func (*User) Update

func (u *User) Update(ctx context.Context, db DB) error

Update updates a User in the database.

func (*User) Upsert

func (u *User) Upsert(ctx context.Context, db DB) error

Upsert performs an upsert for User.

type UsersPasswordReset

type UsersPasswordReset struct {
	ID         int64        `json:"id" db:"id"`                   // id
	UsersID    int64        `json:"users_id" db:"users_id"`       // users_id
	Token      string       `json:"token" db:"token"`             // token
	RedeemedAt sql.NullTime `json:"redeemed_at" db:"redeemed_at"` // redeemed_at
	ExpiredAt  sql.NullTime `json:"expired_at" db:"expired_at"`   // expired_at
	// contains filtered or unexported fields
}

UsersPasswordReset represents a row from 'public.users_password_reset'.

func UsersPasswordResetByID

func UsersPasswordResetByID(ctx context.Context, db DB, id int64) (*UsersPasswordReset, error)

UsersPasswordResetByID retrieves a row from 'public.users_password_reset' as a UsersPasswordReset.

Generated from index 'users_password_reset_pkey'.

func UsersPasswordResetByToken

func UsersPasswordResetByToken(ctx context.Context, db DB, token string) (*UsersPasswordReset, error)

UsersPasswordResetByToken retrieves a row from 'public.users_password_reset' as a UsersPasswordReset.

Generated from index 'users_password_reset_token_key'.

func (*UsersPasswordReset) Delete

func (upr *UsersPasswordReset) Delete(ctx context.Context, db DB) error

Delete deletes the UsersPasswordReset from the database.

func (*UsersPasswordReset) Deleted

func (upr *UsersPasswordReset) Deleted() bool

Deleted returns true when the UsersPasswordReset has been marked for deletion from the database.

func (*UsersPasswordReset) Exists

func (upr *UsersPasswordReset) Exists() bool

Exists returns true when the UsersPasswordReset exists in the database.

func (*UsersPasswordReset) Insert

func (upr *UsersPasswordReset) Insert(ctx context.Context, db DB) error

Insert inserts the UsersPasswordReset to the database.

func (*UsersPasswordReset) Save

func (upr *UsersPasswordReset) Save(ctx context.Context, db DB) error

Save saves the UsersPasswordReset to the database.

func (*UsersPasswordReset) Update

func (upr *UsersPasswordReset) Update(ctx context.Context, db DB) error

Update updates a UsersPasswordReset in the database.

func (*UsersPasswordReset) Upsert

func (upr *UsersPasswordReset) Upsert(ctx context.Context, db DB) error

Upsert performs an upsert for UsersPasswordReset.

func (*UsersPasswordReset) User

func (upr *UsersPasswordReset) User(ctx context.Context, db DB) (*User, error)

User returns the User associated with the UsersPasswordReset's (UsersID).

Generated from foreign key 'users_password_reset_users_id_fkey'.

type UsersPermissionGroup

type UsersPermissionGroup struct {
	UserID            int64 `json:"user_id" db:"user_id"`                         // user_id
	PermissionGroupID int64 `json:"permission_group_id" db:"permission_group_id"` // permission_group_id
	// contains filtered or unexported fields
}

UsersPermissionGroup represents a row from 'public.users_permission_group'.

func UsersPermissionGroupByUserIDPermissionGroupID

func UsersPermissionGroupByUserIDPermissionGroupID(ctx context.Context, db DB, userID, permissionGroupID int64) (*UsersPermissionGroup, error)

UsersPermissionGroupByUserIDPermissionGroupID retrieves a row from 'public.users_permission_group' as a UsersPermissionGroup.

Generated from index 'users_permission_group_pkey'.

func (*UsersPermissionGroup) Delete

func (upg *UsersPermissionGroup) Delete(ctx context.Context, db DB) error

Delete deletes the UsersPermissionGroup from the database.

func (*UsersPermissionGroup) Deleted

func (upg *UsersPermissionGroup) Deleted() bool

Deleted returns true when the UsersPermissionGroup has been marked for deletion from the database.

func (*UsersPermissionGroup) Exists

func (upg *UsersPermissionGroup) Exists() bool

Exists returns true when the UsersPermissionGroup exists in the database.

func (*UsersPermissionGroup) Insert

func (upg *UsersPermissionGroup) Insert(ctx context.Context, db DB) error

Insert inserts the UsersPermissionGroup to the database.

func (*UsersPermissionGroup) PermissionGroup

func (upg *UsersPermissionGroup) PermissionGroup(ctx context.Context, db DB) (*PermissionGroup, error)

PermissionGroup returns the PermissionGroup associated with the UsersPermissionGroup's (PermissionGroupID).

Generated from foreign key 'users_permission_group_permission_group_id_fkey'.

func (*UsersPermissionGroup) User

func (upg *UsersPermissionGroup) User(ctx context.Context, db DB) (*User, error)

User returns the User associated with the UsersPermissionGroup's (UserID).

Generated from foreign key 'users_permission_group_user_id_fkey'.

type Variant

type Variant struct {
	ID                 int64           `json:"id" db:"id"`                                     // id
	ProductID          int64           `json:"product_id" db:"product_id"`                     // product_id
	IsDefault          bool            `json:"is_default" db:"is_default"`                     // is_default
	Sku                string          `json:"sku" db:"sku"`                                   // sku
	SortOrder          int             `json:"sort_order" db:"sort_order"`                     // sort_order
	CostAmount         sql.NullInt64   `json:"cost_amount" db:"cost_amount"`                   // cost_amount
	CostCurrency       sql.NullString  `json:"cost_currency" db:"cost_currency"`               // cost_currency
	TrackInventory     bool            `json:"track_inventory" db:"track_inventory"`           // track_inventory
	TaxCategoryID      sql.NullInt64   `json:"tax_category_id" db:"tax_category_id"`           // tax_category_id
	ShippingCategoryID sql.NullInt64   `json:"shipping_category_id" db:"shipping_category_id"` // shipping_category_id
	DiscontinueOn      sql.NullTime    `json:"discontinue_on" db:"discontinue_on"`             // discontinue_on
	Weight             sql.NullFloat64 `json:"weight" db:"weight"`                             // weight
	Height             sql.NullFloat64 `json:"height" db:"height"`                             // height
	Width              sql.NullFloat64 `json:"width" db:"width"`                               // width
	Depth              sql.NullFloat64 `json:"depth" db:"depth"`                               // depth
	// contains filtered or unexported fields
}

Variant represents a row from 'public.variant'.

func VariantByID

func VariantByID(ctx context.Context, db DB, id int64) (*Variant, error)

VariantByID retrieves a row from 'public.variant' as a Variant.

Generated from index 'variant_pkey'.

func VariantByIsDefault

func VariantByIsDefault(ctx context.Context, db DB, isDefault bool) ([]*Variant, error)

VariantByIsDefault retrieves a row from 'public.variant' as a Variant.

Generated from index 'idx_variant_is_default'.

func VariantByProductID

func VariantByProductID(ctx context.Context, db DB, productID int64) ([]*Variant, error)

VariantByProductID retrieves a row from 'public.variant' as a Variant.

Generated from index 'idx_variant_product_id'.

func VariantBySku

func VariantBySku(ctx context.Context, db DB, sku string) (*Variant, error)

VariantBySku retrieves a row from 'public.variant' as a Variant.

Generated from index 'variant_sku_key'.

func (*Variant) Delete

func (v *Variant) Delete(ctx context.Context, db DB) error

Delete deletes the Variant from the database.

func (*Variant) Deleted

func (v *Variant) Deleted() bool

Deleted returns true when the Variant has been marked for deletion from the database.

func (*Variant) Exists

func (v *Variant) Exists() bool

Exists returns true when the Variant exists in the database.

func (*Variant) Insert

func (v *Variant) Insert(ctx context.Context, db DB) error

Insert inserts the Variant to the database.

func (*Variant) Product

func (v *Variant) Product(ctx context.Context, db DB) (*Product, error)

Product returns the Product associated with the Variant's (ProductID).

Generated from foreign key 'variant_product_id_fkey'.

func (*Variant) Save

func (v *Variant) Save(ctx context.Context, db DB) error

Save saves the Variant to the database.

func (*Variant) Update

func (v *Variant) Update(ctx context.Context, db DB) error

Update updates a Variant in the database.

func (*Variant) Upsert

func (v *Variant) Upsert(ctx context.Context, db DB) error

Upsert performs an upsert for Variant.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL