Documentation
¶
Index ¶
- Variables
- func AddCategoryHook(hookPoint boil.HookPoint, categoryHook CategoryHook)
- func AddOrderHook(hookPoint boil.HookPoint, orderHook OrderHook)
- func AddOrderItemHook(hookPoint boil.HookPoint, orderItemHook OrderItemHook)
- func AddProductHook(hookPoint boil.HookPoint, productHook ProductHook)
- func AddUserHook(hookPoint boil.HookPoint, userHook UserHook)
- func Categories(mods ...qm.QueryMod) categoryQuery
- func CategoryExists(ctx context.Context, exec boil.ContextExecutor, categoryID int64) (bool, error)
- func NewQuery(mods ...qm.QueryMod) *queries.Query
- func OrderExists(ctx context.Context, exec boil.ContextExecutor, orderID string) (bool, error)
- func OrderItemExists(ctx context.Context, exec boil.ContextExecutor, orderID string, ...) (bool, error)
- func OrderItems(mods ...qm.QueryMod) orderItemQuery
- func Orders(mods ...qm.QueryMod) orderQuery
- func ProductExists(ctx context.Context, exec boil.ContextExecutor, productID string) (bool, error)
- func Products(mods ...qm.QueryMod) productQuery
- func UserExists(ctx context.Context, exec boil.ContextExecutor, userID string) (bool, error)
- func Users(mods ...qm.QueryMod) userQuery
- type Category
- func (o *Category) AddProducts(ctx context.Context, exec boil.ContextExecutor, insert bool, ...) error
- func (o *Category) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *Category) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)
- func (o *Category) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *Category) Products(mods ...qm.QueryMod) productQuery
- func (o *Category) Reload(ctx context.Context, exec boil.ContextExecutor) error
- func (o *Category) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
- func (o *Category) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, ...) error
- type CategoryHook
- type CategorySlice
- type M
- type Order
- func (o *Order) AddOrderItems(ctx context.Context, exec boil.ContextExecutor, insert bool, ...) error
- func (o *Order) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *Order) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)
- func (o *Order) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *Order) OrderItems(mods ...qm.QueryMod) orderItemQuery
- func (o *Order) Reload(ctx context.Context, exec boil.ContextExecutor) error
- func (o *Order) SetUser(ctx context.Context, exec boil.ContextExecutor, insert bool, related *User) error
- func (o *Order) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
- func (o *Order) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, ...) error
- func (o *Order) User(mods ...qm.QueryMod) userQuery
- type OrderHook
- type OrderItem
- func (o *OrderItem) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *OrderItem) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)
- func (o *OrderItem) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *OrderItem) Order(mods ...qm.QueryMod) orderQuery
- func (o *OrderItem) Product(mods ...qm.QueryMod) productQuery
- func (o *OrderItem) Reload(ctx context.Context, exec boil.ContextExecutor) error
- func (o *OrderItem) SetOrder(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Order) error
- func (o *OrderItem) SetProduct(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Product) error
- func (o *OrderItem) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
- func (o *OrderItem) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, ...) error
- type OrderItemHook
- type OrderItemSlice
- type OrderSlice
- type Product
- func (o *Product) AddOrderItems(ctx context.Context, exec boil.ContextExecutor, insert bool, ...) error
- func (o *Product) Category(mods ...qm.QueryMod) categoryQuery
- func (o *Product) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *Product) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)
- func (o *Product) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *Product) OrderItems(mods ...qm.QueryMod) orderItemQuery
- func (o *Product) Reload(ctx context.Context, exec boil.ContextExecutor) error
- func (o *Product) SetCategory(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Category) error
- func (o *Product) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
- func (o *Product) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, ...) error
- type ProductHook
- type ProductSlice
- type Status
- type UpsertOptionFunc
- type UpsertOptions
- type User
- func (o *User) AddOrders(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Order) error
- func (o *User) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *User) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)
- func (o *User) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *User) Orders(mods ...qm.QueryMod) orderQuery
- func (o *User) Reload(ctx context.Context, exec boil.ContextExecutor) error
- func (o *User) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
- func (o *User) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, ...) error
- type UserHook
- type UserSlice
Constants ¶
This section is empty.
Variables ¶
var CategoryColumns = struct { CategoryID string Description string }{ CategoryID: "category_id", Description: "description", }
var CategoryRels = struct { Products string }{ Products: "Products", }
CategoryRels is where relationship names are stored.
var CategoryTableColumns = struct { CategoryID string Description string }{ CategoryID: "categories.category_id", Description: "categories.description", }
var CategoryWhere = struct { CategoryID whereHelperint64 Description whereHelperstring }{ CategoryID: whereHelperint64{/* contains filtered or unexported fields */}, Description: whereHelperstring{/* contains filtered or unexported fields */}, }
var ErrSyncFail = errors.New("orm: failed to synchronize data after insert")
ErrSyncFail occurs during insert when the record could not be retrieved in order to populate default value information. This usually happens when LastInsertId fails or there was a primary key configuration that was not resolvable.
var OrderColumns = struct { OrderID string UserID string TotalAmount string ShippingAddress string Status string CreatedAt string UpdatedAt string }{ OrderID: "order_id", UserID: "user_id", TotalAmount: "total_amount", ShippingAddress: "shipping_address", Status: "status", CreatedAt: "created_at", UpdatedAt: "updated_at", }
var OrderItemColumns = struct { OrderID string ProductID string Quantity string }{ OrderID: "order_id", ProductID: "product_id", Quantity: "quantity", }
var OrderItemRels = struct { Order string Product string }{ Order: "Order", Product: "Product", }
OrderItemRels is where relationship names are stored.
var OrderItemTableColumns = struct { OrderID string ProductID string Quantity string }{ OrderID: "order_items.order_id", ProductID: "order_items.product_id", Quantity: "order_items.quantity", }
var OrderItemWhere = struct { OrderID whereHelperstring ProductID whereHelperstring Quantity whereHelperint64 }{ OrderID: whereHelperstring{/* contains filtered or unexported fields */}, ProductID: whereHelperstring{/* contains filtered or unexported fields */}, Quantity: whereHelperint64{/* contains filtered or unexported fields */}, }
var OrderRels = struct { User string OrderItems string }{ User: "User", OrderItems: "OrderItems", }
OrderRels is where relationship names are stored.
var OrderTableColumns = struct { OrderID string UserID string TotalAmount string ShippingAddress string Status string CreatedAt string UpdatedAt string }{ OrderID: "orders.order_id", UserID: "orders.user_id", TotalAmount: "orders.total_amount", ShippingAddress: "orders.shipping_address", Status: "orders.status", CreatedAt: "orders.created_at", UpdatedAt: "orders.updated_at", }
var OrderWhere = struct { OrderID whereHelperstring UserID whereHelperstring TotalAmount whereHelperint64 ShippingAddress whereHelperstring Status whereHelperStatus CreatedAt whereHelpertime_Time UpdatedAt whereHelpertime_Time }{ OrderID: whereHelperstring{/* contains filtered or unexported fields */}, UserID: whereHelperstring{/* contains filtered or unexported fields */}, TotalAmount: whereHelperint64{/* contains filtered or unexported fields */}, ShippingAddress: whereHelperstring{/* contains filtered or unexported fields */}, Status: whereHelperStatus{/* contains filtered or unexported fields */}, CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */}, UpdatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */}, }
var ProductColumns = struct { ProductID string Name string Description string Price string Stock string CategoryID string CreatedAt string UpdatedAt string }{ ProductID: "product_id", Name: "name", Description: "description", Price: "price", Stock: "stock", CategoryID: "category_id", CreatedAt: "created_at", UpdatedAt: "updated_at", }
var ProductRels = struct { Category string OrderItems string }{ Category: "Category", OrderItems: "OrderItems", }
ProductRels is where relationship names are stored.
var ProductTableColumns = struct { ProductID string Name string Description string Price string Stock string CategoryID string CreatedAt string UpdatedAt string }{ ProductID: "products.product_id", Name: "products.name", Description: "products.description", Price: "products.price", Stock: "products.stock", CategoryID: "products.category_id", CreatedAt: "products.created_at", UpdatedAt: "products.updated_at", }
var ProductWhere = struct { ProductID whereHelperstring Name whereHelperstring Description whereHelperstring Price whereHelperfloat32 Stock whereHelperint64 CategoryID whereHelperint64 CreatedAt whereHelpertime_Time UpdatedAt whereHelpertime_Time }{ ProductID: whereHelperstring{/* contains filtered or unexported fields */}, Name: whereHelperstring{/* contains filtered or unexported fields */}, Description: whereHelperstring{/* contains filtered or unexported fields */}, Price: whereHelperfloat32{/* contains filtered or unexported fields */}, Stock: whereHelperint64{/* contains filtered or unexported fields */}, CategoryID: whereHelperint64{/* contains filtered or unexported fields */}, CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */}, UpdatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */}, }
var TableNames = struct { Categories string OrderItems string Orders string Products string Users string }{ Categories: "categories", OrderItems: "order_items", Orders: "orders", Products: "products", Users: "users", }
var UserColumns = struct { UserID string Username string Email string PasswordHash string CreatedAt string }{ UserID: "user_id", Username: "username", Email: "email", PasswordHash: "password_hash", CreatedAt: "created_at", }
var UserRels = struct { Orders string }{ Orders: "Orders", }
UserRels is where relationship names are stored.
var UserTableColumns = struct { UserID string Username string Email string PasswordHash string CreatedAt string }{ UserID: "users.user_id", Username: "users.username", Email: "users.email", PasswordHash: "users.password_hash", CreatedAt: "users.created_at", }
var UserWhere = struct { UserID whereHelperstring Username whereHelperstring Email whereHelperstring PasswordHash whereHelperstring CreatedAt whereHelpertime_Time }{ UserID: whereHelperstring{/* contains filtered or unexported fields */}, Username: whereHelperstring{/* contains filtered or unexported fields */}, Email: whereHelperstring{/* contains filtered or unexported fields */}, PasswordHash: whereHelperstring{/* contains filtered or unexported fields */}, CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */}, }
var ViewNames = struct {
}{}
Functions ¶
func AddCategoryHook ¶
func AddCategoryHook(hookPoint boil.HookPoint, categoryHook CategoryHook)
AddCategoryHook registers your hook function for all future operations.
func AddOrderHook ¶
AddOrderHook registers your hook function for all future operations.
func AddOrderItemHook ¶
func AddOrderItemHook(hookPoint boil.HookPoint, orderItemHook OrderItemHook)
AddOrderItemHook registers your hook function for all future operations.
func AddProductHook ¶
func AddProductHook(hookPoint boil.HookPoint, productHook ProductHook)
AddProductHook registers your hook function for all future operations.
func AddUserHook ¶
AddUserHook registers your hook function for all future operations.
func Categories ¶
Categories retrieves all the records using an executor.
func CategoryExists ¶
CategoryExists checks if the Category row exists.
func OrderExists ¶
OrderExists checks if the Order row exists.
func OrderItemExists ¶
func OrderItemExists(ctx context.Context, exec boil.ContextExecutor, orderID string, productID string) (bool, error)
OrderItemExists checks if the OrderItem row exists.
func OrderItems ¶
OrderItems retrieves all the records using an executor.
func ProductExists ¶
ProductExists checks if the Product row exists.
func UserExists ¶
UserExists checks if the User row exists.
Types ¶
type Category ¶
type Category struct { CategoryID int64 `boil:"category_id" json:"category_id" toml:"category_id" yaml:"category_id"` Description string `boil:"description" json:"description" toml:"description" yaml:"description"` R *categoryR `boil:"-" json:"-" toml:"-" yaml:"-"` L categoryL `boil:"-" json:"-" toml:"-" yaml:"-"` }
Category is an object representing the database table.
func FindCategory ¶
func FindCategory(ctx context.Context, exec boil.ContextExecutor, categoryID int64, selectCols ...string) (*Category, error)
FindCategory retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func (*Category) AddProducts ¶
func (o *Category) AddProducts(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Product) error
AddProducts adds the given related objects to the existing relationships of the category, optionally inserting them as new records. Appends related to o.R.Products. Sets related.R.Category appropriately.
func (*Category) Delete ¶
Delete deletes a single Category record with an executor. Delete will match against the primary key column to find the record to delete.
func (*Category) Insert ¶
func (o *Category) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.
func (*Category) Reload ¶
Reload refetches the object from the database using the primary keys with an executor.
func (*Category) Update ¶
func (o *Category) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
Update uses an executor to update the Category. See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.
func (*Category) Upsert ¶
func (o *Category) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns, opts ...UpsertOptionFunc) error
Upsert attempts an insert using an executor, and does an update or ignore on conflict. See boil.Columns documentation for how to properly use updateColumns and insertColumns.
type CategoryHook ¶
CategoryHook is the signature for custom Category hook methods
type CategorySlice ¶
type CategorySlice []*Category
CategorySlice is an alias for a slice of pointers to Category. This should almost always be used instead of []Category.
func (CategorySlice) DeleteAll ¶
func (o CategorySlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)
DeleteAll deletes all rows in the slice, using an executor.
func (*CategorySlice) ReloadAll ¶
func (o *CategorySlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error
ReloadAll refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.
func (CategorySlice) UpdateAll ¶
func (o CategorySlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)
UpdateAll updates all rows with the specified column values, using an executor.
type M ¶
type M map[string]interface{}
M type is for providing columns and column values to UpdateAll.
type Order ¶
type Order struct { OrderID string `boil:"order_id" json:"order_id" toml:"order_id" yaml:"order_id"` UserID string `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"` TotalAmount int64 `boil:"total_amount" json:"total_amount" toml:"total_amount" yaml:"total_amount"` ShippingAddress string `boil:"shipping_address" json:"shipping_address" toml:"shipping_address" yaml:"shipping_address"` Status Status `boil:"status" json:"status" toml:"status" yaml:"status"` CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"` UpdatedAt time.Time `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"` R *orderR `boil:"-" json:"-" toml:"-" yaml:"-"` L orderL `boil:"-" json:"-" toml:"-" yaml:"-"` }
Order is an object representing the database table.
func FindOrder ¶
func FindOrder(ctx context.Context, exec boil.ContextExecutor, orderID string, selectCols ...string) (*Order, error)
FindOrder retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func (*Order) AddOrderItems ¶
func (o *Order) AddOrderItems(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*OrderItem) error
AddOrderItems adds the given related objects to the existing relationships of the order, optionally inserting them as new records. Appends related to o.R.OrderItems. Sets related.R.Order appropriately.
func (*Order) Delete ¶
Delete deletes a single Order record with an executor. Delete will match against the primary key column to find the record to delete.
func (*Order) Insert ¶
Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.
func (*Order) OrderItems ¶
OrderItems retrieves all the order_item's OrderItems with an executor.
func (*Order) Reload ¶
Reload refetches the object from the database using the primary keys with an executor.
func (*Order) SetUser ¶
func (o *Order) SetUser(ctx context.Context, exec boil.ContextExecutor, insert bool, related *User) error
SetUser of the order to the related item. Sets o.R.User to related. Adds o to related.R.Orders.
func (*Order) Update ¶
func (o *Order) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
Update uses an executor to update the Order. See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.
func (*Order) Upsert ¶
func (o *Order) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns, opts ...UpsertOptionFunc) error
Upsert attempts an insert using an executor, and does an update or ignore on conflict. See boil.Columns documentation for how to properly use updateColumns and insertColumns.
type OrderItem ¶
type OrderItem struct { OrderID string `boil:"order_id" json:"order_id" toml:"order_id" yaml:"order_id"` ProductID string `boil:"product_id" json:"product_id" toml:"product_id" yaml:"product_id"` Quantity int64 `boil:"quantity" json:"quantity" toml:"quantity" yaml:"quantity"` R *orderItemR `boil:"-" json:"-" toml:"-" yaml:"-"` L orderItemL `boil:"-" json:"-" toml:"-" yaml:"-"` }
OrderItem is an object representing the database table.
func FindOrderItem ¶
func FindOrderItem(ctx context.Context, exec boil.ContextExecutor, orderID string, productID string, selectCols ...string) (*OrderItem, error)
FindOrderItem retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func (*OrderItem) Delete ¶
Delete deletes a single OrderItem record with an executor. Delete will match against the primary key column to find the record to delete.
func (*OrderItem) Insert ¶
func (o *OrderItem) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.
func (*OrderItem) Reload ¶
Reload refetches the object from the database using the primary keys with an executor.
func (*OrderItem) SetOrder ¶
func (o *OrderItem) SetOrder(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Order) error
SetOrder of the orderItem to the related item. Sets o.R.Order to related. Adds o to related.R.OrderItems.
func (*OrderItem) SetProduct ¶
func (o *OrderItem) SetProduct(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Product) error
SetProduct of the orderItem to the related item. Sets o.R.Product to related. Adds o to related.R.OrderItems.
func (*OrderItem) Update ¶
func (o *OrderItem) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
Update uses an executor to update the OrderItem. See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.
func (*OrderItem) Upsert ¶
func (o *OrderItem) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns, opts ...UpsertOptionFunc) error
Upsert attempts an insert using an executor, and does an update or ignore on conflict. See boil.Columns documentation for how to properly use updateColumns and insertColumns.
type OrderItemHook ¶
OrderItemHook is the signature for custom OrderItem hook methods
type OrderItemSlice ¶
type OrderItemSlice []*OrderItem
OrderItemSlice is an alias for a slice of pointers to OrderItem. This should almost always be used instead of []OrderItem.
func (OrderItemSlice) DeleteAll ¶
func (o OrderItemSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)
DeleteAll deletes all rows in the slice, using an executor.
func (*OrderItemSlice) ReloadAll ¶
func (o *OrderItemSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error
ReloadAll refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.
func (OrderItemSlice) UpdateAll ¶
func (o OrderItemSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)
UpdateAll updates all rows with the specified column values, using an executor.
type OrderSlice ¶
type OrderSlice []*Order
OrderSlice is an alias for a slice of pointers to Order. This should almost always be used instead of []Order.
func (OrderSlice) DeleteAll ¶
func (o OrderSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)
DeleteAll deletes all rows in the slice, using an executor.
func (*OrderSlice) ReloadAll ¶
func (o *OrderSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error
ReloadAll refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.
func (OrderSlice) UpdateAll ¶
func (o OrderSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)
UpdateAll updates all rows with the specified column values, using an executor.
type Product ¶
type Product struct { ProductID string `boil:"product_id" json:"product_id" toml:"product_id" yaml:"product_id"` Name string `boil:"name" json:"name" toml:"name" yaml:"name"` Description string `boil:"description" json:"description" toml:"description" yaml:"description"` Price float32 `boil:"price" json:"price" toml:"price" yaml:"price"` Stock int64 `boil:"stock" json:"stock" toml:"stock" yaml:"stock"` CategoryID int64 `boil:"category_id" json:"category_id" toml:"category_id" yaml:"category_id"` CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"` UpdatedAt time.Time `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"` R *productR `boil:"-" json:"-" toml:"-" yaml:"-"` L productL `boil:"-" json:"-" toml:"-" yaml:"-"` }
Product is an object representing the database table.
func FindProduct ¶
func FindProduct(ctx context.Context, exec boil.ContextExecutor, productID string, selectCols ...string) (*Product, error)
FindProduct retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func (*Product) AddOrderItems ¶
func (o *Product) AddOrderItems(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*OrderItem) error
AddOrderItems adds the given related objects to the existing relationships of the product, optionally inserting them as new records. Appends related to o.R.OrderItems. Sets related.R.Product appropriately.
func (*Product) Delete ¶
Delete deletes a single Product record with an executor. Delete will match against the primary key column to find the record to delete.
func (*Product) Insert ¶
func (o *Product) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.
func (*Product) OrderItems ¶
OrderItems retrieves all the order_item's OrderItems with an executor.
func (*Product) Reload ¶
Reload refetches the object from the database using the primary keys with an executor.
func (*Product) SetCategory ¶
func (o *Product) SetCategory(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Category) error
SetCategory of the product to the related item. Sets o.R.Category to related. Adds o to related.R.Products.
func (*Product) Update ¶
func (o *Product) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
Update uses an executor to update the Product. See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.
func (*Product) Upsert ¶
func (o *Product) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns, opts ...UpsertOptionFunc) error
Upsert attempts an insert using an executor, and does an update or ignore on conflict. See boil.Columns documentation for how to properly use updateColumns and insertColumns.
type ProductHook ¶
ProductHook is the signature for custom Product hook methods
type ProductSlice ¶
type ProductSlice []*Product
ProductSlice is an alias for a slice of pointers to Product. This should almost always be used instead of []Product.
func (ProductSlice) DeleteAll ¶
func (o ProductSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)
DeleteAll deletes all rows in the slice, using an executor.
func (*ProductSlice) ReloadAll ¶
func (o *ProductSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error
ReloadAll refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.
func (ProductSlice) UpdateAll ¶
func (o ProductSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)
UpdateAll updates all rows with the specified column values, using an executor.
type Status ¶
type Status string
type UpsertOptionFunc ¶
type UpsertOptionFunc func(o *UpsertOptions)
func UpsertConflictTarget ¶
func UpsertConflictTarget(conflictTarget string) UpsertOptionFunc
func UpsertUpdateSet ¶
func UpsertUpdateSet(updateSet string) UpsertOptionFunc
type UpsertOptions ¶
type UpsertOptions struct {
// contains filtered or unexported fields
}
type User ¶
type User struct { UserID string `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"` Username string `boil:"username" json:"username" toml:"username" yaml:"username"` Email string `boil:"email" json:"email" toml:"email" yaml:"email"` PasswordHash string `boil:"password_hash" json:"password_hash" toml:"password_hash" yaml:"password_hash"` CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"` R *userR `boil:"-" json:"-" toml:"-" yaml:"-"` L userL `boil:"-" json:"-" toml:"-" yaml:"-"` }
User is an object representing the database table.
func FindUser ¶
func FindUser(ctx context.Context, exec boil.ContextExecutor, userID string, selectCols ...string) (*User, error)
FindUser retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func (*User) AddOrders ¶
func (o *User) AddOrders(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Order) error
AddOrders adds the given related objects to the existing relationships of the user, optionally inserting them as new records. Appends related to o.R.Orders. Sets related.R.User appropriately.
func (*User) Delete ¶
Delete deletes a single User record with an executor. Delete will match against the primary key column to find the record to delete.
func (*User) Insert ¶
Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.
func (*User) Reload ¶
Reload refetches the object from the database using the primary keys with an executor.
func (*User) Update ¶
func (o *User) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
Update uses an executor to update the User. See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.
func (*User) Upsert ¶
func (o *User) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns, opts ...UpsertOptionFunc) error
Upsert attempts an insert using an executor, and does an update or ignore on conflict. See boil.Columns documentation for how to properly use updateColumns and insertColumns.
type UserSlice ¶
type UserSlice []*User
UserSlice is an alias for a slice of pointers to User. This should almost always be used instead of []User.