Thanks to visit codestin.com
Credit goes to pkg.go.dev

new_types

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

func Delete() p.MutationSet[NewType]

Delete creates a MutationSet for deleting data.

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 TableInfo

func TableInfo() p.TableInfo

TableInfo returns meta information about the table.

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

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

AddExpressionResult puts a value into the custom expression results

func (*NewType) GetExpressionResult

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

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

func (*NewType) SetAChar

func (e *NewType) SetAChar(v string) *NewType

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

func (*NewType) SetAReal

func (e *NewType) SetAReal(v pgtype.Float4) *NewType

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

func (*NewType) SetASmallint

func (e *NewType) SetASmallint(v int16) *NewType

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

func (*NewType) SetATime

func (e *NewType) SetATime(v time.Time) *NewType

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

func (*NewType) SetID

func (e *NewType) SetID(v int32) *NewType

SetID 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.

func (*NewType) String

func (e *NewType) String() string

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

Jump to

Keyboard shortcuts

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