Documentation
¶
Index ¶
- Variables
- func Columns(names ...string) (list []p.ColumnAccessor)
- func Delete() p.MutationSet[NewType]
- func Insert(cas ...p.ColumnAccessor) p.MutationSet[NewType]
- func Select(cas ...p.ColumnAccessor) p.QuerySet[NewType]
- func TableInfo() p.TableInfo
- func Update(cas ...p.ColumnAccessor) p.MutationSet[NewType]
- type NewType
- func (e *NewType) AddExpressionResult(key string, value any)
- func (e *NewType) GetExpressionResult(key string) any
- func (e *NewType) SetAChar(v string) *NewType
- func (e *NewType) SetAReal(v pgtype.Float4) *NewType
- func (e *NewType) SetASmallint(v int16) *NewType
- func (e *NewType) SetATime(v time.Time) *NewType
- func (e *NewType) SetID(v int32) *NewType
- func (e *NewType) Setters() (list []p.ColumnAccessor)
- func (e *NewType) String() string
Constants ¶
This section is empty.
Variables ¶
var ( // AChar represents the column "a_char" of with type "character", nullable:true, primary:false AChar = p.NewFieldAccess[pgtype.Text](p.MakeColumnInfo(tableInfo, "a_char", p.NotPrimary, p.Nullable, 0), func(dest any) any { return &dest.(*NewType).AChar }) // AReal represents the column "a_real" of with type "real", nullable:true, primary:false AReal = p.NewFieldAccess[pgtype.Float4](p.MakeColumnInfo(tableInfo, "a_real", p.NotPrimary, p.Nullable, 0), func(dest any) any { return &dest.(*NewType).AReal }) // ASmallint represents the column "a_smallint" of with type "smallint", nullable:true, primary:false ASmallint = p.NewFieldAccess[pgtype.Int2](p.MakeColumnInfo(tableInfo, "a_smallint", p.NotPrimary, p.Nullable, 0), func(dest any) any { return &dest.(*NewType).ASmallint }) // ATime represents the column "a_time" of with type "time without time zone", nullable:true, primary:false ATime = p.NewFieldAccess[pgtype.Time](p.MakeColumnInfo(tableInfo, "a_time", p.NotPrimary, p.Nullable, 0), func(dest any) any { return &dest.(*NewType).ATime }) // 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.(*NewType).ID }) )
Functions ¶
func Columns ¶
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[NewType]
Insert creates a MutationSet for inserting data with zero or more columns.
func Select ¶
func Select(cas ...p.ColumnAccessor) p.QuerySet[NewType]
Select returns a new QuerySet[NewType] for fetching column data.
func Update ¶
func Update(cas ...p.ColumnAccessor) p.MutationSet[NewType]
Update creates a MutationSet to update zero or more columns.
Types ¶
type NewType ¶
type NewType struct {
AChar pgtype.Text // a_char : character
AReal pgtype.Float4 // a_real : real
ASmallint pgtype.Int2 // a_smallint : smallint
ATime pgtype.Time // a_time : time without time zone
ID int32 // id : integer
// contains filtered or unexported fields
}
NewType is generated from the public.new_types table.
func (*NewType) AddExpressionResult ¶
AddExpressionResult puts a value into the custom expression results
func (*NewType) GetExpressionResult ¶
GetExpressionResult gets a value from the custom expression results. Returns nil if absent.
func (*NewType) SetASmallint ¶
SetASmallint sets the value to the field value and returns the receiver.
func (*NewType) Setters ¶
func (e *NewType) Setters() (list []p.ColumnAccessor)
Setters returns the list of changes to a NewType 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.