things

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 Delete

func Delete() p.MutationSet[Thing]

Delete creates a MutationSet for deleting data.

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 TableInfo added in v1.5.0

func TableInfo() p.TableInfo

TableInfo returns meta information about the table.

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

func (e *Thing) AddExpressionResult(key string, value any)

AddExpressionResult puts a value into the custom expression results

func (*Thing) GetExpressionResult added in v0.18.0

func (e *Thing) GetExpressionResult(key string) any

GetExpressionResult gets a value from the custom expression results. Returns nil if absent.

func (*Thing) SetID

func (e *Thing) SetID(v pgtype.UUID) *Thing

SetID sets the value to the field value and returns the receiver.

func (*Thing) SetTdate

func (e *Thing) SetTdate(v time.Time) *Thing

SetTdate sets the value to the field value and returns the receiver.

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

func (e *Thing) SetTinterval(v pgtype.Interval) *Thing

SetTinterval sets the value to the field value and returns the receiver.

func (*Thing) SetTjson

func (e *Thing) SetTjson(v p.NullJSON) *Thing

SetTjson sets the value to the field value and returns the receiver.

func (*Thing) SetTjsonb added in v1.0.0

func (e *Thing) SetTjsonb(v p.NullJSON) *Thing

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

func (e *Thing) SetTreal(v types.Real) *Thing

SetTreal sets the value to the field value and returns the receiver.

func (*Thing) SetTtext added in v0.15.0

func (e *Thing) SetTtext(v string) *Thing

SetTtext sets the value to the field value and returns the receiver.

func (*Thing) SetTtextarray added in v1.5.1

func (e *Thing) SetTtextarray(v pgtype.FlatArray[pgtype.Text]) *Thing

SetTtextarray sets the value to the field value and returns the receiver.

func (*Thing) SetTtimestamp

func (e *Thing) SetTtimestamp(v time.Time) *Thing

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.

func (*Thing) String

func (e *Thing) String() string

String returns the debug string for *Thing with all non-nil field values.

Jump to

Keyboard shortcuts

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