Documentation
¶
Index ¶
- Variables
- func Columns(names ...string) (list []p.ColumnAccessor)
- func Delete() p.MutationSet[Thing]
- func Insert(cas ...p.ColumnAccessor) p.MutationSet[Thing]
- func Select(cas ...p.ColumnAccessor) p.QuerySet[Thing]
- func TableInfo() p.TableInfo
- func Update(cas ...p.ColumnAccessor) p.MutationSet[Thing]
- type Thing
- func (e *Thing) AddExpressionResult(key string, value any)
- func (e *Thing) GetExpressionResult(key string) any
- func (e *Thing) SetID(v pgtype.UUID) *Thing
- func (e *Thing) SetTdate(v time.Time) *Thing
- func (e *Thing) SetTdecimal(v decimal.NullDecimal) *Thing
- func (e *Thing) SetTinterval(v pgtype.Interval) *Thing
- func (e *Thing) SetTjson(v p.NullJSON) *Thing
- func (e *Thing) SetTjsonb(v p.NullJSON) *Thing
- func (e *Thing) SetTnumeric(v decimal.NullDecimal) *Thing
- func (e *Thing) SetTreal(v types.Real) *Thing
- func (e *Thing) SetTtext(v string) *Thing
- func (e *Thing) SetTtextarray(v pgtype.FlatArray[pgtype.Text]) *Thing
- func (e *Thing) SetTtimestamp(v time.Time) *Thing
- func (e *Thing) Setters() (list []p.ColumnAccessor)
- func (e *Thing) String() string
Constants ¶
This section is empty.
Variables ¶
var ( // ID represents the column "id" of with type "uuid", nullable:true, primary:false ID = p.NewFieldAccess[pgtype.UUID](p.MakeColumnInfo(tableInfo, "id", p.NotPrimary, p.Nullable, 0), func(dest any) any { return &dest.(*Thing).ID }) // Tdate represents the column "tdate" of with type "date", nullable:true, primary:false Tdate = p.NewFieldAccess[pgtype.Date](p.MakeColumnInfo(tableInfo, "tdate", p.NotPrimary, p.Nullable, 0), func(dest any) any { return &dest.(*Thing).Tdate }) // Tdecimal represents the column "tdecimal" of with type "numeric", nullable:true, primary:false Tdecimal = p.NewFieldAccess[decimal.NullDecimal](p.MakeColumnInfo(tableInfo, "tdecimal", p.NotPrimary, p.Nullable, 0), func(dest any) any { return &dest.(*Thing).Tdecimal }) // Tinterval represents the column "tinterval" of with type "interval", nullable:true, primary:false Tinterval = p.NewFieldAccess[pgtype.Interval](p.MakeColumnInfo(tableInfo, "tinterval", p.NotPrimary, p.Nullable, 0), func(dest any) any { return &dest.(*Thing).Tinterval }) // Tjson represents the column "tjson" of with type "json", nullable:true, primary:false Tjson = p.NewJSONAccess(p.MakeColumnInfo(tableInfo, "tjson", p.NotPrimary, p.Nullable, 0), func(dest any) any { return &dest.(*Thing).Tjson }) // Tjsonb represents the column "tjsonb" of with type "jsonb", nullable:true, primary:false Tjsonb = p.NewJSONAccess(p.MakeColumnInfo(tableInfo, "tjsonb", p.NotPrimary, p.Nullable, 0), func(dest any) any { return &dest.(*Thing).Tjsonb }) // Tnumeric represents the column "tnumeric" of with type "numeric", nullable:true, primary:false Tnumeric = p.NewFieldAccess[decimal.NullDecimal](p.MakeColumnInfo(tableInfo, "tnumeric", p.NotPrimary, p.Nullable, 0), func(dest any) any { return &dest.(*Thing).Tnumeric }) // Treal represents the column "treal" of with type "real", nullable:true, primary:false Treal = types.NewRealAccess(p.MakeColumnInfo(tableInfo, "treal", p.NotPrimary, p.Nullable, 0), func(dest any) any { return &dest.(*Thing).Treal }) // Ttext represents the column "ttext" of with type "text", nullable:true, primary:false Ttext = p.NewFieldAccess[pgtype.Text](p.MakeColumnInfo(tableInfo, "ttext", p.NotPrimary, p.Nullable, 0), func(dest any) any { return &dest.(*Thing).Ttext }) // Ttextarray represents the column "ttextarray" of with type "text[]", nullable:true, primary:false Ttextarray = p.NewFieldAccess[pgtype.FlatArray[pgtype.Text]](p.MakeColumnInfo(tableInfo, "ttextarray", p.NotPrimary, p.Nullable, 0), func(dest any) any { return &dest.(*Thing).Ttextarray }) // Ttimestamp represents the column "ttimestamp" of with type "timestamp without time zone", nullable:true, primary:false Ttimestamp = p.NewFieldAccess[pgtype.Timestamp](p.MakeColumnInfo(tableInfo, "ttimestamp", p.NotPrimary, p.Nullable, 0), func(dest any) any { return &dest.(*Thing).Ttimestamp }) )
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[Thing]
Insert creates a MutationSet for inserting data with zero or more columns.
func Select ¶
func Select(cas ...p.ColumnAccessor) p.QuerySet[Thing]
Select returns a new QuerySet[Thing] for fetching column data.
func Update ¶
func Update(cas ...p.ColumnAccessor) p.MutationSet[Thing]
Update creates a MutationSet to update zero or more columns.
Types ¶
type Thing ¶
type Thing struct { ID pgtype.UUID // id : uuid Tdate pgtype.Date // tdate : date Tdecimal decimal.NullDecimal // tdecimal : numeric Tinterval pgtype.Interval // tinterval : interval Tjson p.NullJSON // tjson : json Tjsonb p.NullJSON // tjsonb : jsonb Tnumeric decimal.NullDecimal // tnumeric : numeric Treal types.Real // treal : real Ttext pgtype.Text // ttext : text Ttextarray pgtype.FlatArray[pgtype.Text] // ttextarray : text[] Ttimestamp pgtype.Timestamp // ttimestamp : timestamp without time zone // contains filtered or unexported fields }
Thing is generated from the public.things table.
func (*Thing) AddExpressionResult ¶ added in v0.18.0
AddExpressionResult puts a value into the custom expression results
func (*Thing) GetExpressionResult ¶ added in v0.18.0
GetExpressionResult gets a value from the custom expression results. Returns nil if absent.
func (*Thing) SetTdecimal ¶ added in v0.26.0
func (e *Thing) SetTdecimal(v decimal.NullDecimal) *Thing
SetTdecimal sets the value to the field value and returns the receiver.
func (*Thing) SetTinterval ¶ added in v1.7.0
SetTinterval sets the value to the field value and returns the receiver.
func (*Thing) SetTjsonb ¶ added in v1.0.0
SetTjsonb sets the value to the field value and returns the receiver.
func (*Thing) SetTnumeric ¶ added in v0.26.0
func (e *Thing) SetTnumeric(v decimal.NullDecimal) *Thing
SetTnumeric sets the value to the field value and returns the receiver.
func (*Thing) SetTreal ¶ added in v1.7.0
SetTreal sets the value to the field value and returns the receiver.
func (*Thing) SetTtext ¶ added in v0.15.0
SetTtext sets the value to the field value and returns the receiver.
func (*Thing) SetTtextarray ¶ added in v1.5.1
SetTtextarray sets the value to the field value and returns the receiver.
func (*Thing) SetTtimestamp ¶
SetTtimestamp sets the value to the field value and returns the receiver.
func (*Thing) Setters ¶
func (e *Thing) Setters() (list []p.ColumnAccessor)
Setters returns the list of changes to a Thing 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.