Documentation ¶
Index ¶
- Variables
- func Columns(names ...string) (list []p.ColumnAccessor)
- func Delete() p.MutationSet[Product]
- func Insert(cas ...p.ColumnAccessor) p.MutationSet[Product]
- func Select(cas ...p.ColumnAccessor) p.QuerySet[Product]
- func TableInfo() p.TableInfo
- func Update(cas ...p.ColumnAccessor) p.MutationSet[Product]
- type Product
- func (e *Product) AddExpressionResult(key string, value any)
- func (e *Product) GetExpressionResult(key string) any
- func (e *Product) SetCategoryId(v int32) *Product
- func (e *Product) SetCode(v string) *Product
- func (e *Product) SetCreatedAt(v time.Time) *Product
- func (e *Product) SetDeletedAt(v time.Time) *Product
- func (e *Product) SetID(v int32) *Product
- func (e *Product) SetPrice(v int64) *Product
- func (e *Product) SetUpdatedAt(v time.Time) *Product
- func (e *Product) Setters() (list []p.ColumnAccessor)
- func (e *Product) String() string
Constants ¶
This section is empty.
Variables ¶
var ( // CategoryId represents the column "category_id" of with type "integer", nullable:true, primary:false CategoryId = p.NewFieldAccess[pgtype.Int4](p.MakeColumnInfo(tableInfo, "category_id", p.NotPrimary, p.Nullable, 0), func(dest any) any { return &dest.(*Product).CategoryId }) // Code represents the column "code" of with type "text", nullable:true, primary:false Code = p.NewFieldAccess[pgtype.Text](p.MakeColumnInfo(tableInfo, "code", p.NotPrimary, p.Nullable, 0), func(dest any) any { return &dest.(*Product).Code }) // CreatedAt represents the column "created_at" of with type "timestamp with time zone", nullable:true, primary:false CreatedAt = p.NewFieldAccess[pgtype.Timestamptz](p.MakeColumnInfo(tableInfo, "created_at", p.NotPrimary, p.Nullable, 0), func(dest any) any { return &dest.(*Product).CreatedAt }) // DeletedAt represents the column "deleted_at" of with type "timestamp with time zone", nullable:true, primary:false DeletedAt = p.NewFieldAccess[pgtype.Timestamptz](p.MakeColumnInfo(tableInfo, "deleted_at", p.NotPrimary, p.Nullable, 0), func(dest any) any { return &dest.(*Product).DeletedAt }) // ID represents the column "id" of with type "integer", nullable:false, primary:true ID = p.NewInt32Access(p.MakeColumnInfo(tableInfo, "id", p.IsPrimary, p.NotNull, 0), func(dest any) any { return &dest.(*Product).ID }) // Price represents the column "price" of with type "bigint", nullable:true, primary:false Price = p.NewFieldAccess[pgtype.Int8](p.MakeColumnInfo(tableInfo, "price", p.NotPrimary, p.Nullable, 0), func(dest any) any { return &dest.(*Product).Price }) // UpdatedAt represents the column "updated_at" of with type "timestamp with time zone", nullable:true, primary:false UpdatedAt = p.NewFieldAccess[pgtype.Timestamptz](p.MakeColumnInfo(tableInfo, "updated_at", p.NotPrimary, p.Nullable, 0), func(dest any) any { return &dest.(*Product).UpdatedAt }) )
Functions ¶
func Columns ¶ added in v0.15.0
func Columns(names ...string) (list []p.ColumnAccessor)
Columns returns the ColumnAccessor list for the given column names. If the names is empty then return all columns.
func Insert ¶
func Insert(cas ...p.ColumnAccessor) p.MutationSet[Product]
Insert creates a MutationSet for inserting data with zero or more columns.
func Select ¶
func Select(cas ...p.ColumnAccessor) p.QuerySet[Product]
Select returns a new QuerySet[Product] for fetching column data.
func Update ¶
func Update(cas ...p.ColumnAccessor) p.MutationSet[Product]
Update creates a MutationSet to update zero or more columns.
Types ¶
type Product ¶
type Product struct { CategoryId pgtype.Int4 // category_id : integer Code pgtype.Text // code : text CreatedAt pgtype.Timestamptz // created_at : timestamp with time zone DeletedAt pgtype.Timestamptz // deleted_at : timestamp with time zone ID int32 // id : integer Price pgtype.Int8 // price : bigint UpdatedAt pgtype.Timestamptz // updated_at : timestamp with time zone // contains filtered or unexported fields }
Product is generated from the public.products table.
func (*Product) AddExpressionResult ¶ added in v0.18.0
AddExpressionResult puts a value into the custom expression results
func (*Product) GetExpressionResult ¶ added in v0.18.0
GetExpressionResult gets a value from the custom expression results. Returns nil if absent.
func (*Product) SetCategoryId ¶
SetCategoryId sets the value to the field value and returns the receiver.
func (*Product) SetCreatedAt ¶
SetCreatedAt sets the value to the field value and returns the receiver.
func (*Product) SetDeletedAt ¶
SetDeletedAt sets the value to the field value and returns the receiver.
func (*Product) SetUpdatedAt ¶
SetUpdatedAt sets the value to the field value and returns the receiver.
func (*Product) Setters ¶
func (e *Product) Setters() (list []p.ColumnAccessor)
Setters returns the list of changes to a Product for which updates/inserts need to be processed. Can be used in Insert,Update,Select. Cannot be used to set null (or empty array) values for columns.