goradd_unit

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package goradd_unit contains the object relational model for the goradd_unit database.

Queries use a builder pattern, started with a Query* function. Add functions to the builder to further constrain the query, using nodes from the node package to refer to tables and columns in the database. End the query with either a Load call to get a list of items, a Get call to get one item, or a Count call to count the number of items in the query.

Some Examples

projects := model.QueryProjects().Load()

Returns all the projects in the database.

projects := model.QueryProjects().
    Join(node.Project().Manager()).
    Where(op.GreaterOrEqual(node.Project().StartDate(), time.NewDate(2006, 1, 1)).
    OrderBy(node.Project().Num()).
    Load()

Returns the projects that started in 2006 or later, with the manager objects attached, and ordered by project number. To get the manager of the first project returned, you can do this:

firstManager := projects[0].Manager()

See the goradd-orm documentation for more information.

Index

Constants

View Source
const (
	AltLeafUnIDField          = `id`
	AltLeafUnNameField        = `name`
	AltLeafUnAltRootUnIDField = `altRootUnID`
	AltLeafUnAltRootUnField   = `altRootUn`
)

IDs used to access the AltLeafUn object fields by name using the Get function. doc: type=AltLeafUn

View Source
const (
	AltRootUnIDField        = `id`
	AltRootUnNameField      = `name`
	AltRootUnAltLeafUnField = `altLeafUn`
)

IDs used to access the AltRootUn object fields by name using the Get function. doc: type=AltRootUn

View Source
const (
	AutoGenIDField           = `id`
	AutoGenGroLockField      = `groLock`
	AutoGenGroTimestampField = `groTimestamp`
	AutoGenCreatedField      = `created`
	AutoGenModifiedField     = `modified`
	AutoGenNameField         = `name`
)

IDs used to access the AutoGen object fields by name using the Get function. doc: type=AutoGen

View Source
const (
	DoubleIndexIDField           = `id`
	DoubleIndexFieldIntField     = `fieldInt`
	DoubleIndexFieldStringField  = `fieldString`
	DoubleIndexField2IntField    = `field2Int`
	DoubleIndexField2StringField = `field2String`
)

IDs used to access the DoubleIndex object fields by name using the Get function. doc: type=DoubleIndex

View Source
const (
	LeafIDField     = `id`
	LeafNameField   = `name`
	LeafRootIDField = `rootID`
	LeafRootField   = `root`
)

IDs used to access the Leaf object fields by name using the Get function. doc: type=Leaf

View Source
const (
	LeafLIDField      = `id`
	LeafLNameField    = `name`
	LeafLGroLockField = `groLock`
	LeafLRootLIDField = `rootLID`
	LeafLRootLField   = `rootL`
)

IDs used to access the LeafL object fields by name using the Get function. doc: type=LeafL

View Source
const (
	LeafNIDField      = `id`
	LeafNNameField    = `name`
	LeafNRootNIDField = `rootNID`
	LeafNRootNField   = `rootN`
)

IDs used to access the LeafN object fields by name using the Get function. doc: type=LeafN

View Source
const (
	LeafNlIDField       = `id`
	LeafNlNameField     = `name`
	LeafNlGroLockField  = `groLock`
	LeafNlRootNlIDField = `rootNlID`
	LeafNlRootNlField   = `rootNl`
	LeafNlLeaf2sField   = `leaf2s`
	LeafNlLeaf1sField   = `leaf1s`
)

IDs used to access the LeafNl object fields by name using the Get function. doc: type=LeafNl

View Source
const (
	LeafUIDField      = `id`
	LeafUNameField    = `name`
	LeafURootUIDField = `rootUID`
	LeafURootUField   = `rootU`
)

IDs used to access the LeafU object fields by name using the Get function. doc: type=LeafU

View Source
const (
	LeafUlIDField       = `id`
	LeafUlNameField     = `name`
	LeafUlGroLockField  = `groLock`
	LeafUlRootUlIDField = `rootUlID`
	LeafUlRootUlField   = `rootUl`
)

IDs used to access the LeafUl object fields by name using the Get function. doc: type=LeafUl

View Source
const (
	LeafUnIDField       = `id`
	LeafUnNameField     = `name`
	LeafUnRootUnIDField = `rootUnID`
	LeafUnRootUnField   = `rootUn`
)

IDs used to access the LeafUn object fields by name using the Get function. doc: type=LeafUn

View Source
const (
	LeafUnlIDField        = `id`
	LeafUnlNameField      = `name`
	LeafUnlGroLockField   = `groLock`
	LeafUnlRootUnlIDField = `rootUnlID`
	LeafUnlRootUnlField   = `rootUnl`
)

IDs used to access the LeafUnl object fields by name using the Get function. doc: type=LeafUnl

View Source
const (
	MultiParentIDField                 = `id`
	MultiParentNameField               = `name`
	MultiParentParent1IDField          = `parent1ID`
	MultiParentParent1Field            = `parent1`
	MultiParentParent2IDField          = `parent2ID`
	MultiParentParent2Field            = `parent2`
	MultiParentParent1MultiParentField = `parent1MultiParents`
	MultiParentParent2MultiParentField = `parent2MultiParents`
)

IDs used to access the MultiParent object fields by name using the Get function. doc: type=MultiParent

View Source
const (
	RootIDField   = `id`
	RootNameField = `name`
	RootLeafField = `leafs`
)

IDs used to access the Root object fields by name using the Get function. doc: type=Root

View Source
const (
	RootLIDField      = `id`
	RootLNameField    = `name`
	RootLGroLockField = `groLock`
	RootLLeafLField   = `leafLs`
)

IDs used to access the RootL object fields by name using the Get function. doc: type=RootL

View Source
const (
	RootNIDField    = `id`
	RootNNameField  = `name`
	RootNLeafNField = `leafNs`
)

IDs used to access the RootN object fields by name using the Get function. doc: type=RootN

View Source
const (
	RootNlIDField      = `id`
	RootNlNameField    = `name`
	RootNlGroLockField = `groLock`
	RootNlLeafNlField  = `leafNls`
)

IDs used to access the RootNl object fields by name using the Get function. doc: type=RootNl

View Source
const (
	RootUIDField    = `id`
	RootUNameField  = `name`
	RootULeafUField = `leafU`
)

IDs used to access the RootU object fields by name using the Get function. doc: type=RootU

View Source
const (
	RootUlIDField      = `id`
	RootUlNameField    = `name`
	RootUlGroLockField = `groLock`
	RootUlLeafUlField  = `leafUl`
)

IDs used to access the RootUl object fields by name using the Get function. doc: type=RootUl

View Source
const (
	RootUnIDField     = `id`
	RootUnNameField   = `name`
	RootUnLeafUnField = `leafUn`
)

IDs used to access the RootUn object fields by name using the Get function. doc: type=RootUn

View Source
const (
	RootUnlIDField      = `id`
	RootUnlNameField    = `name`
	RootUnlGroLockField = `groLock`
	RootUnlLeafUnlField = `leafUnl`
)

IDs used to access the RootUnl object fields by name using the Get function. doc: type=RootUnl

View Source
const (
	TimeoutTestIDField   = `id`
	TimeoutTestNameField = `name`
)

IDs used to access the TimeoutTest object fields by name using the Get function. doc: type=TimeoutTest

View Source
const (
	TwoKeyServerField    = `server`
	TwoKeyDirectoryField = `directory`
	TwoKeyFileNameField  = `fileName`
)

IDs used to access the TwoKey object fields by name using the Get function. doc: type=TwoKey

View Source
const (
	TypeTestIDField                  = `id`
	TypeTestDateField                = `date`
	TypeTestTimeField                = `time`
	TypeTestDateTimeField            = `dateTime`
	TypeTestCreationTimeField        = `creationTime`
	TypeTestModifiedTimeField        = `modifiedTime`
	TypeTestTestIntField             = `testInt`
	TypeTestTestUnsignedField        = `testUnsigned`
	TypeTestTestInt64Field           = `testInt64`
	TypeTestTestUint64Field          = `testUint64`
	TypeTestTestFloat32Field         = `testFloat32`
	TypeTestTestFloat64Field         = `testFloat64`
	TypeTestTestNumericField         = `testNumeric`
	TypeTestTestBoolField            = `testBool`
	TypeTestTestUnlimitedStringField = `testUnlimitedString`
	TypeTestTestLimitedStringField   = `testLimitedString`
	TypeTestTestLongstringField      = `testLongstring`
	TypeTestTestUnlimitedBytesField  = `testUnlimitedBytes`
	TypeTestTestLimitedBytesField    = `testLimitedBytes`
	TypeTestTypeLongBytesField       = `typeLongBytes`
)

IDs used to access the TypeTest object fields by name using the Get function. doc: type=TypeTest

View Source
const (
	UnsupportedTypeTypeSerialField     = `typeSerial`
	UnsupportedTypeTypeSetField        = `typeSet`
	UnsupportedTypeTypeEnumeratedField = `typeEnumerated`
	UnsupportedTypeTypeGeoField        = `typeGeo`
	UnsupportedTypeTypeTinyblobField   = `typeTinyblob`
	UnsupportedTypeTypeBinaryField     = `typeBinary`
	UnsupportedTypeTypeSmallField      = `typeSmall`
	UnsupportedTypeTypeMediumField     = `typeMedium`
	UnsupportedTypeTypePolygonField    = `typePolygon`
	UnsupportedTypeTypeMultFk1Field    = `typeMultFk1`
	UnsupportedTypeTypeMultiFk2Field   = `typeMultiFk2`
)

IDs used to access the UnsupportedType object fields by name using the Get function. doc: type=UnsupportedType

View Source
const AltLeafUnNameMaxLength = 100 // The number of runes the column can hold
View Source
const AltRootUnNameMaxLength = 100 // The number of runes the column can hold
View Source
const AutoGenNameMaxLength = 30 // The number of runes the column can hold
View Source
const DoubleIndexField2IntMax = 2147483647
View Source
const DoubleIndexField2IntMin = -2147483648
View Source
const DoubleIndexField2StringMaxLength = 100 // The number of runes the column can hold
View Source
const DoubleIndexFieldIntMax = 2147483647
View Source
const DoubleIndexFieldIntMin = -2147483648
View Source
const DoubleIndexFieldStringMaxLength = 50 // The number of runes the column can hold
View Source
const DoubleIndexIDMax = 2147483647
View Source
const DoubleIndexIDMin = -2147483648
View Source
const LeafLNameMaxLength = 100 // The number of runes the column can hold
View Source
const LeafNNameMaxLength = 100 // The number of runes the column can hold
View Source
const LeafNameMaxLength = 100 // The number of runes the column can hold
View Source
const LeafNlNameMaxLength = 100 // The number of runes the column can hold
View Source
const LeafUNameMaxLength = 100 // The number of runes the column can hold
View Source
const LeafUlNameMaxLength = 100 // The number of runes the column can hold
View Source
const LeafUnNameMaxLength = 100 // The number of runes the column can hold
View Source
const LeafUnlNameMaxLength = 100 // The number of runes the column can hold
View Source
const MultiParentNameMaxLength = 100 // The number of runes the column can hold
View Source
const RootLNameMaxLength = 100 // The number of runes the column can hold
View Source
const RootNNameMaxLength = 100 // The number of runes the column can hold
View Source
const RootNameMaxLength = 100 // The number of runes the column can hold
View Source
const RootNlNameMaxLength = 100 // The number of runes the column can hold
View Source
const RootUNameMaxLength = 100 // The number of runes the column can hold
View Source
const RootUlNameMaxLength = 100 // The number of runes the column can hold
View Source
const RootUnNameMaxLength = 100 // The number of runes the column can hold
View Source
const RootUnlNameMaxLength = 100 // The number of runes the column can hold
View Source
const TimeoutTestNameMaxLength = 100 // The number of runes the column can hold
View Source
const TwoKeyDirectoryMaxLength = 50 // The number of runes the column can hold
View Source
const TwoKeyFileNameMaxLength = 50 // The number of runes the column can hold
View Source
const TwoKeyServerMaxLength = 50 // The number of runes the column can hold
View Source
const TypeTestTestIntMax = 2147483647
View Source
const TypeTestTestIntMin = -2147483648
View Source
const TypeTestTestLimitedBytesMaxLength = 10 // The number of bytes the column can hold
View Source
const TypeTestTestLimitedStringMaxLength = 10 // The number of runes the column can hold
View Source
const TypeTestTestLongstringMaxLength = 1000000000 // The number of runes the column can hold
View Source
const TypeTestTestNumericMaxLength = 12 // The number of runes the column can hold
View Source
const TypeTestTestUnsignedMax = 4294967295
View Source
const TypeTestTestUnsignedMin = 0
View Source
const TypeTestTypeLongBytesMaxLength = 4294967295 // The number of bytes the column can hold
View Source
const UnsupportedTypeTypeEnumeratedMaxLength = 1 // The number of bytes the column can hold
View Source
const UnsupportedTypeTypeMediumMax = 8388607
View Source
const UnsupportedTypeTypeMediumMin = -8388608
View Source
const UnsupportedTypeTypeMultFk1MaxLength = 50 // The number of runes the column can hold
View Source
const UnsupportedTypeTypeMultiFk2MaxLength = 50 // The number of runes the column can hold
View Source
const UnsupportedTypeTypeSetMaxLength = 5 // The number of bytes the column can hold
View Source
const UnsupportedTypeTypeSmallMax = 32767
View Source
const UnsupportedTypeTypeSmallMin = -32768
View Source
const UnsupportedTypeTypeTinyblobMaxLength = 255 // The number of bytes the column can hold

Variables

This section is empty.

Functions

func ClearAll

func ClearAll(ctx context.Context)

ClearAll deletes all the data in the database, except for data in Enum tables.

func CountAltLeafUns

func CountAltLeafUns(ctx context.Context) (int, error)

CountAltLeafUns returns the total number of items in the alt_leaf_un table.

func CountAltLeafUnsByAltRootUnID

func CountAltLeafUnsByAltRootUnID(ctx context.Context, altRootUnID float32) (int, error)

CountAltLeafUnsByAltRootUnID queries the database and returns the number of AltLeafUn objects that have altRootUnID. doc: type=AltLeafUn

func CountAltRootUns

func CountAltRootUns(ctx context.Context) (int, error)

CountAltRootUns returns the total number of items in the alt_root_un table.

func CountAutoGens

func CountAutoGens(ctx context.Context) (int, error)

CountAutoGens returns the total number of items in the auto_gen table.

func CountDoubleIndices

func CountDoubleIndices(ctx context.Context) (int, error)

CountDoubleIndices returns the total number of items in the double_index table.

func CountDoubleIndicesByField2IntField2String

func CountDoubleIndicesByField2IntField2String(ctx context.Context, field2Int int, field2String string) (int, error)

CountDoubleIndicesByField2IntField2String queries the database and returns the number of DoubleIndex objects that have field2Int and field2String. doc: type=DoubleIndex

func CountDoubleIndicesByFieldIntFieldString

func CountDoubleIndicesByFieldIntFieldString(ctx context.Context, fieldInt int, fieldString string) (int, error)

CountDoubleIndicesByFieldIntFieldString queries the database and returns the number of DoubleIndex objects that have fieldInt and fieldString. doc: type=DoubleIndex

func CountLeafLs

func CountLeafLs(ctx context.Context) (int, error)

CountLeafLs returns the total number of items in the leaf_l table.

func CountLeafLsByRootLID

func CountLeafLsByRootLID(ctx context.Context, rootLID query.AutoPrimaryKey) (int, error)

CountLeafLsByRootLID queries the database and returns the number of LeafL objects that have rootLID. doc: type=LeafL

func CountLeafNls

func CountLeafNls(ctx context.Context) (int, error)

CountLeafNls returns the total number of items in the leaf_nl table.

func CountLeafNlsByRootNlID

func CountLeafNlsByRootNlID(ctx context.Context, rootNlID query.AutoPrimaryKey) (int, error)

CountLeafNlsByRootNlID queries the database and returns the number of LeafNl objects that have rootNlID. doc: type=LeafNl

func CountLeafNs

func CountLeafNs(ctx context.Context) (int, error)

CountLeafNs returns the total number of items in the leaf_n table.

func CountLeafNsByRootNID

func CountLeafNsByRootNID(ctx context.Context, rootNID query.AutoPrimaryKey) (int, error)

CountLeafNsByRootNID queries the database and returns the number of LeafN objects that have rootNID. doc: type=LeafN

func CountLeafUls

func CountLeafUls(ctx context.Context) (int, error)

CountLeafUls returns the total number of items in the leaf_ul table.

func CountLeafUlsByRootUlID

func CountLeafUlsByRootUlID(ctx context.Context, rootUlID query.AutoPrimaryKey) (int, error)

CountLeafUlsByRootUlID queries the database and returns the number of LeafUl objects that have rootUlID. doc: type=LeafUl

func CountLeafUnls

func CountLeafUnls(ctx context.Context) (int, error)

CountLeafUnls returns the total number of items in the leaf_unl table.

func CountLeafUnlsByRootUnlID

func CountLeafUnlsByRootUnlID(ctx context.Context, rootUnlID query.AutoPrimaryKey) (int, error)

CountLeafUnlsByRootUnlID queries the database and returns the number of LeafUnl objects that have rootUnlID. doc: type=LeafUnl

func CountLeafUns

func CountLeafUns(ctx context.Context) (int, error)

CountLeafUns returns the total number of items in the leaf_un table.

func CountLeafUnsByRootUnID

func CountLeafUnsByRootUnID(ctx context.Context, rootUnID query.AutoPrimaryKey) (int, error)

CountLeafUnsByRootUnID queries the database and returns the number of LeafUn objects that have rootUnID. doc: type=LeafUn

func CountLeafUs

func CountLeafUs(ctx context.Context) (int, error)

CountLeafUs returns the total number of items in the leaf_u table.

func CountLeafUsByRootUID

func CountLeafUsByRootUID(ctx context.Context, rootUID query.AutoPrimaryKey) (int, error)

CountLeafUsByRootUID queries the database and returns the number of LeafU objects that have rootUID. doc: type=LeafU

func CountLeafs

func CountLeafs(ctx context.Context) (int, error)

CountLeafs returns the total number of items in the leaf table.

func CountLeafsByRootID

func CountLeafsByRootID(ctx context.Context, rootID query.AutoPrimaryKey) (int, error)

CountLeafsByRootID queries the database and returns the number of Leaf objects that have rootID. doc: type=Leaf

func CountMultiParents

func CountMultiParents(ctx context.Context) (int, error)

CountMultiParents returns the total number of items in the multi_parent table.

func CountMultiParentsByParent1ID

func CountMultiParentsByParent1ID(ctx context.Context, parent1ID query.AutoPrimaryKey) (int, error)

CountMultiParentsByParent1ID queries the database and returns the number of MultiParent objects that have parent1ID. doc: type=MultiParent

func CountMultiParentsByParent2ID

func CountMultiParentsByParent2ID(ctx context.Context, parent2ID query.AutoPrimaryKey) (int, error)

CountMultiParentsByParent2ID queries the database and returns the number of MultiParent objects that have parent2ID. doc: type=MultiParent

func CountRootLs

func CountRootLs(ctx context.Context) (int, error)

CountRootLs returns the total number of items in the root_l table.

func CountRootNls

func CountRootNls(ctx context.Context) (int, error)

CountRootNls returns the total number of items in the root_nl table.

func CountRootNs

func CountRootNs(ctx context.Context) (int, error)

CountRootNs returns the total number of items in the root_n table.

func CountRootUls

func CountRootUls(ctx context.Context) (int, error)

CountRootUls returns the total number of items in the root_ul table.

func CountRootUnls

func CountRootUnls(ctx context.Context) (int, error)

CountRootUnls returns the total number of items in the root_unl table.

func CountRootUns

func CountRootUns(ctx context.Context) (int, error)

CountRootUns returns the total number of items in the root_un table.

func CountRootUs

func CountRootUs(ctx context.Context) (int, error)

CountRootUs returns the total number of items in the root_u table.

func CountRoots

func CountRoots(ctx context.Context) (int, error)

CountRoots returns the total number of items in the root table.

func CountTimeoutTests

func CountTimeoutTests(ctx context.Context) (int, error)

CountTimeoutTests returns the total number of items in the timeout_test table.

func CountTwoKeys

func CountTwoKeys(ctx context.Context) (int, error)

CountTwoKeys returns the total number of items in the two_key table.

func CountTypeTests

func CountTypeTests(ctx context.Context) (int, error)

CountTypeTests returns the total number of items in the type_test table.

func CountUnsupportedTypes

func CountUnsupportedTypes(ctx context.Context) (int, error)

CountUnsupportedTypes returns the total number of items in the unsupported_type table.

func CountUnsupportedTypesByTypeMultFk1TypeMultiFk2

func CountUnsupportedTypesByTypeMultFk1TypeMultiFk2(ctx context.Context, typeMultFk1 string, typeMultiFk2 string) (int, error)

CountUnsupportedTypesByTypeMultFk1TypeMultiFk2 queries the database and returns the number of UnsupportedType objects that have typeMultFk1 and typeMultiFk2. doc: type=UnsupportedType

func Database

func Database() db.DatabaseI

Database returns the database object corresponding to "goradd_unit" in the global database cluster. Use this to call directly into the database through the DatabaseI interface, or if you want to call functions specific to the database, cast the interface to the driver.

func DeleteAltLeafUn

func DeleteAltLeafUn(ctx context.Context, pk query.AutoPrimaryKey) error

DeleteAltLeafUn deletes the alt_leaf_un record with primary key pk from the database. Note that you can also delete loaded AltLeafUn objects by calling Delete on them. doc: type=AltLeafUn

func DeleteAltRootUn

func DeleteAltRootUn(ctx context.Context, pk float32) error

DeleteAltRootUn deletes the alt_root_un record with primary key pk from the database. Note that you can also delete loaded AltRootUn objects by calling Delete on them. doc: type=AltRootUn

func DeleteAutoGen

func DeleteAutoGen(ctx context.Context, pk query.AutoPrimaryKey) error

DeleteAutoGen deletes the auto_gen record with primary key pk from the database. Note that you can also delete loaded AutoGen objects by calling Delete on them. doc: type=AutoGen

func DeleteDoubleIndex

func DeleteDoubleIndex(ctx context.Context, pk int) error

DeleteDoubleIndex deletes the double_index record with primary key pk from the database. Note that you can also delete loaded DoubleIndex objects by calling Delete on them. doc: type=DoubleIndex

func DeleteLeaf

func DeleteLeaf(ctx context.Context, pk query.AutoPrimaryKey) error

DeleteLeaf deletes the leaf record with primary key pk from the database. Note that you can also delete loaded Leaf objects by calling Delete on them. doc: type=Leaf

func DeleteLeafL

func DeleteLeafL(ctx context.Context, pk query.AutoPrimaryKey) error

DeleteLeafL deletes the leaf_l record with primary key pk from the database. Note that you can also delete loaded LeafL objects by calling Delete on them. doc: type=LeafL

func DeleteLeafN

func DeleteLeafN(ctx context.Context, pk query.AutoPrimaryKey) error

DeleteLeafN deletes the leaf_n record with primary key pk from the database. Note that you can also delete loaded LeafN objects by calling Delete on them. doc: type=LeafN

func DeleteLeafNl

func DeleteLeafNl(ctx context.Context, pk query.AutoPrimaryKey) error

DeleteLeafNl deletes the leaf_nl record with primary key pk from the database. Note that you can also delete loaded LeafNl objects by calling Delete on them. doc: type=LeafNl

func DeleteLeafU

func DeleteLeafU(ctx context.Context, pk query.AutoPrimaryKey) error

DeleteLeafU deletes the leaf_u record with primary key pk from the database. Note that you can also delete loaded LeafU objects by calling Delete on them. doc: type=LeafU

func DeleteLeafUl

func DeleteLeafUl(ctx context.Context, pk query.AutoPrimaryKey) error

DeleteLeafUl deletes the leaf_ul record with primary key pk from the database. Note that you can also delete loaded LeafUl objects by calling Delete on them. doc: type=LeafUl

func DeleteLeafUn

func DeleteLeafUn(ctx context.Context, pk query.AutoPrimaryKey) error

DeleteLeafUn deletes the leaf_un record with primary key pk from the database. Note that you can also delete loaded LeafUn objects by calling Delete on them. doc: type=LeafUn

func DeleteLeafUnl

func DeleteLeafUnl(ctx context.Context, pk query.AutoPrimaryKey) error

DeleteLeafUnl deletes the leaf_unl record with primary key pk from the database. Note that you can also delete loaded LeafUnl objects by calling Delete on them. doc: type=LeafUnl

func DeleteMultiParent

func DeleteMultiParent(ctx context.Context, pk query.AutoPrimaryKey) error

DeleteMultiParent deletes the multi_parent record with primary key pk from the database. Note that you can also delete loaded MultiParent objects by calling Delete on them. doc: type=MultiParent

func DeleteRoot

func DeleteRoot(ctx context.Context, pk query.AutoPrimaryKey) error

DeleteRoot deletes the root record with primary key pk from the database. Note that you can also delete loaded Root objects by calling Delete on them. doc: type=Root

func DeleteRootL

func DeleteRootL(ctx context.Context, pk query.AutoPrimaryKey) error

DeleteRootL deletes the root_l record with primary key pk from the database. Note that you can also delete loaded RootL objects by calling Delete on them. doc: type=RootL

func DeleteRootN

func DeleteRootN(ctx context.Context, pk query.AutoPrimaryKey) error

DeleteRootN deletes the root_n record with primary key pk from the database. Note that you can also delete loaded RootN objects by calling Delete on them. doc: type=RootN

func DeleteRootNl

func DeleteRootNl(ctx context.Context, pk query.AutoPrimaryKey) error

DeleteRootNl deletes the root_nl record with primary key pk from the database. Note that you can also delete loaded RootNl objects by calling Delete on them. doc: type=RootNl

func DeleteRootU

func DeleteRootU(ctx context.Context, pk query.AutoPrimaryKey) error

DeleteRootU deletes the root_u record with primary key pk from the database. Note that you can also delete loaded RootU objects by calling Delete on them. doc: type=RootU

func DeleteRootUl

func DeleteRootUl(ctx context.Context, pk query.AutoPrimaryKey) error

DeleteRootUl deletes the root_ul record with primary key pk from the database. Note that you can also delete loaded RootUl objects by calling Delete on them. doc: type=RootUl

func DeleteRootUn

func DeleteRootUn(ctx context.Context, pk query.AutoPrimaryKey) error

DeleteRootUn deletes the root_un record with primary key pk from the database. Note that you can also delete loaded RootUn objects by calling Delete on them. doc: type=RootUn

func DeleteRootUnl

func DeleteRootUnl(ctx context.Context, pk query.AutoPrimaryKey) error

DeleteRootUnl deletes the root_unl record with primary key pk from the database. Note that you can also delete loaded RootUnl objects by calling Delete on them. doc: type=RootUnl

func DeleteTimeoutTest

func DeleteTimeoutTest(ctx context.Context, pk query.AutoPrimaryKey) error

DeleteTimeoutTest deletes the timeout_test record with primary key pk from the database. Note that you can also delete loaded TimeoutTest objects by calling Delete on them. doc: type=TimeoutTest

func DeleteTwoKey

func DeleteTwoKey(ctx context.Context, pk TwoKeyPrimaryKey) error

DeleteTwoKey deletes the two_key record with primary key pk from the database. Note that you can also delete loaded TwoKey objects by calling Delete on them. doc: type=TwoKey

func DeleteTypeTest

func DeleteTypeTest(ctx context.Context, pk query.AutoPrimaryKey) error

DeleteTypeTest deletes the type_test record with primary key pk from the database. Note that you can also delete loaded TypeTest objects by calling Delete on them. doc: type=TypeTest

func DeleteUnsupportedType

func DeleteUnsupportedType(ctx context.Context, pk uint64) error

DeleteUnsupportedType deletes the unsupported_type record with primary key pk from the database. Note that you can also delete loaded UnsupportedType objects by calling Delete on them. doc: type=UnsupportedType

func HasAltLeafUn

func HasAltLeafUn(ctx context.Context, pk query.AutoPrimaryKey) (bool, error)

HasAltLeafUn returns true if a AltLeafUn with the given primary key exists in the database. doc: type=AltLeafUn

func HasAltLeafUnByAltRootUnID

func HasAltLeafUnByAltRootUnID(ctx context.Context, altRootUnID interface{}) (bool, error)

HasAltLeafUnByAltRootUnID returns true if the given unique index values exist in the database. doc: type=AltLeafUn

func HasAltRootUn

func HasAltRootUn(ctx context.Context, pk float32) (bool, error)

HasAltRootUn returns true if a AltRootUn with the given primary key exists in the database. doc: type=AltRootUn

func HasAutoGen

func HasAutoGen(ctx context.Context, pk query.AutoPrimaryKey) (bool, error)

HasAutoGen returns true if a AutoGen with the given primary key exists in the database. doc: type=AutoGen

func HasDoubleIndex

func HasDoubleIndex(ctx context.Context, pk int) (bool, error)

HasDoubleIndex returns true if a DoubleIndex with the given primary key exists in the database. doc: type=DoubleIndex

func HasDoubleIndexByField2IntField2String

func HasDoubleIndexByField2IntField2String(ctx context.Context, field2Int interface{}, field2String interface{}) (bool, error)

HasDoubleIndexByField2IntField2String returns true if the given unique index values exist in the database. doc: type=DoubleIndex

func HasDoubleIndexByFieldIntFieldString

func HasDoubleIndexByFieldIntFieldString(ctx context.Context, fieldInt int, fieldString string) (bool, error)

HasDoubleIndexByFieldIntFieldString returns true if the given unique index values exist in the database. doc: type=DoubleIndex

func HasLeaf

func HasLeaf(ctx context.Context, pk query.AutoPrimaryKey) (bool, error)

HasLeaf returns true if a Leaf with the given primary key exists in the database. doc: type=Leaf

func HasLeafByRootID

func HasLeafByRootID(ctx context.Context, rootID query.AutoPrimaryKey) (bool, error)

HasLeafByRootID returns true if the given index values exist in the database. doc: type=Leaf

func HasLeafL

func HasLeafL(ctx context.Context, pk query.AutoPrimaryKey) (bool, error)

HasLeafL returns true if a LeafL with the given primary key exists in the database. doc: type=LeafL

func HasLeafLByRootLID

func HasLeafLByRootLID(ctx context.Context, rootLID query.AutoPrimaryKey) (bool, error)

HasLeafLByRootLID returns true if the given index values exist in the database. doc: type=LeafL

func HasLeafN

func HasLeafN(ctx context.Context, pk query.AutoPrimaryKey) (bool, error)

HasLeafN returns true if a LeafN with the given primary key exists in the database. doc: type=LeafN

func HasLeafNByRootNID

func HasLeafNByRootNID(ctx context.Context, rootNID interface{}) (bool, error)

HasLeafNByRootNID returns true if the given index values exist in the database. doc: type=LeafN

func HasLeafNl

func HasLeafNl(ctx context.Context, pk query.AutoPrimaryKey) (bool, error)

HasLeafNl returns true if a LeafNl with the given primary key exists in the database. doc: type=LeafNl

func HasLeafNlByRootNlID

func HasLeafNlByRootNlID(ctx context.Context, rootNlID interface{}) (bool, error)

HasLeafNlByRootNlID returns true if the given index values exist in the database. doc: type=LeafNl

func HasLeafU

func HasLeafU(ctx context.Context, pk query.AutoPrimaryKey) (bool, error)

HasLeafU returns true if a LeafU with the given primary key exists in the database. doc: type=LeafU

func HasLeafUByRootUID

func HasLeafUByRootUID(ctx context.Context, rootUID query.AutoPrimaryKey) (bool, error)

HasLeafUByRootUID returns true if the given unique index values exist in the database. doc: type=LeafU

func HasLeafUl

func HasLeafUl(ctx context.Context, pk query.AutoPrimaryKey) (bool, error)

HasLeafUl returns true if a LeafUl with the given primary key exists in the database. doc: type=LeafUl

func HasLeafUlByRootUlID

func HasLeafUlByRootUlID(ctx context.Context, rootUlID query.AutoPrimaryKey) (bool, error)

HasLeafUlByRootUlID returns true if the given unique index values exist in the database. doc: type=LeafUl

func HasLeafUn

func HasLeafUn(ctx context.Context, pk query.AutoPrimaryKey) (bool, error)

HasLeafUn returns true if a LeafUn with the given primary key exists in the database. doc: type=LeafUn

func HasLeafUnByRootUnID

func HasLeafUnByRootUnID(ctx context.Context, rootUnID interface{}) (bool, error)

HasLeafUnByRootUnID returns true if the given unique index values exist in the database. doc: type=LeafUn

func HasLeafUnl

func HasLeafUnl(ctx context.Context, pk query.AutoPrimaryKey) (bool, error)

HasLeafUnl returns true if a LeafUnl with the given primary key exists in the database. doc: type=LeafUnl

func HasLeafUnlByRootUnlID

func HasLeafUnlByRootUnlID(ctx context.Context, rootUnlID interface{}) (bool, error)

HasLeafUnlByRootUnlID returns true if the given unique index values exist in the database. doc: type=LeafUnl

func HasMultiParent

func HasMultiParent(ctx context.Context, pk query.AutoPrimaryKey) (bool, error)

HasMultiParent returns true if a MultiParent with the given primary key exists in the database. doc: type=MultiParent

func HasMultiParentByParent1ID

func HasMultiParentByParent1ID(ctx context.Context, parent1ID interface{}) (bool, error)

HasMultiParentByParent1ID returns true if the given index values exist in the database. doc: type=MultiParent

func HasMultiParentByParent2ID

func HasMultiParentByParent2ID(ctx context.Context, parent2ID interface{}) (bool, error)

HasMultiParentByParent2ID returns true if the given index values exist in the database. doc: type=MultiParent

func HasRoot

func HasRoot(ctx context.Context, pk query.AutoPrimaryKey) (bool, error)

HasRoot returns true if a Root with the given primary key exists in the database. doc: type=Root

func HasRootL

func HasRootL(ctx context.Context, pk query.AutoPrimaryKey) (bool, error)

HasRootL returns true if a RootL with the given primary key exists in the database. doc: type=RootL

func HasRootN

func HasRootN(ctx context.Context, pk query.AutoPrimaryKey) (bool, error)

HasRootN returns true if a RootN with the given primary key exists in the database. doc: type=RootN

func HasRootNl

func HasRootNl(ctx context.Context, pk query.AutoPrimaryKey) (bool, error)

HasRootNl returns true if a RootNl with the given primary key exists in the database. doc: type=RootNl

func HasRootU

func HasRootU(ctx context.Context, pk query.AutoPrimaryKey) (bool, error)

HasRootU returns true if a RootU with the given primary key exists in the database. doc: type=RootU

func HasRootUl

func HasRootUl(ctx context.Context, pk query.AutoPrimaryKey) (bool, error)

HasRootUl returns true if a RootUl with the given primary key exists in the database. doc: type=RootUl

func HasRootUn

func HasRootUn(ctx context.Context, pk query.AutoPrimaryKey) (bool, error)

HasRootUn returns true if a RootUn with the given primary key exists in the database. doc: type=RootUn

func HasRootUnl

func HasRootUnl(ctx context.Context, pk query.AutoPrimaryKey) (bool, error)

HasRootUnl returns true if a RootUnl with the given primary key exists in the database. doc: type=RootUnl

func HasTimeoutTest

func HasTimeoutTest(ctx context.Context, pk query.AutoPrimaryKey) (bool, error)

HasTimeoutTest returns true if a TimeoutTest with the given primary key exists in the database. doc: type=TimeoutTest

func HasTwoKey

func HasTwoKey(ctx context.Context, pk TwoKeyPrimaryKey) (bool, error)

HasTwoKey returns true if a TwoKey with the given primary key exists in the database. doc: type=TwoKey

func HasTypeTest

func HasTypeTest(ctx context.Context, pk query.AutoPrimaryKey) (bool, error)

HasTypeTest returns true if a TypeTest with the given primary key exists in the database. doc: type=TypeTest

func HasUnsupportedType

func HasUnsupportedType(ctx context.Context, pk uint64) (bool, error)

HasUnsupportedType returns true if a UnsupportedType with the given primary key exists in the database. doc: type=UnsupportedType

func HasUnsupportedTypeByTypeMultFk1TypeMultiFk2

func HasUnsupportedTypeByTypeMultFk1TypeMultiFk2(ctx context.Context, typeMultFk1 string, typeMultiFk2 string) (bool, error)

HasUnsupportedTypeByTypeMultFk1TypeMultiFk2 returns true if the given index values exist in the database. doc: type=UnsupportedType

func InitDB

func InitDB()

func JsonDecodeAll

func JsonDecodeAll(ctx context.Context, reader io.Reader) error

JsonDecodeAll imports the entire database from JSON that was created using JsonEncodeAll. This is done within a transaction and with constraints off in case there are circular references.

func JsonEncodeAll

func JsonEncodeAll(ctx context.Context, writer io.Writer) error

JsonEncodeAll sends the entire database to writer as JSON.

Types

type AltLeafUn

type AltLeafUn struct {
	// contains filtered or unexported fields
}

AltLeafUn represents an item in the alt_leaf_un table in the database.

func LoadAltLeafUn

func LoadAltLeafUn(ctx context.Context, pk query.AutoPrimaryKey, selectNodes ...query.Node) (*AltLeafUn, error)

LoadAltLeafUn returns a AltLeafUn from the database. selectNodes lets you provide nodes for selecting specific fields or additional fields from related tables. See [AltLeafUnsBuilder.Select] for more info.

func LoadAltLeafUnByAltRootUnID

func LoadAltLeafUnByAltRootUnID(ctx context.Context, altRootUnID interface{}, selectNodes ...query.Node) (*AltLeafUn, error)

LoadAltLeafUnByAltRootUnID queries for a single AltLeafUn object by the given unique index values. selectNodes optionally let you provide nodes for joining to other tables or selecting specific fields. See [AltLeafUnsBuilder.Select]. If you need a more elaborate query, use QueryAltLeafUns() to start a query builder.

func NewAltLeafUn

func NewAltLeafUn() *AltLeafUn

NewAltLeafUn creates a new AltLeafUn object and initializes it to default values.

func (*AltLeafUn) AltRootUn

func (o *AltLeafUn) AltRootUn() *AltRootUn

AltRootUn returns the current value of the loaded AltRootUn, and nil if its not loaded.

func (*AltLeafUn) AltRootUnID

func (o *AltLeafUn) AltRootUnID() float32

AltRootUnID returns the value of the loaded alt_root_un_id field in the database.

func (*AltLeafUn) AltRootUnIDIsLoaded

func (o *AltLeafUn) AltRootUnIDIsLoaded() bool

AltRootUnIDIsLoaded returns true if the value was loaded from the database or has been set.

func (*AltLeafUn) AltRootUnIDIsNull

func (o *AltLeafUn) AltRootUnIDIsNull() bool

AltRootUnIDIsNull returns true if the related database value is null.

func (*AltLeafUn) Copy

func (o *AltLeafUn) Copy() (newObject *AltLeafUn)

Copy copies most fields to a new AltLeafUn object. Forward reference ids will be copied, but reverse and many-many references will not. Attached objects will not be included in the copy. Automatically generated fields will not be included in the copy. The primary key field will not be copied, since it is normally auto-generated. Call Save() on the new object to save it into the database. Copy might panic if any fields in the database were set to a size larger than the maximum size through a process that accessed the database outside of the ORM.

func (*AltLeafUn) Delete

func (o *AltLeafUn) Delete(ctx context.Context) (err error)

Delete deletes the record from the database.

func (*AltLeafUn) Get

func (o *AltLeafUn) Get(key string) interface{}

Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil. Get can be used to retrieve a value by using the Field() of a node.

func (*AltLeafUn) GetAlias

func (o *AltLeafUn) GetAlias(aliasKey string) query.AliasValue

GetAlias returns the value for the Alias node aliasKey that was returned in the most recent query.

func (*AltLeafUn) ID

func (o *AltLeafUn) ID() query.AutoPrimaryKey

ID returns the loaded value of the id field in the database.

func (*AltLeafUn) IDIsLoaded

func (o *AltLeafUn) IDIsLoaded() bool

IDIsLoaded returns true if the value was loaded from the database or has been set.

func (*AltLeafUn) Initialize

func (o *AltLeafUn) Initialize()

Initialize will initialize or re-initialize a AltLeafUn database object to default values.

func (*AltLeafUn) IsDirty

func (o *AltLeafUn) IsDirty() (dirty bool)

IsDirty returns true if the object has been changed since it was read from the database or created.

func (*AltLeafUn) IsNew

func (o *AltLeafUn) IsNew() bool

IsNew returns true if the object will create a new record when saved.

func (*AltLeafUn) Key

func (o *AltLeafUn) Key() string

Key returns a unique key for the object, among a list of similar objects.

func (*AltLeafUn) Label

func (o *AltLeafUn) Label() string

Label returns a human-readable label of the object. This would be what a user would see as a description of the object if choosing from a list.

func (*AltLeafUn) LoadAltRootUn

func (o *AltLeafUn) LoadAltRootUn(ctx context.Context) (*AltRootUn, error)

LoadAltRootUn returns the related AltRootUn. If it is not already loaded, it will attempt to load it, provided the AltRootUnID column has been loaded first.

func (*AltLeafUn) MarshalBinary

func (o *AltLeafUn) MarshalBinary() ([]byte, error)

MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.

func (*AltLeafUn) MarshalJSON

func (o *AltLeafUn) MarshalJSON() (data []byte, err error)

MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.

func (*AltLeafUn) MarshalStringMap

func (o *AltLeafUn) MarshalStringMap() map[string]interface{}

MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.

func (*AltLeafUn) Name

func (o *AltLeafUn) Name() string

Name returns the value of the loaded name field in the database.

func (*AltLeafUn) NameIsLoaded

func (o *AltLeafUn) NameIsLoaded() bool

NameIsLoaded returns true if the value was loaded from the database or has been set.

func (*AltLeafUn) OriginalPrimaryKey

func (o *AltLeafUn) OriginalPrimaryKey() query.AutoPrimaryKey

OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.

func (*AltLeafUn) PrimaryKey

func (o *AltLeafUn) PrimaryKey() query.AutoPrimaryKey

PrimaryKey returns the value of the primary key of the record.

func (*AltLeafUn) Save

func (o *AltLeafUn) Save(ctx context.Context) error

Save will update or insert the object, depending on the state of the object.

If it has an auto-generated primary key, it will be updated after an insert. Database errors generally will be handled by a panic and not returned here, since those indicate a problem with a database driver or configuration.

Save will return a db.OptimisticLockError if it detects a collision when two users are attempting to change the same database record.

It will return a db.UniqueValueError if it detects a collision when an attempt is made to add a record with a unique column that is given a value that is already in the database.

Updating a record that has not changed will have no effect on the database. Updating a record that has linked records will also update any linked records that are MODIFIED, and if optimistic locking is in effect, will also check whether those records have been altered or deleted, returning an OptimisticLockError if so.

func (*AltLeafUn) SetAltRootUn

func (o *AltLeafUn) SetAltRootUn(altRootUn *AltRootUn)

SetAltRootUn will set the reference to altRootUn. The referenced object will be saved when AltLeafUn is saved. Pass nil to break the connection.

func (*AltLeafUn) SetAltRootUnID

func (o *AltLeafUn) SetAltRootUnID(v float32)

SetAltRootUnID sets the value of AltRootUnID in the object, to be saved later in the database using the Save() function.

func (*AltLeafUn) SetAltRootUnIDToNull

func (o *AltLeafUn) SetAltRootUnIDToNull()

SetAltRootUnIDToNull() will set the alt_root_un_id value in the database to NULL. AltRootUnID() will return the column's default value after this. Will also set the attached o.AltRootUn to nil.

func (*AltLeafUn) SetID

func (o *AltLeafUn) SetID(v query.AutoPrimaryKey)

SetID sets the value of ID in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the ID value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*AltLeafUn) SetName

func (o *AltLeafUn) SetName(v string)

SetName sets the value of Name in the object, to be saved later in the database using the Save() function.

func (*AltLeafUn) SetPrimaryKey

func (o *AltLeafUn) SetPrimaryKey(v query.AutoPrimaryKey)

SetPrimaryKey sets the value of the primary key in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the primary key value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*AltLeafUn) String

func (o *AltLeafUn) String() string

String implements the Stringer interface and returns a description of the record, primarily for debugging.

func (*AltLeafUn) UnmarshalBinary

func (o *AltLeafUn) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary converts a structure that was created with MarshalBinary into a AltLeafUn object.

func (*AltLeafUn) UnmarshalJSON

func (o *AltLeafUn) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON unmarshalls the given json data into the AltLeafUn. The AltLeafUn can be a newly created object, or one loaded from the database.

After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.

Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.

The fields it expects are:

"id" - query.AutoPrimaryKey
"name" - string

func (*AltLeafUn) UnmarshalStringMap

func (o *AltLeafUn) UnmarshalStringMap(m map[string]interface{}) (err error)

UnmarshalStringMap will load the values from the stringmap into the object.

Override this in AltLeafUn to modify the json before sending it here.

type AltLeafUnBuilder

type AltLeafUnBuilder struct {
	// contains filtered or unexported fields
}

The AltLeafUnBuilder uses a builder pattern to create a query on the database. Create a AltLeafUnBuilder by calling QueryAltLeafUns, which will select all the AltLeafUn object in the database. Then filter and arrange those objects by calling Where, Select, etc. End a query by calling either Load, LoadI, LoadCursor, Get, or Count. A AltLeafUnBuilder stores the context it will use to perform the query, and thus is meant to be a short-lived object. You should not save it for later use.

func QueryAltLeafUns

func QueryAltLeafUns(ctx context.Context) *AltLeafUnBuilder

QueryAltLeafUns returns a new query builder. See AltLeafUnBuilder for doc on how to use the builder. You should pass a context that has a timeout with it to protect against a long delay from the database possibly hanging your application. You can set a ReadTimeout value on the schema to do this by default during code generation.

func (*AltLeafUnBuilder) Calculation

func (b *AltLeafUnBuilder) Calculation(base query.TableNodeI, alias string, operation query.OperationNodeI) *AltLeafUnBuilder

Calculation adds operation as an aliased value onto base. After the query, you can read the data by passing alias to GetAlias on the returned object.

func (*AltLeafUnBuilder) Count

func (b *AltLeafUnBuilder) Count() (int, error)

Count terminates a query and returns just the number of items in the result. If you have Select or Calculation columns in the query, it will count NULL results as well. To not count NULL values, use Where in the builder with a NotNull operation. To count distinct combinations of items, call Distinct() on the builder.

func (*AltLeafUnBuilder) Distinct

func (b *AltLeafUnBuilder) Distinct() *AltLeafUnBuilder

Distinct removes duplicates from the results of the query. Adding a Select() is usually required.

func (*AltLeafUnBuilder) Get

func (b *AltLeafUnBuilder) Get() (*AltLeafUn, error)

Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items. If an error occurs, or no results are found, a nil is returned.

func (*AltLeafUnBuilder) GroupBy

func (b *AltLeafUnBuilder) GroupBy(nodes ...query.Node) *AltLeafUnBuilder

GroupBy controls how results are grouped when using aggregate functions with Calculation.

func (*AltLeafUnBuilder) Having

func (b *AltLeafUnBuilder) Having(node query.Node) *AltLeafUnBuilder

Having does additional filtering on the results of the query after the query is performed.

func (*AltLeafUnBuilder) Limit

func (b *AltLeafUnBuilder) Limit(maxRowCount int, offset int) *AltLeafUnBuilder

Limit will return a subset of the data, limited to the offset and number of rows specified. For large data sets and specific types of queries, this can be slow, because it will perform the entire query before computing the limit. You cannot limit a query that has embedded arrays.

func (*AltLeafUnBuilder) Load

func (b *AltLeafUnBuilder) Load() (altLeafUns []*AltLeafUn, err error)

Load terminates the query builder, performs the query, and returns a slice of AltLeafUn objects. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*AltLeafUnBuilder) LoadCursor

func (b *AltLeafUnBuilder) LoadCursor() (altLeafUnsCursor, error)

LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.

A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.

Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use

defer cursor.Close()

to make sure the cursor gets closed.

func (*AltLeafUnBuilder) LoadI

func (b *AltLeafUnBuilder) LoadI() (altLeafUns []query.OrmObj, err error)

LoadI terminates the query builder, performs the query, and returns a slice of interfaces. This can then satisfy a variety of interfaces that load arrays of objects, including KeyLabeler. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*AltLeafUnBuilder) OrderBy

func (b *AltLeafUnBuilder) OrderBy(nodes ...query.Sorter) *AltLeafUnBuilder

OrderBy specifies how the resulting data should be sorted. By default, the given nodes are sorted in ascending order. Add Descending() to the node to specify that it should be sorted in descending order.

func (*AltLeafUnBuilder) Select

func (b *AltLeafUnBuilder) Select(nodes ...query.Node) *AltLeafUnBuilder

Select specifies what specific columns will be loaded with data. By default, all the columns of the alt_leaf_un table will be queried and loaded. If nodes contains columns from the alt_leaf_un table, that will limit the columns queried and loaded to only those columns. If related tables are specified, then all the columns from those tables are queried, selected and joined to the result. If columns in related tables are specified, then only those columns will be queried and loaded. Depending on the query, additional columns may automatically be added to the query. In particular, primary key columns will be added in most situations. The exception to this would be in distinct queries, group by queries, or subqueries.

func (*AltLeafUnBuilder) Where

Where adds a condition to filter what gets selected. Calling Where multiple times will AND the conditions together.

type AltRootUn

type AltRootUn struct {
	// contains filtered or unexported fields
}

AltRootUn represents an item in the alt_root_un table in the database.

func LoadAltRootUn

func LoadAltRootUn(ctx context.Context, pk float32, selectNodes ...query.Node) (*AltRootUn, error)

LoadAltRootUn returns a AltRootUn from the database. selectNodes lets you provide nodes for selecting specific fields or additional fields from related tables. See [AltRootUnsBuilder.Select] for more info.

func NewAltRootUn

func NewAltRootUn() *AltRootUn

NewAltRootUn creates a new AltRootUn object and initializes it to default values.

func (*AltRootUn) AltLeafUn

func (o *AltRootUn) AltLeafUn() *AltLeafUn

AltLeafUn returns the connected AltLeafUn object, if one was loaded. Otherwise, it will return nil.

func (*AltRootUn) Copy

func (o *AltRootUn) Copy() (newObject *AltRootUn)

Copy copies most fields to a new AltRootUn object. Forward reference ids will be copied, but reverse and many-many references will not. Attached objects will not be included in the copy. Automatically generated fields will not be included in the copy. The primary key field will not be copied. You will need to manually set the primary key field before saving. Call Save() on the new object to save it into the database. Copy might panic if any fields in the database were set to a size larger than the maximum size through a process that accessed the database outside of the ORM.

func (*AltRootUn) Delete

func (o *AltRootUn) Delete(ctx context.Context) (err error)

Delete deletes the record from the database.

An associated AltLeafUn will have its AltRootUn field set to NULL.

func (*AltRootUn) Get

func (o *AltRootUn) Get(key string) interface{}

Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil. Get can be used to retrieve a value by using the Field() of a node.

func (*AltRootUn) GetAlias

func (o *AltRootUn) GetAlias(aliasKey string) query.AliasValue

GetAlias returns the value for the Alias node aliasKey that was returned in the most recent query.

func (*AltRootUn) ID

func (o *AltRootUn) ID() float32

ID returns the loaded value of the id field in the database.

func (*AltRootUn) IDIsLoaded

func (o *AltRootUn) IDIsLoaded() bool

IDIsLoaded returns true if the value was loaded from the database or has been set.

func (*AltRootUn) Initialize

func (o *AltRootUn) Initialize()

Initialize will initialize or re-initialize a AltRootUn database object to default values.

func (*AltRootUn) IsDirty

func (o *AltRootUn) IsDirty() (dirty bool)

IsDirty returns true if the object has been changed since it was read from the database or created.

func (*AltRootUn) IsNew

func (o *AltRootUn) IsNew() bool

IsNew returns true if the object will create a new record when saved.

func (*AltRootUn) Key

func (o *AltRootUn) Key() string

Key returns a unique key for the object, among a list of similar objects.

func (*AltRootUn) Label

func (o *AltRootUn) Label() string

Label returns a human-readable label of the object. This would be what a user would see as a description of the object if choosing from a list.

func (*AltRootUn) LoadAltLeafUn

func (o *AltRootUn) LoadAltLeafUn(ctx context.Context) (*AltLeafUn, error)

LoadAltLeafUn returns the connected AltLeafUn object, if one was loaded. Otherwise, it will load a new one and return it.

func (*AltRootUn) MarshalBinary

func (o *AltRootUn) MarshalBinary() ([]byte, error)

MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.

func (*AltRootUn) MarshalJSON

func (o *AltRootUn) MarshalJSON() (data []byte, err error)

MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.

func (*AltRootUn) MarshalStringMap

func (o *AltRootUn) MarshalStringMap() map[string]interface{}

MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.

func (*AltRootUn) Name

func (o *AltRootUn) Name() string

Name returns the value of the loaded name field in the database.

func (*AltRootUn) NameIsLoaded

func (o *AltRootUn) NameIsLoaded() bool

NameIsLoaded returns true if the value was loaded from the database or has been set.

func (*AltRootUn) OriginalPrimaryKey

func (o *AltRootUn) OriginalPrimaryKey() float32

OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.

func (*AltRootUn) PrimaryKey

func (o *AltRootUn) PrimaryKey() float32

PrimaryKey returns the value of the primary key of the record.

func (*AltRootUn) Save

func (o *AltRootUn) Save(ctx context.Context) error

Save will update or insert the object, depending on the state of the object.

If it has an auto-generated primary key, it will be updated after an insert. Database errors generally will be handled by a panic and not returned here, since those indicate a problem with a database driver or configuration.

Save will return a db.OptimisticLockError if it detects a collision when two users are attempting to change the same database record.

It will return a db.UniqueValueError if it detects a collision when an attempt is made to add a record with a unique column that is given a value that is already in the database.

Updating a record that has not changed will have no effect on the database. Updating a record that has linked records will also update any linked records that are MODIFIED, and if optimistic locking is in effect, will also check whether those records have been altered or deleted, returning an OptimisticLockError if so.

func (*AltRootUn) SetAltLeafUn

func (o *AltRootUn) SetAltLeafUn(obj *AltLeafUn)

SetAltLeafUn associates obj with this AltRootUn through the reverse relationship in AltLeafUn.AltRootUn.

The association is temporary until you call Save(). Since this is a unique relationship, if a different AltLeafUn object is currently pointing to this AltRootUn, that AltLeafUn's AltRootUn value will be set to null when Save is called. If you did not use a join to query the attached AltLeafUn in the first place, used a conditional join, or joined with an expansion, be particularly careful, since you may be inadvertently changing an item that is not currently attached to this AltRootUn.

func (*AltRootUn) SetID

func (o *AltRootUn) SetID(v float32)

SetID sets the value of ID in the object, to be saved later in the database using the Save() function. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*AltRootUn) SetName

func (o *AltRootUn) SetName(v string)

SetName sets the value of Name in the object, to be saved later in the database using the Save() function.

func (*AltRootUn) SetPrimaryKey

func (o *AltRootUn) SetPrimaryKey(v float32)

SetPrimaryKey sets the value of the primary key in the object, to be saved later in the database using the Save() function. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*AltRootUn) String

func (o *AltRootUn) String() string

String implements the Stringer interface and returns a description of the record, primarily for debugging.

func (*AltRootUn) UnmarshalBinary

func (o *AltRootUn) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary converts a structure that was created with MarshalBinary into a AltRootUn object.

func (*AltRootUn) UnmarshalJSON

func (o *AltRootUn) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON unmarshalls the given json data into the AltRootUn. The AltRootUn can be a newly created object, or one loaded from the database.

After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.

Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.

The fields it expects are:

"id" - float32
"name" - string

func (*AltRootUn) UnmarshalStringMap

func (o *AltRootUn) UnmarshalStringMap(m map[string]interface{}) (err error)

UnmarshalStringMap will load the values from the stringmap into the object.

Override this in AltRootUn to modify the json before sending it here.

type AltRootUnBuilder

type AltRootUnBuilder struct {
	// contains filtered or unexported fields
}

The AltRootUnBuilder uses a builder pattern to create a query on the database. Create a AltRootUnBuilder by calling QueryAltRootUns, which will select all the AltRootUn object in the database. Then filter and arrange those objects by calling Where, Select, etc. End a query by calling either Load, LoadI, LoadCursor, Get, or Count. A AltRootUnBuilder stores the context it will use to perform the query, and thus is meant to be a short-lived object. You should not save it for later use.

func QueryAltRootUns

func QueryAltRootUns(ctx context.Context) *AltRootUnBuilder

QueryAltRootUns returns a new query builder. See AltRootUnBuilder for doc on how to use the builder. You should pass a context that has a timeout with it to protect against a long delay from the database possibly hanging your application. You can set a ReadTimeout value on the schema to do this by default during code generation.

func (*AltRootUnBuilder) Calculation

func (b *AltRootUnBuilder) Calculation(base query.TableNodeI, alias string, operation query.OperationNodeI) *AltRootUnBuilder

Calculation adds operation as an aliased value onto base. After the query, you can read the data by passing alias to GetAlias on the returned object.

func (*AltRootUnBuilder) Count

func (b *AltRootUnBuilder) Count() (int, error)

Count terminates a query and returns just the number of items in the result. If you have Select or Calculation columns in the query, it will count NULL results as well. To not count NULL values, use Where in the builder with a NotNull operation. To count distinct combinations of items, call Distinct() on the builder.

func (*AltRootUnBuilder) Distinct

func (b *AltRootUnBuilder) Distinct() *AltRootUnBuilder

Distinct removes duplicates from the results of the query. Adding a Select() is usually required.

func (*AltRootUnBuilder) Get

func (b *AltRootUnBuilder) Get() (*AltRootUn, error)

Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items. If an error occurs, or no results are found, a nil is returned.

func (*AltRootUnBuilder) GroupBy

func (b *AltRootUnBuilder) GroupBy(nodes ...query.Node) *AltRootUnBuilder

GroupBy controls how results are grouped when using aggregate functions with Calculation.

func (*AltRootUnBuilder) Having

func (b *AltRootUnBuilder) Having(node query.Node) *AltRootUnBuilder

Having does additional filtering on the results of the query after the query is performed.

func (*AltRootUnBuilder) Limit

func (b *AltRootUnBuilder) Limit(maxRowCount int, offset int) *AltRootUnBuilder

Limit will return a subset of the data, limited to the offset and number of rows specified. For large data sets and specific types of queries, this can be slow, because it will perform the entire query before computing the limit. You cannot limit a query that has embedded arrays.

func (*AltRootUnBuilder) Load

func (b *AltRootUnBuilder) Load() (altRootUns []*AltRootUn, err error)

Load terminates the query builder, performs the query, and returns a slice of AltRootUn objects. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*AltRootUnBuilder) LoadCursor

func (b *AltRootUnBuilder) LoadCursor() (altRootUnsCursor, error)

LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.

A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.

Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use

defer cursor.Close()

to make sure the cursor gets closed.

func (*AltRootUnBuilder) LoadI

func (b *AltRootUnBuilder) LoadI() (altRootUns []query.OrmObj, err error)

LoadI terminates the query builder, performs the query, and returns a slice of interfaces. This can then satisfy a variety of interfaces that load arrays of objects, including KeyLabeler. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*AltRootUnBuilder) OrderBy

func (b *AltRootUnBuilder) OrderBy(nodes ...query.Sorter) *AltRootUnBuilder

OrderBy specifies how the resulting data should be sorted. By default, the given nodes are sorted in ascending order. Add Descending() to the node to specify that it should be sorted in descending order.

func (*AltRootUnBuilder) Select

func (b *AltRootUnBuilder) Select(nodes ...query.Node) *AltRootUnBuilder

Select specifies what specific columns will be loaded with data. By default, all the columns of the alt_root_un table will be queried and loaded. If nodes contains columns from the alt_root_un table, that will limit the columns queried and loaded to only those columns. If related tables are specified, then all the columns from those tables are queried, selected and joined to the result. If columns in related tables are specified, then only those columns will be queried and loaded. Depending on the query, additional columns may automatically be added to the query. In particular, primary key columns will be added in most situations. The exception to this would be in distinct queries, group by queries, or subqueries.

func (*AltRootUnBuilder) Where

Where adds a condition to filter what gets selected. Calling Where multiple times will AND the conditions together.

type AutoGen

type AutoGen struct {
	// contains filtered or unexported fields
}

AutoGen represents an item in the auto_gen table in the database.

func LoadAutoGen

func LoadAutoGen(ctx context.Context, pk query.AutoPrimaryKey, selectNodes ...query.Node) (*AutoGen, error)

LoadAutoGen returns a AutoGen from the database. selectNodes lets you provide nodes for selecting specific fields or additional fields from related tables. See [AutoGensBuilder.Select] for more info.

func NewAutoGen

func NewAutoGen() *AutoGen

NewAutoGen creates a new AutoGen object and initializes it to default values.

func (*AutoGen) Copy

func (o *AutoGen) Copy() (newObject *AutoGen)

Copy copies most fields to a new AutoGen object. Forward reference ids will be copied, but reverse and many-many references will not. Attached objects will not be included in the copy. Automatically generated fields will not be included in the copy. The primary key field will not be copied, since it is normally auto-generated. Call Save() on the new object to save it into the database. Copy might panic if any fields in the database were set to a size larger than the maximum size through a process that accessed the database outside of the ORM.

func (*AutoGen) Created

func (o *AutoGen) Created() time.Time

Created returns the value of the loaded created field in the database.

func (*AutoGen) CreatedIsLoaded

func (o *AutoGen) CreatedIsLoaded() bool

CreatedIsLoaded returns true if the value was loaded from the database or has been set.

func (*AutoGen) Delete

func (o *AutoGen) Delete(ctx context.Context) (err error)

Delete deletes the record from the database.

func (*AutoGen) Get

func (o *AutoGen) Get(key string) interface{}

Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil. Get can be used to retrieve a value by using the Field() of a node.

func (*AutoGen) GetAlias

func (o *AutoGen) GetAlias(aliasKey string) query.AliasValue

GetAlias returns the value for the Alias node aliasKey that was returned in the most recent query.

func (*AutoGen) GroLock

func (o *AutoGen) GroLock() int64

GroLock returns the value of the loaded gro_lock field in the database.

func (*AutoGen) GroLockIsLoaded

func (o *AutoGen) GroLockIsLoaded() bool

GroLockIsLoaded returns true if the value was loaded from the database or has been set.

func (*AutoGen) GroTimestamp

func (o *AutoGen) GroTimestamp() int64

GroTimestamp returns the value of the loaded gro_timestamp field in the database.

func (*AutoGen) GroTimestampIsLoaded

func (o *AutoGen) GroTimestampIsLoaded() bool

GroTimestampIsLoaded returns true if the value was loaded from the database or has been set.

func (*AutoGen) ID

func (o *AutoGen) ID() query.AutoPrimaryKey

ID returns the loaded value of the id field in the database.

func (*AutoGen) IDIsLoaded

func (o *AutoGen) IDIsLoaded() bool

IDIsLoaded returns true if the value was loaded from the database or has been set.

func (*AutoGen) Initialize

func (o *AutoGen) Initialize()

Initialize will initialize or re-initialize a AutoGen database object to default values.

func (*AutoGen) IsDirty

func (o *AutoGen) IsDirty() (dirty bool)

IsDirty returns true if the object has been changed since it was read from the database or created.

func (*AutoGen) IsNew

func (o *AutoGen) IsNew() bool

IsNew returns true if the object will create a new record when saved.

func (*AutoGen) Key

func (o *AutoGen) Key() string

Key returns a unique key for the object, among a list of similar objects.

func (*AutoGen) Label

func (o *AutoGen) Label() string

Label returns a human-readable label of the object. This would be what a user would see as a description of the object if choosing from a list.

func (*AutoGen) MarshalBinary

func (o *AutoGen) MarshalBinary() ([]byte, error)

MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.

func (*AutoGen) MarshalJSON

func (o *AutoGen) MarshalJSON() (data []byte, err error)

MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.

func (*AutoGen) MarshalStringMap

func (o *AutoGen) MarshalStringMap() map[string]interface{}

MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.

func (*AutoGen) Modified

func (o *AutoGen) Modified() time.Time

Modified returns the value of the loaded modified field in the database.

func (*AutoGen) ModifiedIsLoaded

func (o *AutoGen) ModifiedIsLoaded() bool

ModifiedIsLoaded returns true if the value was loaded from the database or has been set.

func (*AutoGen) ModifiedIsNull

func (o *AutoGen) ModifiedIsNull() bool

ModifiedIsNull returns true if the related database value is null.

func (*AutoGen) Name

func (o *AutoGen) Name() string

Name returns the value of the loaded name field in the database.

func (*AutoGen) NameIsLoaded

func (o *AutoGen) NameIsLoaded() bool

NameIsLoaded returns true if the value was loaded from the database or has been set.

func (*AutoGen) OriginalPrimaryKey

func (o *AutoGen) OriginalPrimaryKey() query.AutoPrimaryKey

OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.

func (*AutoGen) PrimaryKey

func (o *AutoGen) PrimaryKey() query.AutoPrimaryKey

PrimaryKey returns the value of the primary key of the record.

func (*AutoGen) Save

func (o *AutoGen) Save(ctx context.Context) error

Save will update or insert the object, depending on the state of the object.

If it has an auto-generated primary key, it will be updated after an insert. Database errors generally will be handled by a panic and not returned here, since those indicate a problem with a database driver or configuration.

Save will return a db.OptimisticLockError if it detects a collision when two users are attempting to change the same database record.

It will return a db.UniqueValueError if it detects a collision when an attempt is made to add a record with a unique column that is given a value that is already in the database.

Updating a record that has not changed will have no effect on the database. Updating a record that has linked records will also update any linked records that are MODIFIED, and if optimistic locking is in effect, will also check whether those records have been altered or deleted, returning an OptimisticLockError if so.

func (*AutoGen) SetID

func (o *AutoGen) SetID(v query.AutoPrimaryKey)

SetID sets the value of ID in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the ID value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*AutoGen) SetName

func (o *AutoGen) SetName(v string)

SetName sets the value of Name in the object, to be saved later in the database using the Save() function.

func (*AutoGen) SetPrimaryKey

func (o *AutoGen) SetPrimaryKey(v query.AutoPrimaryKey)

SetPrimaryKey sets the value of the primary key in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the primary key value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*AutoGen) String

func (o *AutoGen) String() string

String implements the Stringer interface and returns a description of the record, primarily for debugging.

func (*AutoGen) UnmarshalBinary

func (o *AutoGen) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary converts a structure that was created with MarshalBinary into a AutoGen object.

func (*AutoGen) UnmarshalJSON

func (o *AutoGen) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON unmarshalls the given json data into the AutoGen. The AutoGen can be a newly created object, or one loaded from the database.

After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.

Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.

The fields it expects are:

"id" - query.AutoPrimaryKey
"groLock" - int64
"groTimestamp" - int64
"created" - time.Time
"modified" - time.Time, nullable
"name" - string

func (*AutoGen) UnmarshalStringMap

func (o *AutoGen) UnmarshalStringMap(m map[string]interface{}) (err error)

UnmarshalStringMap will load the values from the stringmap into the object.

Override this in AutoGen to modify the json before sending it here.

type AutoGenBuilder

type AutoGenBuilder struct {
	// contains filtered or unexported fields
}

The AutoGenBuilder uses a builder pattern to create a query on the database. Create a AutoGenBuilder by calling QueryAutoGens, which will select all the AutoGen object in the database. Then filter and arrange those objects by calling Where, Select, etc. End a query by calling either Load, LoadI, LoadCursor, Get, or Count. A AutoGenBuilder stores the context it will use to perform the query, and thus is meant to be a short-lived object. You should not save it for later use.

func QueryAutoGens

func QueryAutoGens(ctx context.Context) *AutoGenBuilder

QueryAutoGens returns a new query builder. See AutoGenBuilder for doc on how to use the builder. You should pass a context that has a timeout with it to protect against a long delay from the database possibly hanging your application. You can set a ReadTimeout value on the schema to do this by default during code generation.

func (*AutoGenBuilder) Calculation

func (b *AutoGenBuilder) Calculation(base query.TableNodeI, alias string, operation query.OperationNodeI) *AutoGenBuilder

Calculation adds operation as an aliased value onto base. After the query, you can read the data by passing alias to GetAlias on the returned object.

func (*AutoGenBuilder) Count

func (b *AutoGenBuilder) Count() (int, error)

Count terminates a query and returns just the number of items in the result. If you have Select or Calculation columns in the query, it will count NULL results as well. To not count NULL values, use Where in the builder with a NotNull operation. To count distinct combinations of items, call Distinct() on the builder.

func (*AutoGenBuilder) Distinct

func (b *AutoGenBuilder) Distinct() *AutoGenBuilder

Distinct removes duplicates from the results of the query. Adding a Select() is usually required.

func (*AutoGenBuilder) Get

func (b *AutoGenBuilder) Get() (*AutoGen, error)

Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items. If an error occurs, or no results are found, a nil is returned.

func (*AutoGenBuilder) GroupBy

func (b *AutoGenBuilder) GroupBy(nodes ...query.Node) *AutoGenBuilder

GroupBy controls how results are grouped when using aggregate functions with Calculation.

func (*AutoGenBuilder) Having

func (b *AutoGenBuilder) Having(node query.Node) *AutoGenBuilder

Having does additional filtering on the results of the query after the query is performed.

func (*AutoGenBuilder) Limit

func (b *AutoGenBuilder) Limit(maxRowCount int, offset int) *AutoGenBuilder

Limit will return a subset of the data, limited to the offset and number of rows specified. For large data sets and specific types of queries, this can be slow, because it will perform the entire query before computing the limit. You cannot limit a query that has embedded arrays.

func (*AutoGenBuilder) Load

func (b *AutoGenBuilder) Load() (autoGens []*AutoGen, err error)

Load terminates the query builder, performs the query, and returns a slice of AutoGen objects. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*AutoGenBuilder) LoadCursor

func (b *AutoGenBuilder) LoadCursor() (autoGensCursor, error)

LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.

A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.

Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use

defer cursor.Close()

to make sure the cursor gets closed.

func (*AutoGenBuilder) LoadI

func (b *AutoGenBuilder) LoadI() (autoGens []query.OrmObj, err error)

LoadI terminates the query builder, performs the query, and returns a slice of interfaces. This can then satisfy a variety of interfaces that load arrays of objects, including KeyLabeler. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*AutoGenBuilder) OrderBy

func (b *AutoGenBuilder) OrderBy(nodes ...query.Sorter) *AutoGenBuilder

OrderBy specifies how the resulting data should be sorted. By default, the given nodes are sorted in ascending order. Add Descending() to the node to specify that it should be sorted in descending order.

func (*AutoGenBuilder) Select

func (b *AutoGenBuilder) Select(nodes ...query.Node) *AutoGenBuilder

Select specifies what specific columns will be loaded with data. By default, all the columns of the auto_gen table will be queried and loaded. If nodes contains columns from the auto_gen table, that will limit the columns queried and loaded to only those columns. If related tables are specified, then all the columns from those tables are queried, selected and joined to the result. If columns in related tables are specified, then only those columns will be queried and loaded. Depending on the query, additional columns may automatically be added to the query. In particular, primary key columns will be added in most situations. The exception to this would be in distinct queries, group by queries, or subqueries.

func (*AutoGenBuilder) Where

func (b *AutoGenBuilder) Where(c query.Node) *AutoGenBuilder

Where adds a condition to filter what gets selected. Calling Where multiple times will AND the conditions together.

type DoubleIndex

type DoubleIndex struct {
	// contains filtered or unexported fields
}

DoubleIndex represents an item in the double_index table in the database.

func LoadDoubleIndex

func LoadDoubleIndex(ctx context.Context, pk int, selectNodes ...query.Node) (*DoubleIndex, error)

LoadDoubleIndex returns a DoubleIndex from the database. selectNodes lets you provide nodes for selecting specific fields or additional fields from related tables. See [DoubleIndicesBuilder.Select] for more info.

func LoadDoubleIndexByField2IntField2String

func LoadDoubleIndexByField2IntField2String(ctx context.Context, field2Int interface{}, field2String interface{}, selectNodes ...query.Node) (*DoubleIndex, error)

LoadDoubleIndexByField2IntField2String queries for a single DoubleIndex object by the given unique index values. selectNodes optionally let you provide nodes for joining to other tables or selecting specific fields. See [DoubleIndicesBuilder.Select]. If you need a more elaborate query, use QueryDoubleIndices() to start a query builder.

func LoadDoubleIndexByFieldIntFieldString

func LoadDoubleIndexByFieldIntFieldString(ctx context.Context, fieldInt int, fieldString string, selectNodes ...query.Node) (*DoubleIndex, error)

LoadDoubleIndexByFieldIntFieldString queries for a single DoubleIndex object by the given unique index values. selectNodes optionally let you provide nodes for joining to other tables or selecting specific fields. See [DoubleIndicesBuilder.Select]. If you need a more elaborate query, use QueryDoubleIndices() to start a query builder.

func NewDoubleIndex

func NewDoubleIndex() *DoubleIndex

NewDoubleIndex creates a new DoubleIndex object and initializes it to default values.

func (*DoubleIndex) Copy

func (o *DoubleIndex) Copy() (newObject *DoubleIndex)

Copy copies most fields to a new DoubleIndex object. Forward reference ids will be copied, but reverse and many-many references will not. Attached objects will not be included in the copy. Automatically generated fields will not be included in the copy. The primary key field will not be copied. You will need to manually set the primary key field before saving. Call Save() on the new object to save it into the database. Copy might panic if any fields in the database were set to a size larger than the maximum size through a process that accessed the database outside of the ORM.

func (*DoubleIndex) Delete

func (o *DoubleIndex) Delete(ctx context.Context) (err error)

Delete deletes the record from the database.

func (*DoubleIndex) Field2Int

func (o *DoubleIndex) Field2Int() int

Field2Int returns the value of the loaded field2_int field in the database.

func (*DoubleIndex) Field2IntIsLoaded

func (o *DoubleIndex) Field2IntIsLoaded() bool

Field2IntIsLoaded returns true if the value was loaded from the database or has been set.

func (*DoubleIndex) Field2IntIsNull

func (o *DoubleIndex) Field2IntIsNull() bool

Field2IntIsNull returns true if the related database value is null.

func (*DoubleIndex) Field2String

func (o *DoubleIndex) Field2String() string

Field2String returns the value of the loaded field2_string field in the database.

func (*DoubleIndex) Field2StringIsLoaded

func (o *DoubleIndex) Field2StringIsLoaded() bool

Field2StringIsLoaded returns true if the value was loaded from the database or has been set.

func (*DoubleIndex) Field2StringIsNull

func (o *DoubleIndex) Field2StringIsNull() bool

Field2StringIsNull returns true if the related database value is null.

func (*DoubleIndex) FieldInt

func (o *DoubleIndex) FieldInt() int

FieldInt returns the value of the loaded field_int field in the database.

func (*DoubleIndex) FieldIntIsLoaded

func (o *DoubleIndex) FieldIntIsLoaded() bool

FieldIntIsLoaded returns true if the value was loaded from the database or has been set.

func (*DoubleIndex) FieldString

func (o *DoubleIndex) FieldString() string

FieldString returns the value of the loaded field_string field in the database.

func (*DoubleIndex) FieldStringIsLoaded

func (o *DoubleIndex) FieldStringIsLoaded() bool

FieldStringIsLoaded returns true if the value was loaded from the database or has been set.

func (*DoubleIndex) Get

func (o *DoubleIndex) Get(key string) interface{}

Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil. Get can be used to retrieve a value by using the Field() of a node.

func (*DoubleIndex) GetAlias

func (o *DoubleIndex) GetAlias(aliasKey string) query.AliasValue

GetAlias returns the value for the Alias node aliasKey that was returned in the most recent query.

func (*DoubleIndex) ID

func (o *DoubleIndex) ID() int

ID returns the loaded value of the id field in the database.

func (*DoubleIndex) IDIsLoaded

func (o *DoubleIndex) IDIsLoaded() bool

IDIsLoaded returns true if the value was loaded from the database or has been set.

func (*DoubleIndex) Initialize

func (o *DoubleIndex) Initialize()

Initialize will initialize or re-initialize a DoubleIndex database object to default values.

func (*DoubleIndex) IsDirty

func (o *DoubleIndex) IsDirty() (dirty bool)

IsDirty returns true if the object has been changed since it was read from the database or created.

func (*DoubleIndex) IsNew

func (o *DoubleIndex) IsNew() bool

IsNew returns true if the object will create a new record when saved.

func (*DoubleIndex) Key

func (o *DoubleIndex) Key() string

Key returns a unique key for the object, among a list of similar objects.

func (*DoubleIndex) Label

func (o *DoubleIndex) Label() string

Label returns a human-readable label of the object. This would be what a user would see as a description of the object if choosing from a list.

func (*DoubleIndex) MarshalBinary

func (o *DoubleIndex) MarshalBinary() ([]byte, error)

MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.

func (*DoubleIndex) MarshalJSON

func (o *DoubleIndex) MarshalJSON() (data []byte, err error)

MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.

func (*DoubleIndex) MarshalStringMap

func (o *DoubleIndex) MarshalStringMap() map[string]interface{}

MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.

func (*DoubleIndex) OriginalPrimaryKey

func (o *DoubleIndex) OriginalPrimaryKey() int

OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.

func (*DoubleIndex) PrimaryKey

func (o *DoubleIndex) PrimaryKey() int

PrimaryKey returns the value of the primary key of the record.

func (*DoubleIndex) Save

func (o *DoubleIndex) Save(ctx context.Context) error

Save will update or insert the object, depending on the state of the object.

If it has an auto-generated primary key, it will be updated after an insert. Database errors generally will be handled by a panic and not returned here, since those indicate a problem with a database driver or configuration.

Save will return a db.OptimisticLockError if it detects a collision when two users are attempting to change the same database record.

It will return a db.UniqueValueError if it detects a collision when an attempt is made to add a record with a unique column that is given a value that is already in the database.

Updating a record that has not changed will have no effect on the database. Updating a record that has linked records will also update any linked records that are MODIFIED, and if optimistic locking is in effect, will also check whether those records have been altered or deleted, returning an OptimisticLockError if so.

func (*DoubleIndex) SetField2Int

func (o *DoubleIndex) SetField2Int(v int)

SetField2Int sets the value of Field2Int in the object, to be saved later in the database using the Save() function.

func (*DoubleIndex) SetField2IntToNull

func (o *DoubleIndex) SetField2IntToNull()

SetField2IntToNull() will set the field2_int value in the database to NULL. Field2Int() will return the column's default value after this.

func (*DoubleIndex) SetField2String

func (o *DoubleIndex) SetField2String(v string)

SetField2String sets the value of Field2String in the object, to be saved later in the database using the Save() function.

func (*DoubleIndex) SetField2StringToNull

func (o *DoubleIndex) SetField2StringToNull()

SetField2StringToNull() will set the field2_string value in the database to NULL. Field2String() will return the column's default value after this.

func (*DoubleIndex) SetFieldInt

func (o *DoubleIndex) SetFieldInt(v int)

SetFieldInt sets the value of FieldInt in the object, to be saved later in the database using the Save() function.

func (*DoubleIndex) SetFieldString

func (o *DoubleIndex) SetFieldString(v string)

SetFieldString sets the value of FieldString in the object, to be saved later in the database using the Save() function.

func (*DoubleIndex) SetID

func (o *DoubleIndex) SetID(v int)

SetID sets the value of ID in the object, to be saved later in the database using the Save() function. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*DoubleIndex) SetPrimaryKey

func (o *DoubleIndex) SetPrimaryKey(v int)

SetPrimaryKey sets the value of the primary key in the object, to be saved later in the database using the Save() function. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*DoubleIndex) String

func (o *DoubleIndex) String() string

String implements the Stringer interface and returns a description of the record, primarily for debugging.

func (*DoubleIndex) UnmarshalBinary

func (o *DoubleIndex) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary converts a structure that was created with MarshalBinary into a DoubleIndex object.

func (*DoubleIndex) UnmarshalJSON

func (o *DoubleIndex) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON unmarshalls the given json data into the DoubleIndex. The DoubleIndex can be a newly created object, or one loaded from the database.

After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.

Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.

The fields it expects are:

"id" - int
"fieldInt" - int
"fieldString" - string
"field2Int" - int, nullable
"field2String" - string, nullable

func (*DoubleIndex) UnmarshalStringMap

func (o *DoubleIndex) UnmarshalStringMap(m map[string]interface{}) (err error)

UnmarshalStringMap will load the values from the stringmap into the object.

Override this in DoubleIndex to modify the json before sending it here.

type DoubleIndexBuilder

type DoubleIndexBuilder struct {
	// contains filtered or unexported fields
}

The DoubleIndexBuilder uses a builder pattern to create a query on the database. Create a DoubleIndexBuilder by calling QueryDoubleIndices, which will select all the DoubleIndex object in the database. Then filter and arrange those objects by calling Where, Select, etc. End a query by calling either Load, LoadI, LoadCursor, Get, or Count. A DoubleIndexBuilder stores the context it will use to perform the query, and thus is meant to be a short-lived object. You should not save it for later use.

func QueryDoubleIndices

func QueryDoubleIndices(ctx context.Context) *DoubleIndexBuilder

QueryDoubleIndices returns a new query builder. See DoubleIndexBuilder for doc on how to use the builder. You should pass a context that has a timeout with it to protect against a long delay from the database possibly hanging your application. You can set a ReadTimeout value on the schema to do this by default during code generation.

func (*DoubleIndexBuilder) Calculation

func (b *DoubleIndexBuilder) Calculation(base query.TableNodeI, alias string, operation query.OperationNodeI) *DoubleIndexBuilder

Calculation adds operation as an aliased value onto base. After the query, you can read the data by passing alias to GetAlias on the returned object.

func (*DoubleIndexBuilder) Count

func (b *DoubleIndexBuilder) Count() (int, error)

Count terminates a query and returns just the number of items in the result. If you have Select or Calculation columns in the query, it will count NULL results as well. To not count NULL values, use Where in the builder with a NotNull operation. To count distinct combinations of items, call Distinct() on the builder.

func (*DoubleIndexBuilder) Distinct

func (b *DoubleIndexBuilder) Distinct() *DoubleIndexBuilder

Distinct removes duplicates from the results of the query. Adding a Select() is usually required.

func (*DoubleIndexBuilder) Get

func (b *DoubleIndexBuilder) Get() (*DoubleIndex, error)

Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items. If an error occurs, or no results are found, a nil is returned.

func (*DoubleIndexBuilder) GroupBy

func (b *DoubleIndexBuilder) GroupBy(nodes ...query.Node) *DoubleIndexBuilder

GroupBy controls how results are grouped when using aggregate functions with Calculation.

func (*DoubleIndexBuilder) Having

Having does additional filtering on the results of the query after the query is performed.

func (*DoubleIndexBuilder) Limit

func (b *DoubleIndexBuilder) Limit(maxRowCount int, offset int) *DoubleIndexBuilder

Limit will return a subset of the data, limited to the offset and number of rows specified. For large data sets and specific types of queries, this can be slow, because it will perform the entire query before computing the limit. You cannot limit a query that has embedded arrays.

func (*DoubleIndexBuilder) Load

func (b *DoubleIndexBuilder) Load() (doubleIndices []*DoubleIndex, err error)

Load terminates the query builder, performs the query, and returns a slice of DoubleIndex objects. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*DoubleIndexBuilder) LoadCursor

func (b *DoubleIndexBuilder) LoadCursor() (doubleIndicesCursor, error)

LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.

A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.

Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use

defer cursor.Close()

to make sure the cursor gets closed.

func (*DoubleIndexBuilder) LoadI

func (b *DoubleIndexBuilder) LoadI() (doubleIndices []query.OrmObj, err error)

LoadI terminates the query builder, performs the query, and returns a slice of interfaces. This can then satisfy a variety of interfaces that load arrays of objects, including KeyLabeler. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*DoubleIndexBuilder) OrderBy

func (b *DoubleIndexBuilder) OrderBy(nodes ...query.Sorter) *DoubleIndexBuilder

OrderBy specifies how the resulting data should be sorted. By default, the given nodes are sorted in ascending order. Add Descending() to the node to specify that it should be sorted in descending order.

func (*DoubleIndexBuilder) Select

func (b *DoubleIndexBuilder) Select(nodes ...query.Node) *DoubleIndexBuilder

Select specifies what specific columns will be loaded with data. By default, all the columns of the double_index table will be queried and loaded. If nodes contains columns from the double_index table, that will limit the columns queried and loaded to only those columns. If related tables are specified, then all the columns from those tables are queried, selected and joined to the result. If columns in related tables are specified, then only those columns will be queried and loaded. Depending on the query, additional columns may automatically be added to the query. In particular, primary key columns will be added in most situations. The exception to this would be in distinct queries, group by queries, or subqueries.

func (*DoubleIndexBuilder) Where

Where adds a condition to filter what gets selected. Calling Where multiple times will AND the conditions together.

type Leaf

type Leaf struct {
	// contains filtered or unexported fields
}

Leaf represents an item in the leaf table in the database.

func LoadLeaf

func LoadLeaf(ctx context.Context, pk query.AutoPrimaryKey, selectNodes ...query.Node) (*Leaf, error)

LoadLeaf returns a Leaf from the database. selectNodes lets you provide nodes for selecting specific fields or additional fields from related tables. See [LeafsBuilder.Select] for more info.

func LoadLeafsByRootID

func LoadLeafsByRootID(ctx context.Context, rootID query.AutoPrimaryKey, selectNodes ...query.Node) ([]*Leaf, error)

LoadLeafsByRootID queries Leaf objects by the given index values. selectNodes optionally let you provide nodes for joining to other tables or selecting specific fields. See [LeafsBuilder.Select]. If you need a more elaborate query, use QueryLeafs() to start a query builder.

func NewLeaf

func NewLeaf() *Leaf

NewLeaf creates a new Leaf object and initializes it to default values.

func (*Leaf) Copy

func (o *Leaf) Copy() (newObject *Leaf)

Copy copies most fields to a new Leaf object. Forward reference ids will be copied, but reverse and many-many references will not. Attached objects will not be included in the copy. Automatically generated fields will not be included in the copy. The primary key field will not be copied, since it is normally auto-generated. Call Save() on the new object to save it into the database. Copy might panic if any fields in the database were set to a size larger than the maximum size through a process that accessed the database outside of the ORM.

func (*Leaf) Delete

func (o *Leaf) Delete(ctx context.Context) (err error)

Delete deletes the record from the database.

func (*Leaf) Get

func (o *Leaf) Get(key string) interface{}

Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil. Get can be used to retrieve a value by using the Field() of a node.

func (*Leaf) GetAlias

func (o *Leaf) GetAlias(aliasKey string) query.AliasValue

GetAlias returns the value for the Alias node aliasKey that was returned in the most recent query.

func (*Leaf) ID

func (o *Leaf) ID() query.AutoPrimaryKey

ID returns the loaded value of the id field in the database.

func (*Leaf) IDIsLoaded

func (o *Leaf) IDIsLoaded() bool

IDIsLoaded returns true if the value was loaded from the database or has been set.

func (*Leaf) Initialize

func (o *Leaf) Initialize()

Initialize will initialize or re-initialize a Leaf database object to default values.

func (*Leaf) IsDirty

func (o *Leaf) IsDirty() (dirty bool)

IsDirty returns true if the object has been changed since it was read from the database or created.

func (*Leaf) IsNew

func (o *Leaf) IsNew() bool

IsNew returns true if the object will create a new record when saved.

func (*Leaf) Key

func (o *Leaf) Key() string

Key returns a unique key for the object, among a list of similar objects.

func (*Leaf) Label

func (o *Leaf) Label() string

Label returns a human-readable label of the object. This would be what a user would see as a description of the object if choosing from a list.

func (*Leaf) LoadRoot

func (o *Leaf) LoadRoot(ctx context.Context) (*Root, error)

LoadRoot returns the related Root. If it is not already loaded, it will attempt to load it, provided the RootID column has been loaded first.

func (*Leaf) MarshalBinary

func (o *Leaf) MarshalBinary() ([]byte, error)

MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.

func (*Leaf) MarshalJSON

func (o *Leaf) MarshalJSON() (data []byte, err error)

MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.

func (*Leaf) MarshalStringMap

func (o *Leaf) MarshalStringMap() map[string]interface{}

MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.

func (*Leaf) Name

func (o *Leaf) Name() string

Name returns the value of the loaded name field in the database.

func (*Leaf) NameIsLoaded

func (o *Leaf) NameIsLoaded() bool

NameIsLoaded returns true if the value was loaded from the database or has been set.

func (*Leaf) OriginalPrimaryKey

func (o *Leaf) OriginalPrimaryKey() query.AutoPrimaryKey

OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.

func (*Leaf) PrimaryKey

func (o *Leaf) PrimaryKey() query.AutoPrimaryKey

PrimaryKey returns the value of the primary key of the record.

func (*Leaf) Root

func (o *Leaf) Root() *Root

Root returns the current value of the loaded Root, and nil if its not loaded.

func (*Leaf) RootID

func (o *Leaf) RootID() query.AutoPrimaryKey

RootID returns the value of the loaded root_id field in the database.

func (*Leaf) RootIDIsLoaded

func (o *Leaf) RootIDIsLoaded() bool

RootIDIsLoaded returns true if the value was loaded from the database or has been set.

func (*Leaf) Save

func (o *Leaf) Save(ctx context.Context) error

Save will update or insert the object, depending on the state of the object.

If it has an auto-generated primary key, it will be updated after an insert. Database errors generally will be handled by a panic and not returned here, since those indicate a problem with a database driver or configuration.

Save will return a db.OptimisticLockError if it detects a collision when two users are attempting to change the same database record.

It will return a db.UniqueValueError if it detects a collision when an attempt is made to add a record with a unique column that is given a value that is already in the database.

Updating a record that has not changed will have no effect on the database. Updating a record that has linked records will also update any linked records that are MODIFIED, and if optimistic locking is in effect, will also check whether those records have been altered or deleted, returning an OptimisticLockError if so.

func (*Leaf) SetID

func (o *Leaf) SetID(v query.AutoPrimaryKey)

SetID sets the value of ID in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the ID value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*Leaf) SetName

func (o *Leaf) SetName(v string)

SetName sets the value of Name in the object, to be saved later in the database using the Save() function.

func (*Leaf) SetPrimaryKey

func (o *Leaf) SetPrimaryKey(v query.AutoPrimaryKey)

SetPrimaryKey sets the value of the primary key in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the primary key value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*Leaf) SetRoot

func (o *Leaf) SetRoot(root *Root)

SetRoot sets the value of Root in the object, to be saved later using the Save() function.

func (*Leaf) SetRootID

func (o *Leaf) SetRootID(v query.AutoPrimaryKey)

SetRootID sets the value of RootID in the object, to be saved later in the database using the Save() function.

func (*Leaf) String

func (o *Leaf) String() string

String implements the Stringer interface and returns a description of the record, primarily for debugging.

func (*Leaf) UnmarshalBinary

func (o *Leaf) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary converts a structure that was created with MarshalBinary into a Leaf object.

func (*Leaf) UnmarshalJSON

func (o *Leaf) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON unmarshalls the given json data into the Leaf. The Leaf can be a newly created object, or one loaded from the database.

After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.

Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.

The fields it expects are:

"id" - query.AutoPrimaryKey
"name" - string

func (*Leaf) UnmarshalStringMap

func (o *Leaf) UnmarshalStringMap(m map[string]interface{}) (err error)

UnmarshalStringMap will load the values from the stringmap into the object.

Override this in Leaf to modify the json before sending it here.

type LeafBuilder

type LeafBuilder struct {
	// contains filtered or unexported fields
}

The LeafBuilder uses a builder pattern to create a query on the database. Create a LeafBuilder by calling QueryLeafs, which will select all the Leaf object in the database. Then filter and arrange those objects by calling Where, Select, etc. End a query by calling either Load, LoadI, LoadCursor, Get, or Count. A LeafBuilder stores the context it will use to perform the query, and thus is meant to be a short-lived object. You should not save it for later use.

func QueryLeafs

func QueryLeafs(ctx context.Context) *LeafBuilder

QueryLeafs returns a new query builder. See LeafBuilder for doc on how to use the builder. You should pass a context that has a timeout with it to protect against a long delay from the database possibly hanging your application. You can set a ReadTimeout value on the schema to do this by default during code generation.

func (*LeafBuilder) Calculation

func (b *LeafBuilder) Calculation(base query.TableNodeI, alias string, operation query.OperationNodeI) *LeafBuilder

Calculation adds operation as an aliased value onto base. After the query, you can read the data by passing alias to GetAlias on the returned object.

func (*LeafBuilder) Count

func (b *LeafBuilder) Count() (int, error)

Count terminates a query and returns just the number of items in the result. If you have Select or Calculation columns in the query, it will count NULL results as well. To not count NULL values, use Where in the builder with a NotNull operation. To count distinct combinations of items, call Distinct() on the builder.

func (*LeafBuilder) Distinct

func (b *LeafBuilder) Distinct() *LeafBuilder

Distinct removes duplicates from the results of the query. Adding a Select() is usually required.

func (*LeafBuilder) Get

func (b *LeafBuilder) Get() (*Leaf, error)

Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items. If an error occurs, or no results are found, a nil is returned.

func (*LeafBuilder) GroupBy

func (b *LeafBuilder) GroupBy(nodes ...query.Node) *LeafBuilder

GroupBy controls how results are grouped when using aggregate functions with Calculation.

func (*LeafBuilder) Having

func (b *LeafBuilder) Having(node query.Node) *LeafBuilder

Having does additional filtering on the results of the query after the query is performed.

func (*LeafBuilder) Limit

func (b *LeafBuilder) Limit(maxRowCount int, offset int) *LeafBuilder

Limit will return a subset of the data, limited to the offset and number of rows specified. For large data sets and specific types of queries, this can be slow, because it will perform the entire query before computing the limit. You cannot limit a query that has embedded arrays.

func (*LeafBuilder) Load

func (b *LeafBuilder) Load() (leafs []*Leaf, err error)

Load terminates the query builder, performs the query, and returns a slice of Leaf objects. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*LeafBuilder) LoadCursor

func (b *LeafBuilder) LoadCursor() (leafsCursor, error)

LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.

A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.

Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use

defer cursor.Close()

to make sure the cursor gets closed.

func (*LeafBuilder) LoadI

func (b *LeafBuilder) LoadI() (leafs []query.OrmObj, err error)

LoadI terminates the query builder, performs the query, and returns a slice of interfaces. This can then satisfy a variety of interfaces that load arrays of objects, including KeyLabeler. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*LeafBuilder) OrderBy

func (b *LeafBuilder) OrderBy(nodes ...query.Sorter) *LeafBuilder

OrderBy specifies how the resulting data should be sorted. By default, the given nodes are sorted in ascending order. Add Descending() to the node to specify that it should be sorted in descending order.

func (*LeafBuilder) Select

func (b *LeafBuilder) Select(nodes ...query.Node) *LeafBuilder

Select specifies what specific columns will be loaded with data. By default, all the columns of the leaf table will be queried and loaded. If nodes contains columns from the leaf table, that will limit the columns queried and loaded to only those columns. If related tables are specified, then all the columns from those tables are queried, selected and joined to the result. If columns in related tables are specified, then only those columns will be queried and loaded. Depending on the query, additional columns may automatically be added to the query. In particular, primary key columns will be added in most situations. The exception to this would be in distinct queries, group by queries, or subqueries.

func (*LeafBuilder) Where

func (b *LeafBuilder) Where(c query.Node) *LeafBuilder

Where adds a condition to filter what gets selected. Calling Where multiple times will AND the conditions together.

type LeafL

type LeafL struct {
	// contains filtered or unexported fields
}

LeafL represents an item in the leaf_l table in the database.

func LoadLeafL

func LoadLeafL(ctx context.Context, pk query.AutoPrimaryKey, selectNodes ...query.Node) (*LeafL, error)

LoadLeafL returns a LeafL from the database. selectNodes lets you provide nodes for selecting specific fields or additional fields from related tables. See [LeafLsBuilder.Select] for more info.

func LoadLeafLsByRootLID

func LoadLeafLsByRootLID(ctx context.Context, rootLID query.AutoPrimaryKey, selectNodes ...query.Node) ([]*LeafL, error)

LoadLeafLsByRootLID queries LeafL objects by the given index values. selectNodes optionally let you provide nodes for joining to other tables or selecting specific fields. See [LeafLsBuilder.Select]. If you need a more elaborate query, use QueryLeafLs() to start a query builder.

func NewLeafL

func NewLeafL() *LeafL

NewLeafL creates a new LeafL object and initializes it to default values.

func (*LeafL) Copy

func (o *LeafL) Copy() (newObject *LeafL)

Copy copies most fields to a new LeafL object. Forward reference ids will be copied, but reverse and many-many references will not. Attached objects will not be included in the copy. Automatically generated fields will not be included in the copy. The primary key field will not be copied, since it is normally auto-generated. Call Save() on the new object to save it into the database. Copy might panic if any fields in the database were set to a size larger than the maximum size through a process that accessed the database outside of the ORM.

func (*LeafL) Delete

func (o *LeafL) Delete(ctx context.Context) (err error)

Delete deletes the record from the database.

func (*LeafL) Get

func (o *LeafL) Get(key string) interface{}

Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil. Get can be used to retrieve a value by using the Field() of a node.

func (*LeafL) GetAlias

func (o *LeafL) GetAlias(aliasKey string) query.AliasValue

GetAlias returns the value for the Alias node aliasKey that was returned in the most recent query.

func (*LeafL) GroLock

func (o *LeafL) GroLock() int64

GroLock returns the value of the loaded gro_lock field in the database.

func (*LeafL) GroLockIsLoaded

func (o *LeafL) GroLockIsLoaded() bool

GroLockIsLoaded returns true if the value was loaded from the database or has been set.

func (*LeafL) ID

func (o *LeafL) ID() query.AutoPrimaryKey

ID returns the loaded value of the id field in the database.

func (*LeafL) IDIsLoaded

func (o *LeafL) IDIsLoaded() bool

IDIsLoaded returns true if the value was loaded from the database or has been set.

func (*LeafL) Initialize

func (o *LeafL) Initialize()

Initialize will initialize or re-initialize a LeafL database object to default values.

func (*LeafL) IsDirty

func (o *LeafL) IsDirty() (dirty bool)

IsDirty returns true if the object has been changed since it was read from the database or created.

func (*LeafL) IsNew

func (o *LeafL) IsNew() bool

IsNew returns true if the object will create a new record when saved.

func (*LeafL) Key

func (o *LeafL) Key() string

Key returns a unique key for the object, among a list of similar objects.

func (*LeafL) Label

func (o *LeafL) Label() string

Label returns a human-readable label of the object. This would be what a user would see as a description of the object if choosing from a list.

func (*LeafL) LoadRootL

func (o *LeafL) LoadRootL(ctx context.Context) (*RootL, error)

LoadRootL returns the related RootL. If it is not already loaded, it will attempt to load it, provided the RootLID column has been loaded first.

func (*LeafL) MarshalBinary

func (o *LeafL) MarshalBinary() ([]byte, error)

MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.

func (*LeafL) MarshalJSON

func (o *LeafL) MarshalJSON() (data []byte, err error)

MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.

func (*LeafL) MarshalStringMap

func (o *LeafL) MarshalStringMap() map[string]interface{}

MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.

func (*LeafL) Name

func (o *LeafL) Name() string

Name returns the value of the loaded name field in the database.

func (*LeafL) NameIsLoaded

func (o *LeafL) NameIsLoaded() bool

NameIsLoaded returns true if the value was loaded from the database or has been set.

func (*LeafL) OriginalPrimaryKey

func (o *LeafL) OriginalPrimaryKey() query.AutoPrimaryKey

OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.

func (*LeafL) PrimaryKey

func (o *LeafL) PrimaryKey() query.AutoPrimaryKey

PrimaryKey returns the value of the primary key of the record.

func (*LeafL) RootL

func (o *LeafL) RootL() *RootL

RootL returns the current value of the loaded RootL, and nil if its not loaded.

func (*LeafL) RootLID

func (o *LeafL) RootLID() query.AutoPrimaryKey

RootLID returns the value of the loaded root_l_id field in the database.

func (*LeafL) RootLIDIsLoaded

func (o *LeafL) RootLIDIsLoaded() bool

RootLIDIsLoaded returns true if the value was loaded from the database or has been set.

func (*LeafL) Save

func (o *LeafL) Save(ctx context.Context) error

Save will update or insert the object, depending on the state of the object.

If it has an auto-generated primary key, it will be updated after an insert. Database errors generally will be handled by a panic and not returned here, since those indicate a problem with a database driver or configuration.

Save will return a db.OptimisticLockError if it detects a collision when two users are attempting to change the same database record.

It will return a db.UniqueValueError if it detects a collision when an attempt is made to add a record with a unique column that is given a value that is already in the database.

Updating a record that has not changed will have no effect on the database. Updating a record that has linked records will also update any linked records that are MODIFIED, and if optimistic locking is in effect, will also check whether those records have been altered or deleted, returning an OptimisticLockError if so.

func (*LeafL) SetID

func (o *LeafL) SetID(v query.AutoPrimaryKey)

SetID sets the value of ID in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the ID value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*LeafL) SetName

func (o *LeafL) SetName(v string)

SetName sets the value of Name in the object, to be saved later in the database using the Save() function.

func (*LeafL) SetPrimaryKey

func (o *LeafL) SetPrimaryKey(v query.AutoPrimaryKey)

SetPrimaryKey sets the value of the primary key in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the primary key value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*LeafL) SetRootL

func (o *LeafL) SetRootL(rootL *RootL)

SetRootL sets the value of RootL in the object, to be saved later using the Save() function.

func (*LeafL) SetRootLID

func (o *LeafL) SetRootLID(v query.AutoPrimaryKey)

SetRootLID sets the value of RootLID in the object, to be saved later in the database using the Save() function.

func (*LeafL) String

func (o *LeafL) String() string

String implements the Stringer interface and returns a description of the record, primarily for debugging.

func (*LeafL) UnmarshalBinary

func (o *LeafL) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary converts a structure that was created with MarshalBinary into a LeafL object.

func (*LeafL) UnmarshalJSON

func (o *LeafL) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON unmarshalls the given json data into the LeafL. The LeafL can be a newly created object, or one loaded from the database.

After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.

Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.

The fields it expects are:

"id" - query.AutoPrimaryKey
"name" - string
"groLock" - int64

func (*LeafL) UnmarshalStringMap

func (o *LeafL) UnmarshalStringMap(m map[string]interface{}) (err error)

UnmarshalStringMap will load the values from the stringmap into the object.

Override this in LeafL to modify the json before sending it here.

type LeafLBuilder

type LeafLBuilder struct {
	// contains filtered or unexported fields
}

The LeafLBuilder uses a builder pattern to create a query on the database. Create a LeafLBuilder by calling QueryLeafLs, which will select all the LeafL object in the database. Then filter and arrange those objects by calling Where, Select, etc. End a query by calling either Load, LoadI, LoadCursor, Get, or Count. A LeafLBuilder stores the context it will use to perform the query, and thus is meant to be a short-lived object. You should not save it for later use.

func QueryLeafLs

func QueryLeafLs(ctx context.Context) *LeafLBuilder

QueryLeafLs returns a new query builder. See LeafLBuilder for doc on how to use the builder. You should pass a context that has a timeout with it to protect against a long delay from the database possibly hanging your application. You can set a ReadTimeout value on the schema to do this by default during code generation.

func (*LeafLBuilder) Calculation

func (b *LeafLBuilder) Calculation(base query.TableNodeI, alias string, operation query.OperationNodeI) *LeafLBuilder

Calculation adds operation as an aliased value onto base. After the query, you can read the data by passing alias to GetAlias on the returned object.

func (*LeafLBuilder) Count

func (b *LeafLBuilder) Count() (int, error)

Count terminates a query and returns just the number of items in the result. If you have Select or Calculation columns in the query, it will count NULL results as well. To not count NULL values, use Where in the builder with a NotNull operation. To count distinct combinations of items, call Distinct() on the builder.

func (*LeafLBuilder) Distinct

func (b *LeafLBuilder) Distinct() *LeafLBuilder

Distinct removes duplicates from the results of the query. Adding a Select() is usually required.

func (*LeafLBuilder) Get

func (b *LeafLBuilder) Get() (*LeafL, error)

Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items. If an error occurs, or no results are found, a nil is returned.

func (*LeafLBuilder) GroupBy

func (b *LeafLBuilder) GroupBy(nodes ...query.Node) *LeafLBuilder

GroupBy controls how results are grouped when using aggregate functions with Calculation.

func (*LeafLBuilder) Having

func (b *LeafLBuilder) Having(node query.Node) *LeafLBuilder

Having does additional filtering on the results of the query after the query is performed.

func (*LeafLBuilder) Limit

func (b *LeafLBuilder) Limit(maxRowCount int, offset int) *LeafLBuilder

Limit will return a subset of the data, limited to the offset and number of rows specified. For large data sets and specific types of queries, this can be slow, because it will perform the entire query before computing the limit. You cannot limit a query that has embedded arrays.

func (*LeafLBuilder) Load

func (b *LeafLBuilder) Load() (leafLs []*LeafL, err error)

Load terminates the query builder, performs the query, and returns a slice of LeafL objects. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*LeafLBuilder) LoadCursor

func (b *LeafLBuilder) LoadCursor() (leafLsCursor, error)

LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.

A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.

Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use

defer cursor.Close()

to make sure the cursor gets closed.

func (*LeafLBuilder) LoadI

func (b *LeafLBuilder) LoadI() (leafLs []query.OrmObj, err error)

LoadI terminates the query builder, performs the query, and returns a slice of interfaces. This can then satisfy a variety of interfaces that load arrays of objects, including KeyLabeler. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*LeafLBuilder) OrderBy

func (b *LeafLBuilder) OrderBy(nodes ...query.Sorter) *LeafLBuilder

OrderBy specifies how the resulting data should be sorted. By default, the given nodes are sorted in ascending order. Add Descending() to the node to specify that it should be sorted in descending order.

func (*LeafLBuilder) Select

func (b *LeafLBuilder) Select(nodes ...query.Node) *LeafLBuilder

Select specifies what specific columns will be loaded with data. By default, all the columns of the leaf_l table will be queried and loaded. If nodes contains columns from the leaf_l table, that will limit the columns queried and loaded to only those columns. If related tables are specified, then all the columns from those tables are queried, selected and joined to the result. If columns in related tables are specified, then only those columns will be queried and loaded. Depending on the query, additional columns may automatically be added to the query. In particular, primary key columns will be added in most situations. The exception to this would be in distinct queries, group by queries, or subqueries.

func (*LeafLBuilder) Where

func (b *LeafLBuilder) Where(c query.Node) *LeafLBuilder

Where adds a condition to filter what gets selected. Calling Where multiple times will AND the conditions together.

type LeafN

type LeafN struct {
	// contains filtered or unexported fields
}

LeafN represents an item in the leaf_n table in the database.

func LoadLeafN

func LoadLeafN(ctx context.Context, pk query.AutoPrimaryKey, selectNodes ...query.Node) (*LeafN, error)

LoadLeafN returns a LeafN from the database. selectNodes lets you provide nodes for selecting specific fields or additional fields from related tables. See [LeafNsBuilder.Select] for more info.

func LoadLeafNsByRootNID

func LoadLeafNsByRootNID(ctx context.Context, rootNID interface{}, selectNodes ...query.Node) ([]*LeafN, error)

LoadLeafNsByRootNID queries LeafN objects by the given index values. selectNodes optionally let you provide nodes for joining to other tables or selecting specific fields. See [LeafNsBuilder.Select]. If you need a more elaborate query, use QueryLeafNs() to start a query builder.

func NewLeafN

func NewLeafN() *LeafN

NewLeafN creates a new LeafN object and initializes it to default values.

func (*LeafN) Copy

func (o *LeafN) Copy() (newObject *LeafN)

Copy copies most fields to a new LeafN object. Forward reference ids will be copied, but reverse and many-many references will not. Attached objects will not be included in the copy. Automatically generated fields will not be included in the copy. The primary key field will not be copied, since it is normally auto-generated. Call Save() on the new object to save it into the database. Copy might panic if any fields in the database were set to a size larger than the maximum size through a process that accessed the database outside of the ORM.

func (*LeafN) Delete

func (o *LeafN) Delete(ctx context.Context) (err error)

Delete deletes the record from the database.

func (*LeafN) Get

func (o *LeafN) Get(key string) interface{}

Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil. Get can be used to retrieve a value by using the Field() of a node.

func (*LeafN) GetAlias

func (o *LeafN) GetAlias(aliasKey string) query.AliasValue

GetAlias returns the value for the Alias node aliasKey that was returned in the most recent query.

func (*LeafN) ID

func (o *LeafN) ID() query.AutoPrimaryKey

ID returns the loaded value of the id field in the database.

func (*LeafN) IDIsLoaded

func (o *LeafN) IDIsLoaded() bool

IDIsLoaded returns true if the value was loaded from the database or has been set.

func (*LeafN) Initialize

func (o *LeafN) Initialize()

Initialize will initialize or re-initialize a LeafN database object to default values.

func (*LeafN) IsDirty

func (o *LeafN) IsDirty() (dirty bool)

IsDirty returns true if the object has been changed since it was read from the database or created.

func (*LeafN) IsNew

func (o *LeafN) IsNew() bool

IsNew returns true if the object will create a new record when saved.

func (*LeafN) Key

func (o *LeafN) Key() string

Key returns a unique key for the object, among a list of similar objects.

func (*LeafN) Label

func (o *LeafN) Label() string

Label returns a human-readable label of the object. This would be what a user would see as a description of the object if choosing from a list.

func (*LeafN) LoadRootN

func (o *LeafN) LoadRootN(ctx context.Context) (*RootN, error)

LoadRootN returns the related RootN. If it is not already loaded, it will attempt to load it, provided the RootNID column has been loaded first.

func (*LeafN) MarshalBinary

func (o *LeafN) MarshalBinary() ([]byte, error)

MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.

func (*LeafN) MarshalJSON

func (o *LeafN) MarshalJSON() (data []byte, err error)

MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.

func (*LeafN) MarshalStringMap

func (o *LeafN) MarshalStringMap() map[string]interface{}

MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.

func (*LeafN) Name

func (o *LeafN) Name() string

Name returns the value of the loaded name field in the database.

func (*LeafN) NameIsLoaded

func (o *LeafN) NameIsLoaded() bool

NameIsLoaded returns true if the value was loaded from the database or has been set.

func (*LeafN) OriginalPrimaryKey

func (o *LeafN) OriginalPrimaryKey() query.AutoPrimaryKey

OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.

func (*LeafN) PrimaryKey

func (o *LeafN) PrimaryKey() query.AutoPrimaryKey

PrimaryKey returns the value of the primary key of the record.

func (*LeafN) RootN

func (o *LeafN) RootN() *RootN

RootN returns the current value of the loaded RootN, and nil if its not loaded.

func (*LeafN) RootNID

func (o *LeafN) RootNID() query.AutoPrimaryKey

RootNID returns the value of the loaded root_n_id field in the database.

func (*LeafN) RootNIDIsLoaded

func (o *LeafN) RootNIDIsLoaded() bool

RootNIDIsLoaded returns true if the value was loaded from the database or has been set.

func (*LeafN) RootNIDIsNull

func (o *LeafN) RootNIDIsNull() bool

RootNIDIsNull returns true if the related database value is null.

func (*LeafN) Save

func (o *LeafN) Save(ctx context.Context) error

Save will update or insert the object, depending on the state of the object.

If it has an auto-generated primary key, it will be updated after an insert. Database errors generally will be handled by a panic and not returned here, since those indicate a problem with a database driver or configuration.

Save will return a db.OptimisticLockError if it detects a collision when two users are attempting to change the same database record.

It will return a db.UniqueValueError if it detects a collision when an attempt is made to add a record with a unique column that is given a value that is already in the database.

Updating a record that has not changed will have no effect on the database. Updating a record that has linked records will also update any linked records that are MODIFIED, and if optimistic locking is in effect, will also check whether those records have been altered or deleted, returning an OptimisticLockError if so.

func (*LeafN) SetID

func (o *LeafN) SetID(v query.AutoPrimaryKey)

SetID sets the value of ID in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the ID value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*LeafN) SetName

func (o *LeafN) SetName(v string)

SetName sets the value of Name in the object, to be saved later in the database using the Save() function.

func (*LeafN) SetPrimaryKey

func (o *LeafN) SetPrimaryKey(v query.AutoPrimaryKey)

SetPrimaryKey sets the value of the primary key in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the primary key value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*LeafN) SetRootN

func (o *LeafN) SetRootN(rootN *RootN)

SetRootN will set the reference to rootN. The referenced object will be saved when LeafN is saved. Pass nil to break the connection.

func (*LeafN) SetRootNID

func (o *LeafN) SetRootNID(v query.AutoPrimaryKey)

SetRootNID sets the value of RootNID in the object, to be saved later in the database using the Save() function.

func (*LeafN) SetRootNIDToNull

func (o *LeafN) SetRootNIDToNull()

SetRootNIDToNull() will set the root_n_id value in the database to NULL. RootNID() will return the column's default value after this. Will also set the attached o.RootN to nil.

func (*LeafN) String

func (o *LeafN) String() string

String implements the Stringer interface and returns a description of the record, primarily for debugging.

func (*LeafN) UnmarshalBinary

func (o *LeafN) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary converts a structure that was created with MarshalBinary into a LeafN object.

func (*LeafN) UnmarshalJSON

func (o *LeafN) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON unmarshalls the given json data into the LeafN. The LeafN can be a newly created object, or one loaded from the database.

After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.

Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.

The fields it expects are:

"id" - query.AutoPrimaryKey
"name" - string

func (*LeafN) UnmarshalStringMap

func (o *LeafN) UnmarshalStringMap(m map[string]interface{}) (err error)

UnmarshalStringMap will load the values from the stringmap into the object.

Override this in LeafN to modify the json before sending it here.

type LeafNBuilder

type LeafNBuilder struct {
	// contains filtered or unexported fields
}

The LeafNBuilder uses a builder pattern to create a query on the database. Create a LeafNBuilder by calling QueryLeafNs, which will select all the LeafN object in the database. Then filter and arrange those objects by calling Where, Select, etc. End a query by calling either Load, LoadI, LoadCursor, Get, or Count. A LeafNBuilder stores the context it will use to perform the query, and thus is meant to be a short-lived object. You should not save it for later use.

func QueryLeafNs

func QueryLeafNs(ctx context.Context) *LeafNBuilder

QueryLeafNs returns a new query builder. See LeafNBuilder for doc on how to use the builder. You should pass a context that has a timeout with it to protect against a long delay from the database possibly hanging your application. You can set a ReadTimeout value on the schema to do this by default during code generation.

func (*LeafNBuilder) Calculation

func (b *LeafNBuilder) Calculation(base query.TableNodeI, alias string, operation query.OperationNodeI) *LeafNBuilder

Calculation adds operation as an aliased value onto base. After the query, you can read the data by passing alias to GetAlias on the returned object.

func (*LeafNBuilder) Count

func (b *LeafNBuilder) Count() (int, error)

Count terminates a query and returns just the number of items in the result. If you have Select or Calculation columns in the query, it will count NULL results as well. To not count NULL values, use Where in the builder with a NotNull operation. To count distinct combinations of items, call Distinct() on the builder.

func (*LeafNBuilder) Distinct

func (b *LeafNBuilder) Distinct() *LeafNBuilder

Distinct removes duplicates from the results of the query. Adding a Select() is usually required.

func (*LeafNBuilder) Get

func (b *LeafNBuilder) Get() (*LeafN, error)

Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items. If an error occurs, or no results are found, a nil is returned.

func (*LeafNBuilder) GroupBy

func (b *LeafNBuilder) GroupBy(nodes ...query.Node) *LeafNBuilder

GroupBy controls how results are grouped when using aggregate functions with Calculation.

func (*LeafNBuilder) Having

func (b *LeafNBuilder) Having(node query.Node) *LeafNBuilder

Having does additional filtering on the results of the query after the query is performed.

func (*LeafNBuilder) Limit

func (b *LeafNBuilder) Limit(maxRowCount int, offset int) *LeafNBuilder

Limit will return a subset of the data, limited to the offset and number of rows specified. For large data sets and specific types of queries, this can be slow, because it will perform the entire query before computing the limit. You cannot limit a query that has embedded arrays.

func (*LeafNBuilder) Load

func (b *LeafNBuilder) Load() (leafNs []*LeafN, err error)

Load terminates the query builder, performs the query, and returns a slice of LeafN objects. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*LeafNBuilder) LoadCursor

func (b *LeafNBuilder) LoadCursor() (leafNsCursor, error)

LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.

A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.

Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use

defer cursor.Close()

to make sure the cursor gets closed.

func (*LeafNBuilder) LoadI

func (b *LeafNBuilder) LoadI() (leafNs []query.OrmObj, err error)

LoadI terminates the query builder, performs the query, and returns a slice of interfaces. This can then satisfy a variety of interfaces that load arrays of objects, including KeyLabeler. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*LeafNBuilder) OrderBy

func (b *LeafNBuilder) OrderBy(nodes ...query.Sorter) *LeafNBuilder

OrderBy specifies how the resulting data should be sorted. By default, the given nodes are sorted in ascending order. Add Descending() to the node to specify that it should be sorted in descending order.

func (*LeafNBuilder) Select

func (b *LeafNBuilder) Select(nodes ...query.Node) *LeafNBuilder

Select specifies what specific columns will be loaded with data. By default, all the columns of the leaf_n table will be queried and loaded. If nodes contains columns from the leaf_n table, that will limit the columns queried and loaded to only those columns. If related tables are specified, then all the columns from those tables are queried, selected and joined to the result. If columns in related tables are specified, then only those columns will be queried and loaded. Depending on the query, additional columns may automatically be added to the query. In particular, primary key columns will be added in most situations. The exception to this would be in distinct queries, group by queries, or subqueries.

func (*LeafNBuilder) Where

func (b *LeafNBuilder) Where(c query.Node) *LeafNBuilder

Where adds a condition to filter what gets selected. Calling Where multiple times will AND the conditions together.

type LeafNl

type LeafNl struct {
	// contains filtered or unexported fields
}

LeafNl represents an item in the leaf_nl table in the database.

func LoadLeafNl

func LoadLeafNl(ctx context.Context, pk query.AutoPrimaryKey, selectNodes ...query.Node) (*LeafNl, error)

LoadLeafNl returns a LeafNl from the database. selectNodes lets you provide nodes for selecting specific fields or additional fields from related tables. See [LeafNlsBuilder.Select] for more info.

func LoadLeafNlsByRootNlID

func LoadLeafNlsByRootNlID(ctx context.Context, rootNlID interface{}, selectNodes ...query.Node) ([]*LeafNl, error)

LoadLeafNlsByRootNlID queries LeafNl objects by the given index values. selectNodes optionally let you provide nodes for joining to other tables or selecting specific fields. See [LeafNlsBuilder.Select]. If you need a more elaborate query, use QueryLeafNls() to start a query builder.

func NewLeafNl

func NewLeafNl() *LeafNl

NewLeafNl creates a new LeafNl object and initializes it to default values.

func (*LeafNl) Copy

func (o *LeafNl) Copy() (newObject *LeafNl)

Copy copies most fields to a new LeafNl object. Forward reference ids will be copied, but reverse and many-many references will not. Attached objects will not be included in the copy. Automatically generated fields will not be included in the copy. The primary key field will not be copied, since it is normally auto-generated. Call Save() on the new object to save it into the database. Copy might panic if any fields in the database were set to a size larger than the maximum size through a process that accessed the database outside of the ORM.

func (*LeafNl) CountLeaf1s

func (o *LeafNl) CountLeaf1s(ctx context.Context) (int, error)

CountLeaf1s counts the number of associated leaf1s objects in the database. Note that this returns what is reflected by the database at that instant, and not what is the count of the loaded objects.

func (*LeafNl) CountLeaf2s

func (o *LeafNl) CountLeaf2s(ctx context.Context) (int, error)

CountLeaf2s counts the number of associated leaf2s objects in the database. Note that this returns what is reflected by the database at that instant, and not what is the count of the loaded objects.

func (*LeafNl) Delete

func (o *LeafNl) Delete(ctx context.Context) (err error)

Delete deletes the record from the database.

func (*LeafNl) Get

func (o *LeafNl) Get(key string) interface{}

Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil. Get can be used to retrieve a value by using the Field() of a node.

func (*LeafNl) GetAlias

func (o *LeafNl) GetAlias(aliasKey string) query.AliasValue

GetAlias returns the value for the Alias node aliasKey that was returned in the most recent query.

func (*LeafNl) GroLock

func (o *LeafNl) GroLock() int64

GroLock returns the value of the loaded gro_lock field in the database.

func (*LeafNl) GroLockIsLoaded

func (o *LeafNl) GroLockIsLoaded() bool

GroLockIsLoaded returns true if the value was loaded from the database or has been set.

func (*LeafNl) ID

func (o *LeafNl) ID() query.AutoPrimaryKey

ID returns the loaded value of the id field in the database.

func (*LeafNl) IDIsLoaded

func (o *LeafNl) IDIsLoaded() bool

IDIsLoaded returns true if the value was loaded from the database or has been set.

func (*LeafNl) Initialize

func (o *LeafNl) Initialize()

Initialize will initialize or re-initialize a LeafNl database object to default values.

func (*LeafNl) IsDirty

func (o *LeafNl) IsDirty() (dirty bool)

IsDirty returns true if the object has been changed since it was read from the database or created.

func (*LeafNl) IsNew

func (o *LeafNl) IsNew() bool

IsNew returns true if the object will create a new record when saved.

func (*LeafNl) Key

func (o *LeafNl) Key() string

Key returns a unique key for the object, among a list of similar objects.

func (*LeafNl) Label

func (o *LeafNl) Label() string

Label returns a human-readable label of the object. This would be what a user would see as a description of the object if choosing from a list.

func (*LeafNl) Leaf1

func (o *LeafNl) Leaf1(pk query.AutoPrimaryKey) *LeafNl

Leaf1 returns a single LeafNl object by primary key pk, if one was loaded. Otherwise, it will return nil.

func (*LeafNl) Leaf1s

func (o *LeafNl) Leaf1s() []*LeafNl

Leaf1s returns a slice of LeafNl objects if loaded. If not loaded, will return nil. The values will be ordered by the latest query or in the order they were assigned.

func (*LeafNl) Leaf2

func (o *LeafNl) Leaf2(pk query.AutoPrimaryKey) *LeafNl

Leaf2 returns a single LeafNl object by primary key pk, if one was loaded. Otherwise, it will return nil.

func (*LeafNl) Leaf2s

func (o *LeafNl) Leaf2s() []*LeafNl

Leaf2s returns a slice of LeafNl objects if loaded. If not loaded, will return nil. The values will be ordered by the latest query or in the order they were assigned.

func (*LeafNl) LoadLeaf1s

func (o *LeafNl) LoadLeaf1s(ctx context.Context) ([]*LeafNl, error)

LoadLeaf1s loads the LeafNl objects associated through the Leaf1-Leaf2 relationship.

func (*LeafNl) LoadLeaf2s

func (o *LeafNl) LoadLeaf2s(ctx context.Context) ([]*LeafNl, error)

LoadLeaf2s loads the LeafNl objects associated through the Leaf2-Leaf1 relationship.

func (*LeafNl) LoadRootNl

func (o *LeafNl) LoadRootNl(ctx context.Context) (*RootNl, error)

LoadRootNl returns the related RootNl. If it is not already loaded, it will attempt to load it, provided the RootNlID column has been loaded first.

func (*LeafNl) MarshalBinary

func (o *LeafNl) MarshalBinary() ([]byte, error)

MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.

func (*LeafNl) MarshalJSON

func (o *LeafNl) MarshalJSON() (data []byte, err error)

MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.

func (*LeafNl) MarshalStringMap

func (o *LeafNl) MarshalStringMap() map[string]interface{}

MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.

func (*LeafNl) Name

func (o *LeafNl) Name() string

Name returns the value of the loaded name field in the database.

func (*LeafNl) NameIsLoaded

func (o *LeafNl) NameIsLoaded() bool

NameIsLoaded returns true if the value was loaded from the database or has been set.

func (*LeafNl) OriginalPrimaryKey

func (o *LeafNl) OriginalPrimaryKey() query.AutoPrimaryKey

OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.

func (*LeafNl) PrimaryKey

func (o *LeafNl) PrimaryKey() query.AutoPrimaryKey

PrimaryKey returns the value of the primary key of the record.

func (*LeafNl) RootNl

func (o *LeafNl) RootNl() *RootNl

RootNl returns the current value of the loaded RootNl, and nil if its not loaded.

func (*LeafNl) RootNlID

func (o *LeafNl) RootNlID() query.AutoPrimaryKey

RootNlID returns the value of the loaded root_nl_id field in the database.

func (*LeafNl) RootNlIDIsLoaded

func (o *LeafNl) RootNlIDIsLoaded() bool

RootNlIDIsLoaded returns true if the value was loaded from the database or has been set.

func (*LeafNl) RootNlIDIsNull

func (o *LeafNl) RootNlIDIsNull() bool

RootNlIDIsNull returns true if the related database value is null.

func (*LeafNl) Save

func (o *LeafNl) Save(ctx context.Context) error

Save will update or insert the object, depending on the state of the object.

If it has an auto-generated primary key, it will be updated after an insert. Database errors generally will be handled by a panic and not returned here, since those indicate a problem with a database driver or configuration.

Save will return a db.OptimisticLockError if it detects a collision when two users are attempting to change the same database record.

It will return a db.UniqueValueError if it detects a collision when an attempt is made to add a record with a unique column that is given a value that is already in the database.

Updating a record that has not changed will have no effect on the database. Updating a record that has linked records will also update any linked records that are MODIFIED, and if optimistic locking is in effect, will also check whether those records have been altered or deleted, returning an OptimisticLockError if so.

func (*LeafNl) SetID

func (o *LeafNl) SetID(v query.AutoPrimaryKey)

SetID sets the value of ID in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the ID value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*LeafNl) SetLeaf1s

func (o *LeafNl) SetLeaf1s(objs ...*LeafNl)

SetLeaf1s sets the associated objects to the given slice of LeafNl objects in preparation for saving. The associations will not be updated until Save() is called. Objects that are modified or are new will be saved before completing the association.

func (*LeafNl) SetLeaf1sByID

func (o *LeafNl) SetLeaf1sByID(ids ...query.AutoPrimaryKey)

SetLeaf1sByID prepares to associate LeafNl objects by the primary keys in ids. If objects are currently loaded, they will be unloaded. The association does not take place until Save() is called. Calling Load before calling Save will load the items that will be associated in the database after the Save call. After calling Save, the objects will be unloaded, and you must call Load again if you want them loaded.

func (*LeafNl) SetLeaf2s

func (o *LeafNl) SetLeaf2s(objs ...*LeafNl)

SetLeaf2s sets the associated objects to the given slice of LeafNl objects in preparation for saving. The associations will not be updated until Save() is called. Objects that are modified or are new will be saved before completing the association.

func (*LeafNl) SetLeaf2sByID

func (o *LeafNl) SetLeaf2sByID(ids ...query.AutoPrimaryKey)

SetLeaf2sByID prepares to associate LeafNl objects by the primary keys in ids. If objects are currently loaded, they will be unloaded. The association does not take place until Save() is called. Calling Load before calling Save will load the items that will be associated in the database after the Save call. After calling Save, the objects will be unloaded, and you must call Load again if you want them loaded.

func (*LeafNl) SetName

func (o *LeafNl) SetName(v string)

SetName sets the value of Name in the object, to be saved later in the database using the Save() function.

func (*LeafNl) SetPrimaryKey

func (o *LeafNl) SetPrimaryKey(v query.AutoPrimaryKey)

SetPrimaryKey sets the value of the primary key in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the primary key value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*LeafNl) SetRootNl

func (o *LeafNl) SetRootNl(rootNl *RootNl)

SetRootNl will set the reference to rootNl. The referenced object will be saved when LeafNl is saved. Pass nil to break the connection.

func (*LeafNl) SetRootNlID

func (o *LeafNl) SetRootNlID(v query.AutoPrimaryKey)

SetRootNlID sets the value of RootNlID in the object, to be saved later in the database using the Save() function.

func (*LeafNl) SetRootNlIDToNull

func (o *LeafNl) SetRootNlIDToNull()

SetRootNlIDToNull() will set the root_nl_id value in the database to NULL. RootNlID() will return the column's default value after this. Will also set the attached o.RootNl to nil.

func (*LeafNl) String

func (o *LeafNl) String() string

String implements the Stringer interface and returns a description of the record, primarily for debugging.

func (*LeafNl) UnmarshalBinary

func (o *LeafNl) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary converts a structure that was created with MarshalBinary into a LeafNl object.

func (*LeafNl) UnmarshalJSON

func (o *LeafNl) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON unmarshalls the given json data into the LeafNl. The LeafNl can be a newly created object, or one loaded from the database.

After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.

Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.

The fields it expects are:

"id" - query.AutoPrimaryKey
"name" - string
"groLock" - int64

func (*LeafNl) UnmarshalStringMap

func (o *LeafNl) UnmarshalStringMap(m map[string]interface{}) (err error)

UnmarshalStringMap will load the values from the stringmap into the object.

Override this in LeafNl to modify the json before sending it here.

type LeafNlBuilder

type LeafNlBuilder struct {
	// contains filtered or unexported fields
}

The LeafNlBuilder uses a builder pattern to create a query on the database. Create a LeafNlBuilder by calling QueryLeafNls, which will select all the LeafNl object in the database. Then filter and arrange those objects by calling Where, Select, etc. End a query by calling either Load, LoadI, LoadCursor, Get, or Count. A LeafNlBuilder stores the context it will use to perform the query, and thus is meant to be a short-lived object. You should not save it for later use.

func QueryLeafNls

func QueryLeafNls(ctx context.Context) *LeafNlBuilder

QueryLeafNls returns a new query builder. See LeafNlBuilder for doc on how to use the builder. You should pass a context that has a timeout with it to protect against a long delay from the database possibly hanging your application. You can set a ReadTimeout value on the schema to do this by default during code generation.

func (*LeafNlBuilder) Calculation

func (b *LeafNlBuilder) Calculation(base query.TableNodeI, alias string, operation query.OperationNodeI) *LeafNlBuilder

Calculation adds operation as an aliased value onto base. After the query, you can read the data by passing alias to GetAlias on the returned object.

func (*LeafNlBuilder) Count

func (b *LeafNlBuilder) Count() (int, error)

Count terminates a query and returns just the number of items in the result. If you have Select or Calculation columns in the query, it will count NULL results as well. To not count NULL values, use Where in the builder with a NotNull operation. To count distinct combinations of items, call Distinct() on the builder.

func (*LeafNlBuilder) Distinct

func (b *LeafNlBuilder) Distinct() *LeafNlBuilder

Distinct removes duplicates from the results of the query. Adding a Select() is usually required.

func (*LeafNlBuilder) Get

func (b *LeafNlBuilder) Get() (*LeafNl, error)

Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items. If an error occurs, or no results are found, a nil is returned.

func (*LeafNlBuilder) GroupBy

func (b *LeafNlBuilder) GroupBy(nodes ...query.Node) *LeafNlBuilder

GroupBy controls how results are grouped when using aggregate functions with Calculation.

func (*LeafNlBuilder) Having

func (b *LeafNlBuilder) Having(node query.Node) *LeafNlBuilder

Having does additional filtering on the results of the query after the query is performed.

func (*LeafNlBuilder) Limit

func (b *LeafNlBuilder) Limit(maxRowCount int, offset int) *LeafNlBuilder

Limit will return a subset of the data, limited to the offset and number of rows specified. For large data sets and specific types of queries, this can be slow, because it will perform the entire query before computing the limit. You cannot limit a query that has embedded arrays.

func (*LeafNlBuilder) Load

func (b *LeafNlBuilder) Load() (leafNls []*LeafNl, err error)

Load terminates the query builder, performs the query, and returns a slice of LeafNl objects. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*LeafNlBuilder) LoadCursor

func (b *LeafNlBuilder) LoadCursor() (leafNlsCursor, error)

LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.

A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.

Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use

defer cursor.Close()

to make sure the cursor gets closed.

func (*LeafNlBuilder) LoadI

func (b *LeafNlBuilder) LoadI() (leafNls []query.OrmObj, err error)

LoadI terminates the query builder, performs the query, and returns a slice of interfaces. This can then satisfy a variety of interfaces that load arrays of objects, including KeyLabeler. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*LeafNlBuilder) OrderBy

func (b *LeafNlBuilder) OrderBy(nodes ...query.Sorter) *LeafNlBuilder

OrderBy specifies how the resulting data should be sorted. By default, the given nodes are sorted in ascending order. Add Descending() to the node to specify that it should be sorted in descending order.

func (*LeafNlBuilder) Select

func (b *LeafNlBuilder) Select(nodes ...query.Node) *LeafNlBuilder

Select specifies what specific columns will be loaded with data. By default, all the columns of the leaf_nl table will be queried and loaded. If nodes contains columns from the leaf_nl table, that will limit the columns queried and loaded to only those columns. If related tables are specified, then all the columns from those tables are queried, selected and joined to the result. If columns in related tables are specified, then only those columns will be queried and loaded. Depending on the query, additional columns may automatically be added to the query. In particular, primary key columns will be added in most situations. The exception to this would be in distinct queries, group by queries, or subqueries.

func (*LeafNlBuilder) Where

func (b *LeafNlBuilder) Where(c query.Node) *LeafNlBuilder

Where adds a condition to filter what gets selected. Calling Where multiple times will AND the conditions together.

type LeafU

type LeafU struct {
	// contains filtered or unexported fields
}

LeafU represents an item in the leaf_u table in the database.

func LoadLeafU

func LoadLeafU(ctx context.Context, pk query.AutoPrimaryKey, selectNodes ...query.Node) (*LeafU, error)

LoadLeafU returns a LeafU from the database. selectNodes lets you provide nodes for selecting specific fields or additional fields from related tables. See [LeafUsBuilder.Select] for more info.

func LoadLeafUByRootUID

func LoadLeafUByRootUID(ctx context.Context, rootUID query.AutoPrimaryKey, selectNodes ...query.Node) (*LeafU, error)

LoadLeafUByRootUID queries for a single LeafU object by the given unique index values. selectNodes optionally let you provide nodes for joining to other tables or selecting specific fields. See [LeafUsBuilder.Select]. If you need a more elaborate query, use QueryLeafUs() to start a query builder.

func NewLeafU

func NewLeafU() *LeafU

NewLeafU creates a new LeafU object and initializes it to default values.

func (*LeafU) Copy

func (o *LeafU) Copy() (newObject *LeafU)

Copy copies most fields to a new LeafU object. Forward reference ids will be copied, but reverse and many-many references will not. Attached objects will not be included in the copy. Automatically generated fields will not be included in the copy. The primary key field will not be copied, since it is normally auto-generated. Call Save() on the new object to save it into the database. Copy might panic if any fields in the database were set to a size larger than the maximum size through a process that accessed the database outside of the ORM.

func (*LeafU) Delete

func (o *LeafU) Delete(ctx context.Context) (err error)

Delete deletes the record from the database.

func (*LeafU) Get

func (o *LeafU) Get(key string) interface{}

Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil. Get can be used to retrieve a value by using the Field() of a node.

func (*LeafU) GetAlias

func (o *LeafU) GetAlias(aliasKey string) query.AliasValue

GetAlias returns the value for the Alias node aliasKey that was returned in the most recent query.

func (*LeafU) ID

func (o *LeafU) ID() query.AutoPrimaryKey

ID returns the loaded value of the id field in the database.

func (*LeafU) IDIsLoaded

func (o *LeafU) IDIsLoaded() bool

IDIsLoaded returns true if the value was loaded from the database or has been set.

func (*LeafU) Initialize

func (o *LeafU) Initialize()

Initialize will initialize or re-initialize a LeafU database object to default values.

func (*LeafU) IsDirty

func (o *LeafU) IsDirty() (dirty bool)

IsDirty returns true if the object has been changed since it was read from the database or created.

func (*LeafU) IsNew

func (o *LeafU) IsNew() bool

IsNew returns true if the object will create a new record when saved.

func (*LeafU) Key

func (o *LeafU) Key() string

Key returns a unique key for the object, among a list of similar objects.

func (*LeafU) Label

func (o *LeafU) Label() string

Label returns a human-readable label of the object. This would be what a user would see as a description of the object if choosing from a list.

func (*LeafU) LoadRootU

func (o *LeafU) LoadRootU(ctx context.Context) (*RootU, error)

LoadRootU returns the related RootU. If it is not already loaded, it will attempt to load it, provided the RootUID column has been loaded first.

func (*LeafU) MarshalBinary

func (o *LeafU) MarshalBinary() ([]byte, error)

MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.

func (*LeafU) MarshalJSON

func (o *LeafU) MarshalJSON() (data []byte, err error)

MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.

func (*LeafU) MarshalStringMap

func (o *LeafU) MarshalStringMap() map[string]interface{}

MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.

func (*LeafU) Name

func (o *LeafU) Name() string

Name returns the value of the loaded name field in the database.

func (*LeafU) NameIsLoaded

func (o *LeafU) NameIsLoaded() bool

NameIsLoaded returns true if the value was loaded from the database or has been set.

func (*LeafU) OriginalPrimaryKey

func (o *LeafU) OriginalPrimaryKey() query.AutoPrimaryKey

OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.

func (*LeafU) PrimaryKey

func (o *LeafU) PrimaryKey() query.AutoPrimaryKey

PrimaryKey returns the value of the primary key of the record.

func (*LeafU) RootU

func (o *LeafU) RootU() *RootU

RootU returns the current value of the loaded RootU, and nil if its not loaded.

func (*LeafU) RootUID

func (o *LeafU) RootUID() query.AutoPrimaryKey

RootUID returns the value of the loaded root_u_id field in the database.

func (*LeafU) RootUIDIsLoaded

func (o *LeafU) RootUIDIsLoaded() bool

RootUIDIsLoaded returns true if the value was loaded from the database or has been set.

func (*LeafU) Save

func (o *LeafU) Save(ctx context.Context) error

Save will update or insert the object, depending on the state of the object.

If it has an auto-generated primary key, it will be updated after an insert. Database errors generally will be handled by a panic and not returned here, since those indicate a problem with a database driver or configuration.

Save will return a db.OptimisticLockError if it detects a collision when two users are attempting to change the same database record.

It will return a db.UniqueValueError if it detects a collision when an attempt is made to add a record with a unique column that is given a value that is already in the database.

Updating a record that has not changed will have no effect on the database. Updating a record that has linked records will also update any linked records that are MODIFIED, and if optimistic locking is in effect, will also check whether those records have been altered or deleted, returning an OptimisticLockError if so.

func (*LeafU) SetID

func (o *LeafU) SetID(v query.AutoPrimaryKey)

SetID sets the value of ID in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the ID value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*LeafU) SetName

func (o *LeafU) SetName(v string)

SetName sets the value of Name in the object, to be saved later in the database using the Save() function.

func (*LeafU) SetPrimaryKey

func (o *LeafU) SetPrimaryKey(v query.AutoPrimaryKey)

SetPrimaryKey sets the value of the primary key in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the primary key value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*LeafU) SetRootU

func (o *LeafU) SetRootU(rootU *RootU)

SetRootU sets the value of RootU in the object, to be saved later using the Save() function.

func (*LeafU) SetRootUID

func (o *LeafU) SetRootUID(v query.AutoPrimaryKey)

SetRootUID sets the value of RootUID in the object, to be saved later in the database using the Save() function.

func (*LeafU) String

func (o *LeafU) String() string

String implements the Stringer interface and returns a description of the record, primarily for debugging.

func (*LeafU) UnmarshalBinary

func (o *LeafU) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary converts a structure that was created with MarshalBinary into a LeafU object.

func (*LeafU) UnmarshalJSON

func (o *LeafU) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON unmarshalls the given json data into the LeafU. The LeafU can be a newly created object, or one loaded from the database.

After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.

Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.

The fields it expects are:

"id" - query.AutoPrimaryKey
"name" - string

func (*LeafU) UnmarshalStringMap

func (o *LeafU) UnmarshalStringMap(m map[string]interface{}) (err error)

UnmarshalStringMap will load the values from the stringmap into the object.

Override this in LeafU to modify the json before sending it here.

type LeafUBuilder

type LeafUBuilder struct {
	// contains filtered or unexported fields
}

The LeafUBuilder uses a builder pattern to create a query on the database. Create a LeafUBuilder by calling QueryLeafUs, which will select all the LeafU object in the database. Then filter and arrange those objects by calling Where, Select, etc. End a query by calling either Load, LoadI, LoadCursor, Get, or Count. A LeafUBuilder stores the context it will use to perform the query, and thus is meant to be a short-lived object. You should not save it for later use.

func QueryLeafUs

func QueryLeafUs(ctx context.Context) *LeafUBuilder

QueryLeafUs returns a new query builder. See LeafUBuilder for doc on how to use the builder. You should pass a context that has a timeout with it to protect against a long delay from the database possibly hanging your application. You can set a ReadTimeout value on the schema to do this by default during code generation.

func (*LeafUBuilder) Calculation

func (b *LeafUBuilder) Calculation(base query.TableNodeI, alias string, operation query.OperationNodeI) *LeafUBuilder

Calculation adds operation as an aliased value onto base. After the query, you can read the data by passing alias to GetAlias on the returned object.

func (*LeafUBuilder) Count

func (b *LeafUBuilder) Count() (int, error)

Count terminates a query and returns just the number of items in the result. If you have Select or Calculation columns in the query, it will count NULL results as well. To not count NULL values, use Where in the builder with a NotNull operation. To count distinct combinations of items, call Distinct() on the builder.

func (*LeafUBuilder) Distinct

func (b *LeafUBuilder) Distinct() *LeafUBuilder

Distinct removes duplicates from the results of the query. Adding a Select() is usually required.

func (*LeafUBuilder) Get

func (b *LeafUBuilder) Get() (*LeafU, error)

Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items. If an error occurs, or no results are found, a nil is returned.

func (*LeafUBuilder) GroupBy

func (b *LeafUBuilder) GroupBy(nodes ...query.Node) *LeafUBuilder

GroupBy controls how results are grouped when using aggregate functions with Calculation.

func (*LeafUBuilder) Having

func (b *LeafUBuilder) Having(node query.Node) *LeafUBuilder

Having does additional filtering on the results of the query after the query is performed.

func (*LeafUBuilder) Limit

func (b *LeafUBuilder) Limit(maxRowCount int, offset int) *LeafUBuilder

Limit will return a subset of the data, limited to the offset and number of rows specified. For large data sets and specific types of queries, this can be slow, because it will perform the entire query before computing the limit. You cannot limit a query that has embedded arrays.

func (*LeafUBuilder) Load

func (b *LeafUBuilder) Load() (leafUs []*LeafU, err error)

Load terminates the query builder, performs the query, and returns a slice of LeafU objects. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*LeafUBuilder) LoadCursor

func (b *LeafUBuilder) LoadCursor() (leafUsCursor, error)

LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.

A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.

Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use

defer cursor.Close()

to make sure the cursor gets closed.

func (*LeafUBuilder) LoadI

func (b *LeafUBuilder) LoadI() (leafUs []query.OrmObj, err error)

LoadI terminates the query builder, performs the query, and returns a slice of interfaces. This can then satisfy a variety of interfaces that load arrays of objects, including KeyLabeler. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*LeafUBuilder) OrderBy

func (b *LeafUBuilder) OrderBy(nodes ...query.Sorter) *LeafUBuilder

OrderBy specifies how the resulting data should be sorted. By default, the given nodes are sorted in ascending order. Add Descending() to the node to specify that it should be sorted in descending order.

func (*LeafUBuilder) Select

func (b *LeafUBuilder) Select(nodes ...query.Node) *LeafUBuilder

Select specifies what specific columns will be loaded with data. By default, all the columns of the leaf_u table will be queried and loaded. If nodes contains columns from the leaf_u table, that will limit the columns queried and loaded to only those columns. If related tables are specified, then all the columns from those tables are queried, selected and joined to the result. If columns in related tables are specified, then only those columns will be queried and loaded. Depending on the query, additional columns may automatically be added to the query. In particular, primary key columns will be added in most situations. The exception to this would be in distinct queries, group by queries, or subqueries.

func (*LeafUBuilder) Where

func (b *LeafUBuilder) Where(c query.Node) *LeafUBuilder

Where adds a condition to filter what gets selected. Calling Where multiple times will AND the conditions together.

type LeafUl

type LeafUl struct {
	// contains filtered or unexported fields
}

LeafUl represents an item in the leaf_ul table in the database.

func LoadLeafUl

func LoadLeafUl(ctx context.Context, pk query.AutoPrimaryKey, selectNodes ...query.Node) (*LeafUl, error)

LoadLeafUl returns a LeafUl from the database. selectNodes lets you provide nodes for selecting specific fields or additional fields from related tables. See [LeafUlsBuilder.Select] for more info.

func LoadLeafUlByRootUlID

func LoadLeafUlByRootUlID(ctx context.Context, rootUlID query.AutoPrimaryKey, selectNodes ...query.Node) (*LeafUl, error)

LoadLeafUlByRootUlID queries for a single LeafUl object by the given unique index values. selectNodes optionally let you provide nodes for joining to other tables or selecting specific fields. See [LeafUlsBuilder.Select]. If you need a more elaborate query, use QueryLeafUls() to start a query builder.

func NewLeafUl

func NewLeafUl() *LeafUl

NewLeafUl creates a new LeafUl object and initializes it to default values.

func (*LeafUl) Copy

func (o *LeafUl) Copy() (newObject *LeafUl)

Copy copies most fields to a new LeafUl object. Forward reference ids will be copied, but reverse and many-many references will not. Attached objects will not be included in the copy. Automatically generated fields will not be included in the copy. The primary key field will not be copied, since it is normally auto-generated. Call Save() on the new object to save it into the database. Copy might panic if any fields in the database were set to a size larger than the maximum size through a process that accessed the database outside of the ORM.

func (*LeafUl) Delete

func (o *LeafUl) Delete(ctx context.Context) (err error)

Delete deletes the record from the database.

func (*LeafUl) Get

func (o *LeafUl) Get(key string) interface{}

Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil. Get can be used to retrieve a value by using the Field() of a node.

func (*LeafUl) GetAlias

func (o *LeafUl) GetAlias(aliasKey string) query.AliasValue

GetAlias returns the value for the Alias node aliasKey that was returned in the most recent query.

func (*LeafUl) GroLock

func (o *LeafUl) GroLock() int64

GroLock returns the value of the loaded gro_lock field in the database.

func (*LeafUl) GroLockIsLoaded

func (o *LeafUl) GroLockIsLoaded() bool

GroLockIsLoaded returns true if the value was loaded from the database or has been set.

func (*LeafUl) ID

func (o *LeafUl) ID() query.AutoPrimaryKey

ID returns the loaded value of the id field in the database.

func (*LeafUl) IDIsLoaded

func (o *LeafUl) IDIsLoaded() bool

IDIsLoaded returns true if the value was loaded from the database or has been set.

func (*LeafUl) Initialize

func (o *LeafUl) Initialize()

Initialize will initialize or re-initialize a LeafUl database object to default values.

func (*LeafUl) IsDirty

func (o *LeafUl) IsDirty() (dirty bool)

IsDirty returns true if the object has been changed since it was read from the database or created.

func (*LeafUl) IsNew

func (o *LeafUl) IsNew() bool

IsNew returns true if the object will create a new record when saved.

func (*LeafUl) Key

func (o *LeafUl) Key() string

Key returns a unique key for the object, among a list of similar objects.

func (*LeafUl) Label

func (o *LeafUl) Label() string

Label returns a human-readable label of the object. This would be what a user would see as a description of the object if choosing from a list.

func (*LeafUl) LoadRootUl

func (o *LeafUl) LoadRootUl(ctx context.Context) (*RootUl, error)

LoadRootUl returns the related RootUl. If it is not already loaded, it will attempt to load it, provided the RootUlID column has been loaded first.

func (*LeafUl) MarshalBinary

func (o *LeafUl) MarshalBinary() ([]byte, error)

MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.

func (*LeafUl) MarshalJSON

func (o *LeafUl) MarshalJSON() (data []byte, err error)

MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.

func (*LeafUl) MarshalStringMap

func (o *LeafUl) MarshalStringMap() map[string]interface{}

MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.

func (*LeafUl) Name

func (o *LeafUl) Name() string

Name returns the value of the loaded name field in the database.

func (*LeafUl) NameIsLoaded

func (o *LeafUl) NameIsLoaded() bool

NameIsLoaded returns true if the value was loaded from the database or has been set.

func (*LeafUl) OriginalPrimaryKey

func (o *LeafUl) OriginalPrimaryKey() query.AutoPrimaryKey

OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.

func (*LeafUl) PrimaryKey

func (o *LeafUl) PrimaryKey() query.AutoPrimaryKey

PrimaryKey returns the value of the primary key of the record.

func (*LeafUl) RootUl

func (o *LeafUl) RootUl() *RootUl

RootUl returns the current value of the loaded RootUl, and nil if its not loaded.

func (*LeafUl) RootUlID

func (o *LeafUl) RootUlID() query.AutoPrimaryKey

RootUlID returns the value of the loaded root_ul_id field in the database.

func (*LeafUl) RootUlIDIsLoaded

func (o *LeafUl) RootUlIDIsLoaded() bool

RootUlIDIsLoaded returns true if the value was loaded from the database or has been set.

func (*LeafUl) Save

func (o *LeafUl) Save(ctx context.Context) error

Save will update or insert the object, depending on the state of the object.

If it has an auto-generated primary key, it will be updated after an insert. Database errors generally will be handled by a panic and not returned here, since those indicate a problem with a database driver or configuration.

Save will return a db.OptimisticLockError if it detects a collision when two users are attempting to change the same database record.

It will return a db.UniqueValueError if it detects a collision when an attempt is made to add a record with a unique column that is given a value that is already in the database.

Updating a record that has not changed will have no effect on the database. Updating a record that has linked records will also update any linked records that are MODIFIED, and if optimistic locking is in effect, will also check whether those records have been altered or deleted, returning an OptimisticLockError if so.

func (*LeafUl) SetID

func (o *LeafUl) SetID(v query.AutoPrimaryKey)

SetID sets the value of ID in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the ID value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*LeafUl) SetName

func (o *LeafUl) SetName(v string)

SetName sets the value of Name in the object, to be saved later in the database using the Save() function.

func (*LeafUl) SetPrimaryKey

func (o *LeafUl) SetPrimaryKey(v query.AutoPrimaryKey)

SetPrimaryKey sets the value of the primary key in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the primary key value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*LeafUl) SetRootUl

func (o *LeafUl) SetRootUl(rootUl *RootUl)

SetRootUl sets the value of RootUl in the object, to be saved later using the Save() function.

func (*LeafUl) SetRootUlID

func (o *LeafUl) SetRootUlID(v query.AutoPrimaryKey)

SetRootUlID sets the value of RootUlID in the object, to be saved later in the database using the Save() function.

func (*LeafUl) String

func (o *LeafUl) String() string

String implements the Stringer interface and returns a description of the record, primarily for debugging.

func (*LeafUl) UnmarshalBinary

func (o *LeafUl) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary converts a structure that was created with MarshalBinary into a LeafUl object.

func (*LeafUl) UnmarshalJSON

func (o *LeafUl) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON unmarshalls the given json data into the LeafUl. The LeafUl can be a newly created object, or one loaded from the database.

After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.

Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.

The fields it expects are:

"id" - query.AutoPrimaryKey
"name" - string
"groLock" - int64

func (*LeafUl) UnmarshalStringMap

func (o *LeafUl) UnmarshalStringMap(m map[string]interface{}) (err error)

UnmarshalStringMap will load the values from the stringmap into the object.

Override this in LeafUl to modify the json before sending it here.

type LeafUlBuilder

type LeafUlBuilder struct {
	// contains filtered or unexported fields
}

The LeafUlBuilder uses a builder pattern to create a query on the database. Create a LeafUlBuilder by calling QueryLeafUls, which will select all the LeafUl object in the database. Then filter and arrange those objects by calling Where, Select, etc. End a query by calling either Load, LoadI, LoadCursor, Get, or Count. A LeafUlBuilder stores the context it will use to perform the query, and thus is meant to be a short-lived object. You should not save it for later use.

func QueryLeafUls

func QueryLeafUls(ctx context.Context) *LeafUlBuilder

QueryLeafUls returns a new query builder. See LeafUlBuilder for doc on how to use the builder. You should pass a context that has a timeout with it to protect against a long delay from the database possibly hanging your application. You can set a ReadTimeout value on the schema to do this by default during code generation.

func (*LeafUlBuilder) Calculation

func (b *LeafUlBuilder) Calculation(base query.TableNodeI, alias string, operation query.OperationNodeI) *LeafUlBuilder

Calculation adds operation as an aliased value onto base. After the query, you can read the data by passing alias to GetAlias on the returned object.

func (*LeafUlBuilder) Count

func (b *LeafUlBuilder) Count() (int, error)

Count terminates a query and returns just the number of items in the result. If you have Select or Calculation columns in the query, it will count NULL results as well. To not count NULL values, use Where in the builder with a NotNull operation. To count distinct combinations of items, call Distinct() on the builder.

func (*LeafUlBuilder) Distinct

func (b *LeafUlBuilder) Distinct() *LeafUlBuilder

Distinct removes duplicates from the results of the query. Adding a Select() is usually required.

func (*LeafUlBuilder) Get

func (b *LeafUlBuilder) Get() (*LeafUl, error)

Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items. If an error occurs, or no results are found, a nil is returned.

func (*LeafUlBuilder) GroupBy

func (b *LeafUlBuilder) GroupBy(nodes ...query.Node) *LeafUlBuilder

GroupBy controls how results are grouped when using aggregate functions with Calculation.

func (*LeafUlBuilder) Having

func (b *LeafUlBuilder) Having(node query.Node) *LeafUlBuilder

Having does additional filtering on the results of the query after the query is performed.

func (*LeafUlBuilder) Limit

func (b *LeafUlBuilder) Limit(maxRowCount int, offset int) *LeafUlBuilder

Limit will return a subset of the data, limited to the offset and number of rows specified. For large data sets and specific types of queries, this can be slow, because it will perform the entire query before computing the limit. You cannot limit a query that has embedded arrays.

func (*LeafUlBuilder) Load

func (b *LeafUlBuilder) Load() (leafUls []*LeafUl, err error)

Load terminates the query builder, performs the query, and returns a slice of LeafUl objects. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*LeafUlBuilder) LoadCursor

func (b *LeafUlBuilder) LoadCursor() (leafUlsCursor, error)

LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.

A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.

Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use

defer cursor.Close()

to make sure the cursor gets closed.

func (*LeafUlBuilder) LoadI

func (b *LeafUlBuilder) LoadI() (leafUls []query.OrmObj, err error)

LoadI terminates the query builder, performs the query, and returns a slice of interfaces. This can then satisfy a variety of interfaces that load arrays of objects, including KeyLabeler. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*LeafUlBuilder) OrderBy

func (b *LeafUlBuilder) OrderBy(nodes ...query.Sorter) *LeafUlBuilder

OrderBy specifies how the resulting data should be sorted. By default, the given nodes are sorted in ascending order. Add Descending() to the node to specify that it should be sorted in descending order.

func (*LeafUlBuilder) Select

func (b *LeafUlBuilder) Select(nodes ...query.Node) *LeafUlBuilder

Select specifies what specific columns will be loaded with data. By default, all the columns of the leaf_ul table will be queried and loaded. If nodes contains columns from the leaf_ul table, that will limit the columns queried and loaded to only those columns. If related tables are specified, then all the columns from those tables are queried, selected and joined to the result. If columns in related tables are specified, then only those columns will be queried and loaded. Depending on the query, additional columns may automatically be added to the query. In particular, primary key columns will be added in most situations. The exception to this would be in distinct queries, group by queries, or subqueries.

func (*LeafUlBuilder) Where

func (b *LeafUlBuilder) Where(c query.Node) *LeafUlBuilder

Where adds a condition to filter what gets selected. Calling Where multiple times will AND the conditions together.

type LeafUn

type LeafUn struct {
	// contains filtered or unexported fields
}

LeafUn represents an item in the leaf_un table in the database.

func LoadLeafUn

func LoadLeafUn(ctx context.Context, pk query.AutoPrimaryKey, selectNodes ...query.Node) (*LeafUn, error)

LoadLeafUn returns a LeafUn from the database. selectNodes lets you provide nodes for selecting specific fields or additional fields from related tables. See [LeafUnsBuilder.Select] for more info.

func LoadLeafUnByRootUnID

func LoadLeafUnByRootUnID(ctx context.Context, rootUnID interface{}, selectNodes ...query.Node) (*LeafUn, error)

LoadLeafUnByRootUnID queries for a single LeafUn object by the given unique index values. selectNodes optionally let you provide nodes for joining to other tables or selecting specific fields. See [LeafUnsBuilder.Select]. If you need a more elaborate query, use QueryLeafUns() to start a query builder.

func NewLeafUn

func NewLeafUn() *LeafUn

NewLeafUn creates a new LeafUn object and initializes it to default values.

func (*LeafUn) Copy

func (o *LeafUn) Copy() (newObject *LeafUn)

Copy copies most fields to a new LeafUn object. Forward reference ids will be copied, but reverse and many-many references will not. Attached objects will not be included in the copy. Automatically generated fields will not be included in the copy. The primary key field will not be copied, since it is normally auto-generated. Call Save() on the new object to save it into the database. Copy might panic if any fields in the database were set to a size larger than the maximum size through a process that accessed the database outside of the ORM.

func (*LeafUn) Delete

func (o *LeafUn) Delete(ctx context.Context) (err error)

Delete deletes the record from the database.

func (*LeafUn) Get

func (o *LeafUn) Get(key string) interface{}

Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil. Get can be used to retrieve a value by using the Field() of a node.

func (*LeafUn) GetAlias

func (o *LeafUn) GetAlias(aliasKey string) query.AliasValue

GetAlias returns the value for the Alias node aliasKey that was returned in the most recent query.

func (*LeafUn) ID

func (o *LeafUn) ID() query.AutoPrimaryKey

ID returns the loaded value of the id field in the database.

func (*LeafUn) IDIsLoaded

func (o *LeafUn) IDIsLoaded() bool

IDIsLoaded returns true if the value was loaded from the database or has been set.

func (*LeafUn) Initialize

func (o *LeafUn) Initialize()

Initialize will initialize or re-initialize a LeafUn database object to default values.

func (*LeafUn) IsDirty

func (o *LeafUn) IsDirty() (dirty bool)

IsDirty returns true if the object has been changed since it was read from the database or created.

func (*LeafUn) IsNew

func (o *LeafUn) IsNew() bool

IsNew returns true if the object will create a new record when saved.

func (*LeafUn) Key

func (o *LeafUn) Key() string

Key returns a unique key for the object, among a list of similar objects.

func (*LeafUn) Label

func (o *LeafUn) Label() string

Label returns a human-readable label of the object. This would be what a user would see as a description of the object if choosing from a list.

func (*LeafUn) LoadRootUn

func (o *LeafUn) LoadRootUn(ctx context.Context) (*RootUn, error)

LoadRootUn returns the related RootUn. If it is not already loaded, it will attempt to load it, provided the RootUnID column has been loaded first.

func (*LeafUn) MarshalBinary

func (o *LeafUn) MarshalBinary() ([]byte, error)

MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.

func (*LeafUn) MarshalJSON

func (o *LeafUn) MarshalJSON() (data []byte, err error)

MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.

func (*LeafUn) MarshalStringMap

func (o *LeafUn) MarshalStringMap() map[string]interface{}

MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.

func (*LeafUn) Name

func (o *LeafUn) Name() string

Name returns the value of the loaded name field in the database.

func (*LeafUn) NameIsLoaded

func (o *LeafUn) NameIsLoaded() bool

NameIsLoaded returns true if the value was loaded from the database or has been set.

func (*LeafUn) OriginalPrimaryKey

func (o *LeafUn) OriginalPrimaryKey() query.AutoPrimaryKey

OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.

func (*LeafUn) PrimaryKey

func (o *LeafUn) PrimaryKey() query.AutoPrimaryKey

PrimaryKey returns the value of the primary key of the record.

func (*LeafUn) RootUn

func (o *LeafUn) RootUn() *RootUn

RootUn returns the current value of the loaded RootUn, and nil if its not loaded.

func (*LeafUn) RootUnID

func (o *LeafUn) RootUnID() query.AutoPrimaryKey

RootUnID returns the value of the loaded root_un_id field in the database.

func (*LeafUn) RootUnIDIsLoaded

func (o *LeafUn) RootUnIDIsLoaded() bool

RootUnIDIsLoaded returns true if the value was loaded from the database or has been set.

func (*LeafUn) RootUnIDIsNull

func (o *LeafUn) RootUnIDIsNull() bool

RootUnIDIsNull returns true if the related database value is null.

func (*LeafUn) Save

func (o *LeafUn) Save(ctx context.Context) error

Save will update or insert the object, depending on the state of the object.

If it has an auto-generated primary key, it will be updated after an insert. Database errors generally will be handled by a panic and not returned here, since those indicate a problem with a database driver or configuration.

Save will return a db.OptimisticLockError if it detects a collision when two users are attempting to change the same database record.

It will return a db.UniqueValueError if it detects a collision when an attempt is made to add a record with a unique column that is given a value that is already in the database.

Updating a record that has not changed will have no effect on the database. Updating a record that has linked records will also update any linked records that are MODIFIED, and if optimistic locking is in effect, will also check whether those records have been altered or deleted, returning an OptimisticLockError if so.

func (*LeafUn) SetID

func (o *LeafUn) SetID(v query.AutoPrimaryKey)

SetID sets the value of ID in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the ID value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*LeafUn) SetName

func (o *LeafUn) SetName(v string)

SetName sets the value of Name in the object, to be saved later in the database using the Save() function.

func (*LeafUn) SetPrimaryKey

func (o *LeafUn) SetPrimaryKey(v query.AutoPrimaryKey)

SetPrimaryKey sets the value of the primary key in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the primary key value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*LeafUn) SetRootUn

func (o *LeafUn) SetRootUn(rootUn *RootUn)

SetRootUn will set the reference to rootUn. The referenced object will be saved when LeafUn is saved. Pass nil to break the connection.

func (*LeafUn) SetRootUnID

func (o *LeafUn) SetRootUnID(v query.AutoPrimaryKey)

SetRootUnID sets the value of RootUnID in the object, to be saved later in the database using the Save() function.

func (*LeafUn) SetRootUnIDToNull

func (o *LeafUn) SetRootUnIDToNull()

SetRootUnIDToNull() will set the root_un_id value in the database to NULL. RootUnID() will return the column's default value after this. Will also set the attached o.RootUn to nil.

func (*LeafUn) String

func (o *LeafUn) String() string

String implements the Stringer interface and returns a description of the record, primarily for debugging.

func (*LeafUn) UnmarshalBinary

func (o *LeafUn) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary converts a structure that was created with MarshalBinary into a LeafUn object.

func (*LeafUn) UnmarshalJSON

func (o *LeafUn) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON unmarshalls the given json data into the LeafUn. The LeafUn can be a newly created object, or one loaded from the database.

After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.

Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.

The fields it expects are:

"id" - query.AutoPrimaryKey
"name" - string

func (*LeafUn) UnmarshalStringMap

func (o *LeafUn) UnmarshalStringMap(m map[string]interface{}) (err error)

UnmarshalStringMap will load the values from the stringmap into the object.

Override this in LeafUn to modify the json before sending it here.

type LeafUnBuilder

type LeafUnBuilder struct {
	// contains filtered or unexported fields
}

The LeafUnBuilder uses a builder pattern to create a query on the database. Create a LeafUnBuilder by calling QueryLeafUns, which will select all the LeafUn object in the database. Then filter and arrange those objects by calling Where, Select, etc. End a query by calling either Load, LoadI, LoadCursor, Get, or Count. A LeafUnBuilder stores the context it will use to perform the query, and thus is meant to be a short-lived object. You should not save it for later use.

func QueryLeafUns

func QueryLeafUns(ctx context.Context) *LeafUnBuilder

QueryLeafUns returns a new query builder. See LeafUnBuilder for doc on how to use the builder. You should pass a context that has a timeout with it to protect against a long delay from the database possibly hanging your application. You can set a ReadTimeout value on the schema to do this by default during code generation.

func (*LeafUnBuilder) Calculation

func (b *LeafUnBuilder) Calculation(base query.TableNodeI, alias string, operation query.OperationNodeI) *LeafUnBuilder

Calculation adds operation as an aliased value onto base. After the query, you can read the data by passing alias to GetAlias on the returned object.

func (*LeafUnBuilder) Count

func (b *LeafUnBuilder) Count() (int, error)

Count terminates a query and returns just the number of items in the result. If you have Select or Calculation columns in the query, it will count NULL results as well. To not count NULL values, use Where in the builder with a NotNull operation. To count distinct combinations of items, call Distinct() on the builder.

func (*LeafUnBuilder) Distinct

func (b *LeafUnBuilder) Distinct() *LeafUnBuilder

Distinct removes duplicates from the results of the query. Adding a Select() is usually required.

func (*LeafUnBuilder) Get

func (b *LeafUnBuilder) Get() (*LeafUn, error)

Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items. If an error occurs, or no results are found, a nil is returned.

func (*LeafUnBuilder) GroupBy

func (b *LeafUnBuilder) GroupBy(nodes ...query.Node) *LeafUnBuilder

GroupBy controls how results are grouped when using aggregate functions with Calculation.

func (*LeafUnBuilder) Having

func (b *LeafUnBuilder) Having(node query.Node) *LeafUnBuilder

Having does additional filtering on the results of the query after the query is performed.

func (*LeafUnBuilder) Limit

func (b *LeafUnBuilder) Limit(maxRowCount int, offset int) *LeafUnBuilder

Limit will return a subset of the data, limited to the offset and number of rows specified. For large data sets and specific types of queries, this can be slow, because it will perform the entire query before computing the limit. You cannot limit a query that has embedded arrays.

func (*LeafUnBuilder) Load

func (b *LeafUnBuilder) Load() (leafUns []*LeafUn, err error)

Load terminates the query builder, performs the query, and returns a slice of LeafUn objects. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*LeafUnBuilder) LoadCursor

func (b *LeafUnBuilder) LoadCursor() (leafUnsCursor, error)

LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.

A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.

Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use

defer cursor.Close()

to make sure the cursor gets closed.

func (*LeafUnBuilder) LoadI

func (b *LeafUnBuilder) LoadI() (leafUns []query.OrmObj, err error)

LoadI terminates the query builder, performs the query, and returns a slice of interfaces. This can then satisfy a variety of interfaces that load arrays of objects, including KeyLabeler. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*LeafUnBuilder) OrderBy

func (b *LeafUnBuilder) OrderBy(nodes ...query.Sorter) *LeafUnBuilder

OrderBy specifies how the resulting data should be sorted. By default, the given nodes are sorted in ascending order. Add Descending() to the node to specify that it should be sorted in descending order.

func (*LeafUnBuilder) Select

func (b *LeafUnBuilder) Select(nodes ...query.Node) *LeafUnBuilder

Select specifies what specific columns will be loaded with data. By default, all the columns of the leaf_un table will be queried and loaded. If nodes contains columns from the leaf_un table, that will limit the columns queried and loaded to only those columns. If related tables are specified, then all the columns from those tables are queried, selected and joined to the result. If columns in related tables are specified, then only those columns will be queried and loaded. Depending on the query, additional columns may automatically be added to the query. In particular, primary key columns will be added in most situations. The exception to this would be in distinct queries, group by queries, or subqueries.

func (*LeafUnBuilder) Where

func (b *LeafUnBuilder) Where(c query.Node) *LeafUnBuilder

Where adds a condition to filter what gets selected. Calling Where multiple times will AND the conditions together.

type LeafUnl

type LeafUnl struct {
	// contains filtered or unexported fields
}

LeafUnl represents an item in the leaf_unl table in the database.

func LoadLeafUnl

func LoadLeafUnl(ctx context.Context, pk query.AutoPrimaryKey, selectNodes ...query.Node) (*LeafUnl, error)

LoadLeafUnl returns a LeafUnl from the database. selectNodes lets you provide nodes for selecting specific fields or additional fields from related tables. See [LeafUnlsBuilder.Select] for more info.

func LoadLeafUnlByRootUnlID

func LoadLeafUnlByRootUnlID(ctx context.Context, rootUnlID interface{}, selectNodes ...query.Node) (*LeafUnl, error)

LoadLeafUnlByRootUnlID queries for a single LeafUnl object by the given unique index values. selectNodes optionally let you provide nodes for joining to other tables or selecting specific fields. See [LeafUnlsBuilder.Select]. If you need a more elaborate query, use QueryLeafUnls() to start a query builder.

func NewLeafUnl

func NewLeafUnl() *LeafUnl

NewLeafUnl creates a new LeafUnl object and initializes it to default values.

func (*LeafUnl) Copy

func (o *LeafUnl) Copy() (newObject *LeafUnl)

Copy copies most fields to a new LeafUnl object. Forward reference ids will be copied, but reverse and many-many references will not. Attached objects will not be included in the copy. Automatically generated fields will not be included in the copy. The primary key field will not be copied, since it is normally auto-generated. Call Save() on the new object to save it into the database. Copy might panic if any fields in the database were set to a size larger than the maximum size through a process that accessed the database outside of the ORM.

func (*LeafUnl) Delete

func (o *LeafUnl) Delete(ctx context.Context) (err error)

Delete deletes the record from the database.

func (*LeafUnl) Get

func (o *LeafUnl) Get(key string) interface{}

Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil. Get can be used to retrieve a value by using the Field() of a node.

func (*LeafUnl) GetAlias

func (o *LeafUnl) GetAlias(aliasKey string) query.AliasValue

GetAlias returns the value for the Alias node aliasKey that was returned in the most recent query.

func (*LeafUnl) GroLock

func (o *LeafUnl) GroLock() int64

GroLock returns the value of the loaded gro_lock field in the database.

func (*LeafUnl) GroLockIsLoaded

func (o *LeafUnl) GroLockIsLoaded() bool

GroLockIsLoaded returns true if the value was loaded from the database or has been set.

func (*LeafUnl) ID

func (o *LeafUnl) ID() query.AutoPrimaryKey

ID returns the loaded value of the id field in the database.

func (*LeafUnl) IDIsLoaded

func (o *LeafUnl) IDIsLoaded() bool

IDIsLoaded returns true if the value was loaded from the database or has been set.

func (*LeafUnl) Initialize

func (o *LeafUnl) Initialize()

Initialize will initialize or re-initialize a LeafUnl database object to default values.

func (*LeafUnl) IsDirty

func (o *LeafUnl) IsDirty() (dirty bool)

IsDirty returns true if the object has been changed since it was read from the database or created.

func (*LeafUnl) IsNew

func (o *LeafUnl) IsNew() bool

IsNew returns true if the object will create a new record when saved.

func (*LeafUnl) Key

func (o *LeafUnl) Key() string

Key returns a unique key for the object, among a list of similar objects.

func (*LeafUnl) Label

func (o *LeafUnl) Label() string

Label returns a human-readable label of the object. This would be what a user would see as a description of the object if choosing from a list.

func (*LeafUnl) LoadRootUnl

func (o *LeafUnl) LoadRootUnl(ctx context.Context) (*RootUnl, error)

LoadRootUnl returns the related RootUnl. If it is not already loaded, it will attempt to load it, provided the RootUnlID column has been loaded first.

func (*LeafUnl) MarshalBinary

func (o *LeafUnl) MarshalBinary() ([]byte, error)

MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.

func (*LeafUnl) MarshalJSON

func (o *LeafUnl) MarshalJSON() (data []byte, err error)

MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.

func (*LeafUnl) MarshalStringMap

func (o *LeafUnl) MarshalStringMap() map[string]interface{}

MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.

func (*LeafUnl) Name

func (o *LeafUnl) Name() string

Name returns the value of the loaded name field in the database.

func (*LeafUnl) NameIsLoaded

func (o *LeafUnl) NameIsLoaded() bool

NameIsLoaded returns true if the value was loaded from the database or has been set.

func (*LeafUnl) OriginalPrimaryKey

func (o *LeafUnl) OriginalPrimaryKey() query.AutoPrimaryKey

OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.

func (*LeafUnl) PrimaryKey

func (o *LeafUnl) PrimaryKey() query.AutoPrimaryKey

PrimaryKey returns the value of the primary key of the record.

func (*LeafUnl) RootUnl

func (o *LeafUnl) RootUnl() *RootUnl

RootUnl returns the current value of the loaded RootUnl, and nil if its not loaded.

func (*LeafUnl) RootUnlID

func (o *LeafUnl) RootUnlID() query.AutoPrimaryKey

RootUnlID returns the value of the loaded root_unl_id field in the database.

func (*LeafUnl) RootUnlIDIsLoaded

func (o *LeafUnl) RootUnlIDIsLoaded() bool

RootUnlIDIsLoaded returns true if the value was loaded from the database or has been set.

func (*LeafUnl) RootUnlIDIsNull

func (o *LeafUnl) RootUnlIDIsNull() bool

RootUnlIDIsNull returns true if the related database value is null.

func (*LeafUnl) Save

func (o *LeafUnl) Save(ctx context.Context) error

Save will update or insert the object, depending on the state of the object.

If it has an auto-generated primary key, it will be updated after an insert. Database errors generally will be handled by a panic and not returned here, since those indicate a problem with a database driver or configuration.

Save will return a db.OptimisticLockError if it detects a collision when two users are attempting to change the same database record.

It will return a db.UniqueValueError if it detects a collision when an attempt is made to add a record with a unique column that is given a value that is already in the database.

Updating a record that has not changed will have no effect on the database. Updating a record that has linked records will also update any linked records that are MODIFIED, and if optimistic locking is in effect, will also check whether those records have been altered or deleted, returning an OptimisticLockError if so.

func (*LeafUnl) SetID

func (o *LeafUnl) SetID(v query.AutoPrimaryKey)

SetID sets the value of ID in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the ID value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*LeafUnl) SetName

func (o *LeafUnl) SetName(v string)

SetName sets the value of Name in the object, to be saved later in the database using the Save() function.

func (*LeafUnl) SetPrimaryKey

func (o *LeafUnl) SetPrimaryKey(v query.AutoPrimaryKey)

SetPrimaryKey sets the value of the primary key in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the primary key value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*LeafUnl) SetRootUnl

func (o *LeafUnl) SetRootUnl(rootUnl *RootUnl)

SetRootUnl will set the reference to rootUnl. The referenced object will be saved when LeafUnl is saved. Pass nil to break the connection.

func (*LeafUnl) SetRootUnlID

func (o *LeafUnl) SetRootUnlID(v query.AutoPrimaryKey)

SetRootUnlID sets the value of RootUnlID in the object, to be saved later in the database using the Save() function.

func (*LeafUnl) SetRootUnlIDToNull

func (o *LeafUnl) SetRootUnlIDToNull()

SetRootUnlIDToNull() will set the root_unl_id value in the database to NULL. RootUnlID() will return the column's default value after this. Will also set the attached o.RootUnl to nil.

func (*LeafUnl) String

func (o *LeafUnl) String() string

String implements the Stringer interface and returns a description of the record, primarily for debugging.

func (*LeafUnl) UnmarshalBinary

func (o *LeafUnl) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary converts a structure that was created with MarshalBinary into a LeafUnl object.

func (*LeafUnl) UnmarshalJSON

func (o *LeafUnl) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON unmarshalls the given json data into the LeafUnl. The LeafUnl can be a newly created object, or one loaded from the database.

After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.

Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.

The fields it expects are:

"id" - query.AutoPrimaryKey
"name" - string
"groLock" - int64

func (*LeafUnl) UnmarshalStringMap

func (o *LeafUnl) UnmarshalStringMap(m map[string]interface{}) (err error)

UnmarshalStringMap will load the values from the stringmap into the object.

Override this in LeafUnl to modify the json before sending it here.

type LeafUnlBuilder

type LeafUnlBuilder struct {
	// contains filtered or unexported fields
}

The LeafUnlBuilder uses a builder pattern to create a query on the database. Create a LeafUnlBuilder by calling QueryLeafUnls, which will select all the LeafUnl object in the database. Then filter and arrange those objects by calling Where, Select, etc. End a query by calling either Load, LoadI, LoadCursor, Get, or Count. A LeafUnlBuilder stores the context it will use to perform the query, and thus is meant to be a short-lived object. You should not save it for later use.

func QueryLeafUnls

func QueryLeafUnls(ctx context.Context) *LeafUnlBuilder

QueryLeafUnls returns a new query builder. See LeafUnlBuilder for doc on how to use the builder. You should pass a context that has a timeout with it to protect against a long delay from the database possibly hanging your application. You can set a ReadTimeout value on the schema to do this by default during code generation.

func (*LeafUnlBuilder) Calculation

func (b *LeafUnlBuilder) Calculation(base query.TableNodeI, alias string, operation query.OperationNodeI) *LeafUnlBuilder

Calculation adds operation as an aliased value onto base. After the query, you can read the data by passing alias to GetAlias on the returned object.

func (*LeafUnlBuilder) Count

func (b *LeafUnlBuilder) Count() (int, error)

Count terminates a query and returns just the number of items in the result. If you have Select or Calculation columns in the query, it will count NULL results as well. To not count NULL values, use Where in the builder with a NotNull operation. To count distinct combinations of items, call Distinct() on the builder.

func (*LeafUnlBuilder) Distinct

func (b *LeafUnlBuilder) Distinct() *LeafUnlBuilder

Distinct removes duplicates from the results of the query. Adding a Select() is usually required.

func (*LeafUnlBuilder) Get

func (b *LeafUnlBuilder) Get() (*LeafUnl, error)

Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items. If an error occurs, or no results are found, a nil is returned.

func (*LeafUnlBuilder) GroupBy

func (b *LeafUnlBuilder) GroupBy(nodes ...query.Node) *LeafUnlBuilder

GroupBy controls how results are grouped when using aggregate functions with Calculation.

func (*LeafUnlBuilder) Having

func (b *LeafUnlBuilder) Having(node query.Node) *LeafUnlBuilder

Having does additional filtering on the results of the query after the query is performed.

func (*LeafUnlBuilder) Limit

func (b *LeafUnlBuilder) Limit(maxRowCount int, offset int) *LeafUnlBuilder

Limit will return a subset of the data, limited to the offset and number of rows specified. For large data sets and specific types of queries, this can be slow, because it will perform the entire query before computing the limit. You cannot limit a query that has embedded arrays.

func (*LeafUnlBuilder) Load

func (b *LeafUnlBuilder) Load() (leafUnls []*LeafUnl, err error)

Load terminates the query builder, performs the query, and returns a slice of LeafUnl objects. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*LeafUnlBuilder) LoadCursor

func (b *LeafUnlBuilder) LoadCursor() (leafUnlsCursor, error)

LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.

A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.

Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use

defer cursor.Close()

to make sure the cursor gets closed.

func (*LeafUnlBuilder) LoadI

func (b *LeafUnlBuilder) LoadI() (leafUnls []query.OrmObj, err error)

LoadI terminates the query builder, performs the query, and returns a slice of interfaces. This can then satisfy a variety of interfaces that load arrays of objects, including KeyLabeler. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*LeafUnlBuilder) OrderBy

func (b *LeafUnlBuilder) OrderBy(nodes ...query.Sorter) *LeafUnlBuilder

OrderBy specifies how the resulting data should be sorted. By default, the given nodes are sorted in ascending order. Add Descending() to the node to specify that it should be sorted in descending order.

func (*LeafUnlBuilder) Select

func (b *LeafUnlBuilder) Select(nodes ...query.Node) *LeafUnlBuilder

Select specifies what specific columns will be loaded with data. By default, all the columns of the leaf_unl table will be queried and loaded. If nodes contains columns from the leaf_unl table, that will limit the columns queried and loaded to only those columns. If related tables are specified, then all the columns from those tables are queried, selected and joined to the result. If columns in related tables are specified, then only those columns will be queried and loaded. Depending on the query, additional columns may automatically be added to the query. In particular, primary key columns will be added in most situations. The exception to this would be in distinct queries, group by queries, or subqueries.

func (*LeafUnlBuilder) Where

func (b *LeafUnlBuilder) Where(c query.Node) *LeafUnlBuilder

Where adds a condition to filter what gets selected. Calling Where multiple times will AND the conditions together.

type MultiParent

type MultiParent struct {
	// contains filtered or unexported fields
}

MultiParent represents an item in the multi_parent table in the database.

func LoadMultiParent

func LoadMultiParent(ctx context.Context, pk query.AutoPrimaryKey, selectNodes ...query.Node) (*MultiParent, error)

LoadMultiParent returns a MultiParent from the database. selectNodes lets you provide nodes for selecting specific fields or additional fields from related tables. See [MultiParentsBuilder.Select] for more info.

func LoadMultiParentsByParent1ID

func LoadMultiParentsByParent1ID(ctx context.Context, parent1ID interface{}, selectNodes ...query.Node) ([]*MultiParent, error)

LoadMultiParentsByParent1ID queries MultiParent objects by the given index values. selectNodes optionally let you provide nodes for joining to other tables or selecting specific fields. See [MultiParentsBuilder.Select]. If you need a more elaborate query, use QueryMultiParents() to start a query builder.

func LoadMultiParentsByParent2ID

func LoadMultiParentsByParent2ID(ctx context.Context, parent2ID interface{}, selectNodes ...query.Node) ([]*MultiParent, error)

LoadMultiParentsByParent2ID queries MultiParent objects by the given index values. selectNodes optionally let you provide nodes for joining to other tables or selecting specific fields. See [MultiParentsBuilder.Select]. If you need a more elaborate query, use QueryMultiParents() to start a query builder.

func NewMultiParent

func NewMultiParent() *MultiParent

NewMultiParent creates a new MultiParent object and initializes it to default values.

func (*MultiParent) Copy

func (o *MultiParent) Copy() (newObject *MultiParent)

Copy copies most fields to a new MultiParent object. Forward reference ids will be copied, but reverse and many-many references will not. Attached objects will not be included in the copy. Automatically generated fields will not be included in the copy. The primary key field will not be copied, since it is normally auto-generated. Call Save() on the new object to save it into the database. Copy might panic if any fields in the database were set to a size larger than the maximum size through a process that accessed the database outside of the ORM.

func (*MultiParent) CountParent1MultiParents

func (o *MultiParent) CountParent1MultiParents(ctx context.Context) (int, error)

CountParent1MultiParents does a database query and returns the number of MultiParent objects currently in the database that have a Parent1ID value that equals this objects primary key.

func (*MultiParent) CountParent2MultiParents

func (o *MultiParent) CountParent2MultiParents(ctx context.Context) (int, error)

CountParent2MultiParents does a database query and returns the number of MultiParent objects currently in the database that have a Parent2ID value that equals this objects primary key.

func (*MultiParent) Delete

func (o *MultiParent) Delete(ctx context.Context) (err error)

Delete deletes the record from the database.

Associated Parent1MultiParent will have their Parent1 field set to NULL. Associated Parent2MultiParent will have their Parent2 field set to NULL.

func (*MultiParent) Get

func (o *MultiParent) Get(key string) interface{}

Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil. Get can be used to retrieve a value by using the Field() of a node.

func (*MultiParent) GetAlias

func (o *MultiParent) GetAlias(aliasKey string) query.AliasValue

GetAlias returns the value for the Alias node aliasKey that was returned in the most recent query.

func (*MultiParent) ID

func (o *MultiParent) ID() query.AutoPrimaryKey

ID returns the loaded value of the id field in the database.

func (*MultiParent) IDIsLoaded

func (o *MultiParent) IDIsLoaded() bool

IDIsLoaded returns true if the value was loaded from the database or has been set.

func (*MultiParent) Initialize

func (o *MultiParent) Initialize()

Initialize will initialize or re-initialize a MultiParent database object to default values.

func (*MultiParent) IsDirty

func (o *MultiParent) IsDirty() (dirty bool)

IsDirty returns true if the object has been changed since it was read from the database or created.

func (*MultiParent) IsNew

func (o *MultiParent) IsNew() bool

IsNew returns true if the object will create a new record when saved.

func (*MultiParent) Key

func (o *MultiParent) Key() string

Key returns a unique key for the object, among a list of similar objects.

func (*MultiParent) Label

func (o *MultiParent) Label() string

Label returns a human-readable label of the object. This would be what a user would see as a description of the object if choosing from a list.

func (*MultiParent) LoadParent1

func (o *MultiParent) LoadParent1(ctx context.Context) (*MultiParent, error)

LoadParent1 returns the related Parent1. If it is not already loaded, it will attempt to load it, provided the Parent1ID column has been loaded first.

func (*MultiParent) LoadParent1MultiParents

func (o *MultiParent) LoadParent1MultiParents(ctx context.Context) ([]*MultiParent, error)

LoadParent1MultiParents loads a new slice of MultiParent objects and returns it.

func (*MultiParent) LoadParent2

func (o *MultiParent) LoadParent2(ctx context.Context) (*MultiParent, error)

LoadParent2 returns the related Parent2. If it is not already loaded, it will attempt to load it, provided the Parent2ID column has been loaded first.

func (*MultiParent) LoadParent2MultiParents

func (o *MultiParent) LoadParent2MultiParents(ctx context.Context) ([]*MultiParent, error)

LoadParent2MultiParents loads a new slice of MultiParent objects and returns it.

func (*MultiParent) MarshalBinary

func (o *MultiParent) MarshalBinary() ([]byte, error)

MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.

func (*MultiParent) MarshalJSON

func (o *MultiParent) MarshalJSON() (data []byte, err error)

MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.

func (*MultiParent) MarshalStringMap

func (o *MultiParent) MarshalStringMap() map[string]interface{}

MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.

func (*MultiParent) Name

func (o *MultiParent) Name() string

Name returns the value of the loaded name field in the database.

func (*MultiParent) NameIsLoaded

func (o *MultiParent) NameIsLoaded() bool

NameIsLoaded returns true if the value was loaded from the database or has been set.

func (*MultiParent) NameIsNull

func (o *MultiParent) NameIsNull() bool

NameIsNull returns true if the related database value is null.

func (*MultiParent) OriginalPrimaryKey

func (o *MultiParent) OriginalPrimaryKey() query.AutoPrimaryKey

OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.

func (*MultiParent) Parent1

func (o *MultiParent) Parent1() *MultiParent

Parent1 returns the current value of the loaded Parent1, and nil if its not loaded.

func (*MultiParent) Parent1ID

func (o *MultiParent) Parent1ID() query.AutoPrimaryKey

Parent1ID returns the value of the loaded parent_1_id field in the database.

func (*MultiParent) Parent1IDIsLoaded

func (o *MultiParent) Parent1IDIsLoaded() bool

Parent1IDIsLoaded returns true if the value was loaded from the database or has been set.

func (*MultiParent) Parent1IDIsNull

func (o *MultiParent) Parent1IDIsNull() bool

Parent1IDIsNull returns true if the related database value is null.

func (*MultiParent) Parent1MultiParent

func (o *MultiParent) Parent1MultiParent(pk query.AutoPrimaryKey) *MultiParent

Parent1MultiParent returns a single MultiParent object by primary key, if one was loaded. Otherwise, it will return nil. It will not return MultiParent objects that are not saved.

func (*MultiParent) Parent1MultiParents

func (o *MultiParent) Parent1MultiParents() []*MultiParent

Parent1MultiParents returns a slice of MultiParent objects if loaded.

func (*MultiParent) Parent2

func (o *MultiParent) Parent2() *MultiParent

Parent2 returns the current value of the loaded Parent2, and nil if its not loaded.

func (*MultiParent) Parent2ID

func (o *MultiParent) Parent2ID() query.AutoPrimaryKey

Parent2ID returns the value of the loaded parent_2_id field in the database.

func (*MultiParent) Parent2IDIsLoaded

func (o *MultiParent) Parent2IDIsLoaded() bool

Parent2IDIsLoaded returns true if the value was loaded from the database or has been set.

func (*MultiParent) Parent2IDIsNull

func (o *MultiParent) Parent2IDIsNull() bool

Parent2IDIsNull returns true if the related database value is null.

func (*MultiParent) Parent2MultiParent

func (o *MultiParent) Parent2MultiParent(pk query.AutoPrimaryKey) *MultiParent

Parent2MultiParent returns a single MultiParent object by primary key, if one was loaded. Otherwise, it will return nil. It will not return MultiParent objects that are not saved.

func (*MultiParent) Parent2MultiParents

func (o *MultiParent) Parent2MultiParents() []*MultiParent

Parent2MultiParents returns a slice of MultiParent objects if loaded.

func (*MultiParent) PrimaryKey

func (o *MultiParent) PrimaryKey() query.AutoPrimaryKey

PrimaryKey returns the value of the primary key of the record.

func (*MultiParent) Save

func (o *MultiParent) Save(ctx context.Context) error

Save will update or insert the object, depending on the state of the object.

If it has an auto-generated primary key, it will be updated after an insert. Database errors generally will be handled by a panic and not returned here, since those indicate a problem with a database driver or configuration.

Save will return a db.OptimisticLockError if it detects a collision when two users are attempting to change the same database record.

It will return a db.UniqueValueError if it detects a collision when an attempt is made to add a record with a unique column that is given a value that is already in the database.

Updating a record that has not changed will have no effect on the database. Updating a record that has linked records will also update any linked records that are MODIFIED, and if optimistic locking is in effect, will also check whether those records have been altered or deleted, returning an OptimisticLockError if so.

func (*MultiParent) SetID

func (o *MultiParent) SetID(v query.AutoPrimaryKey)

SetID sets the value of ID in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the ID value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*MultiParent) SetName

func (o *MultiParent) SetName(v string)

SetName sets the value of Name in the object, to be saved later in the database using the Save() function.

func (*MultiParent) SetNameToNull

func (o *MultiParent) SetNameToNull()

SetNameToNull() will set the name value in the database to NULL. Name() will return the column's default value after this.

func (*MultiParent) SetParent1

func (o *MultiParent) SetParent1(parent1 *MultiParent)

SetParent1 will set the reference to parent1. The referenced object will be saved when MultiParent is saved. Pass nil to break the connection.

func (*MultiParent) SetParent1ID

func (o *MultiParent) SetParent1ID(v query.AutoPrimaryKey)

SetParent1ID sets the value of Parent1ID in the object, to be saved later in the database using the Save() function.

func (*MultiParent) SetParent1IDToNull

func (o *MultiParent) SetParent1IDToNull()

SetParent1IDToNull() will set the parent_1_id value in the database to NULL. Parent1ID() will return the column's default value after this. Will also set the attached o.Parent1 to nil.

func (*MultiParent) SetParent1MultiParents

func (o *MultiParent) SetParent1MultiParents(objs ...*MultiParent)

SetParent1MultiParents associates the objects in objs with this MultiParent by setting their Parent1ID values to this object's primary key. If it has Parent1MultiParents already associated with it that will not be associated after a save, the foreign keys for those Parent1MultiParents will be set to null. If you did not use a join to query the items in the first place, used a conditional join, or joined with an expansion, be particularly careful, since you may be changing items that are not currently attached to this MultiParent.

func (*MultiParent) SetParent2

func (o *MultiParent) SetParent2(parent2 *MultiParent)

SetParent2 will set the reference to parent2. The referenced object will be saved when MultiParent is saved. Pass nil to break the connection.

func (*MultiParent) SetParent2ID

func (o *MultiParent) SetParent2ID(v query.AutoPrimaryKey)

SetParent2ID sets the value of Parent2ID in the object, to be saved later in the database using the Save() function.

func (*MultiParent) SetParent2IDToNull

func (o *MultiParent) SetParent2IDToNull()

SetParent2IDToNull() will set the parent_2_id value in the database to NULL. Parent2ID() will return the column's default value after this. Will also set the attached o.Parent2 to nil.

func (*MultiParent) SetParent2MultiParents

func (o *MultiParent) SetParent2MultiParents(objs ...*MultiParent)

SetParent2MultiParents associates the objects in objs with this MultiParent by setting their Parent2ID values to this object's primary key. If it has Parent2MultiParents already associated with it that will not be associated after a save, the foreign keys for those Parent2MultiParents will be set to null. If you did not use a join to query the items in the first place, used a conditional join, or joined with an expansion, be particularly careful, since you may be changing items that are not currently attached to this MultiParent.

func (*MultiParent) SetPrimaryKey

func (o *MultiParent) SetPrimaryKey(v query.AutoPrimaryKey)

SetPrimaryKey sets the value of the primary key in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the primary key value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*MultiParent) String

func (o *MultiParent) String() string

String implements the Stringer interface and returns a description of the record, primarily for debugging.

func (*MultiParent) UnmarshalBinary

func (o *MultiParent) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary converts a structure that was created with MarshalBinary into a MultiParent object.

func (*MultiParent) UnmarshalJSON

func (o *MultiParent) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON unmarshalls the given json data into the MultiParent. The MultiParent can be a newly created object, or one loaded from the database.

After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.

Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.

The fields it expects are:

"id" - query.AutoPrimaryKey
"name" - string, nullable

func (*MultiParent) UnmarshalStringMap

func (o *MultiParent) UnmarshalStringMap(m map[string]interface{}) (err error)

UnmarshalStringMap will load the values from the stringmap into the object.

Override this in MultiParent to modify the json before sending it here.

type MultiParentBuilder

type MultiParentBuilder struct {
	// contains filtered or unexported fields
}

The MultiParentBuilder uses a builder pattern to create a query on the database. Create a MultiParentBuilder by calling QueryMultiParents, which will select all the MultiParent object in the database. Then filter and arrange those objects by calling Where, Select, etc. End a query by calling either Load, LoadI, LoadCursor, Get, or Count. A MultiParentBuilder stores the context it will use to perform the query, and thus is meant to be a short-lived object. You should not save it for later use.

func QueryMultiParents

func QueryMultiParents(ctx context.Context) *MultiParentBuilder

QueryMultiParents returns a new query builder. See MultiParentBuilder for doc on how to use the builder. You should pass a context that has a timeout with it to protect against a long delay from the database possibly hanging your application. You can set a ReadTimeout value on the schema to do this by default during code generation.

func (*MultiParentBuilder) Calculation

func (b *MultiParentBuilder) Calculation(base query.TableNodeI, alias string, operation query.OperationNodeI) *MultiParentBuilder

Calculation adds operation as an aliased value onto base. After the query, you can read the data by passing alias to GetAlias on the returned object.

func (*MultiParentBuilder) Count

func (b *MultiParentBuilder) Count() (int, error)

Count terminates a query and returns just the number of items in the result. If you have Select or Calculation columns in the query, it will count NULL results as well. To not count NULL values, use Where in the builder with a NotNull operation. To count distinct combinations of items, call Distinct() on the builder.

func (*MultiParentBuilder) Distinct

func (b *MultiParentBuilder) Distinct() *MultiParentBuilder

Distinct removes duplicates from the results of the query. Adding a Select() is usually required.

func (*MultiParentBuilder) Get

func (b *MultiParentBuilder) Get() (*MultiParent, error)

Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items. If an error occurs, or no results are found, a nil is returned.

func (*MultiParentBuilder) GroupBy

func (b *MultiParentBuilder) GroupBy(nodes ...query.Node) *MultiParentBuilder

GroupBy controls how results are grouped when using aggregate functions with Calculation.

func (*MultiParentBuilder) Having

Having does additional filtering on the results of the query after the query is performed.

func (*MultiParentBuilder) Limit

func (b *MultiParentBuilder) Limit(maxRowCount int, offset int) *MultiParentBuilder

Limit will return a subset of the data, limited to the offset and number of rows specified. For large data sets and specific types of queries, this can be slow, because it will perform the entire query before computing the limit. You cannot limit a query that has embedded arrays.

func (*MultiParentBuilder) Load

func (b *MultiParentBuilder) Load() (multiParents []*MultiParent, err error)

Load terminates the query builder, performs the query, and returns a slice of MultiParent objects. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*MultiParentBuilder) LoadCursor

func (b *MultiParentBuilder) LoadCursor() (multiParentsCursor, error)

LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.

A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.

Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use

defer cursor.Close()

to make sure the cursor gets closed.

func (*MultiParentBuilder) LoadI

func (b *MultiParentBuilder) LoadI() (multiParents []query.OrmObj, err error)

LoadI terminates the query builder, performs the query, and returns a slice of interfaces. This can then satisfy a variety of interfaces that load arrays of objects, including KeyLabeler. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*MultiParentBuilder) OrderBy

func (b *MultiParentBuilder) OrderBy(nodes ...query.Sorter) *MultiParentBuilder

OrderBy specifies how the resulting data should be sorted. By default, the given nodes are sorted in ascending order. Add Descending() to the node to specify that it should be sorted in descending order.

func (*MultiParentBuilder) Select

func (b *MultiParentBuilder) Select(nodes ...query.Node) *MultiParentBuilder

Select specifies what specific columns will be loaded with data. By default, all the columns of the multi_parent table will be queried and loaded. If nodes contains columns from the multi_parent table, that will limit the columns queried and loaded to only those columns. If related tables are specified, then all the columns from those tables are queried, selected and joined to the result. If columns in related tables are specified, then only those columns will be queried and loaded. Depending on the query, additional columns may automatically be added to the query. In particular, primary key columns will be added in most situations. The exception to this would be in distinct queries, group by queries, or subqueries.

func (*MultiParentBuilder) Where

Where adds a condition to filter what gets selected. Calling Where multiple times will AND the conditions together.

type Root

type Root struct {
	// contains filtered or unexported fields
}

Root represents an item in the root table in the database.

func LoadRoot

func LoadRoot(ctx context.Context, pk query.AutoPrimaryKey, selectNodes ...query.Node) (*Root, error)

LoadRoot returns a Root from the database. selectNodes lets you provide nodes for selecting specific fields or additional fields from related tables. See [RootsBuilder.Select] for more info.

func NewRoot

func NewRoot() *Root

NewRoot creates a new Root object and initializes it to default values.

func (*Root) Copy

func (o *Root) Copy() (newObject *Root)

Copy copies most fields to a new Root object. Forward reference ids will be copied, but reverse and many-many references will not. Attached objects will not be included in the copy. Automatically generated fields will not be included in the copy. The primary key field will not be copied, since it is normally auto-generated. Call Save() on the new object to save it into the database. Copy might panic if any fields in the database were set to a size larger than the maximum size through a process that accessed the database outside of the ORM.

func (*Root) CountLeafs

func (o *Root) CountLeafs(ctx context.Context) (int, error)

CountLeafs does a database query and returns the number of Leaf objects currently in the database that have a RootID value that equals this objects primary key.

func (*Root) Delete

func (o *Root) Delete(ctx context.Context) (err error)

Delete deletes the record from the database.

Associated Leaf will also be deleted since their Root fields are not nullable.

func (*Root) Get

func (o *Root) Get(key string) interface{}

Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil. Get can be used to retrieve a value by using the Field() of a node.

func (*Root) GetAlias

func (o *Root) GetAlias(aliasKey string) query.AliasValue

GetAlias returns the value for the Alias node aliasKey that was returned in the most recent query.

func (*Root) ID

func (o *Root) ID() query.AutoPrimaryKey

ID returns the loaded value of the id field in the database.

func (*Root) IDIsLoaded

func (o *Root) IDIsLoaded() bool

IDIsLoaded returns true if the value was loaded from the database or has been set.

func (*Root) Initialize

func (o *Root) Initialize()

Initialize will initialize or re-initialize a Root database object to default values.

func (*Root) IsDirty

func (o *Root) IsDirty() (dirty bool)

IsDirty returns true if the object has been changed since it was read from the database or created.

func (*Root) IsNew

func (o *Root) IsNew() bool

IsNew returns true if the object will create a new record when saved.

func (*Root) Key

func (o *Root) Key() string

Key returns a unique key for the object, among a list of similar objects.

func (*Root) Label

func (o *Root) Label() string

Label returns a human-readable label of the object. This would be what a user would see as a description of the object if choosing from a list.

func (*Root) Leaf

func (o *Root) Leaf(pk query.AutoPrimaryKey) *Leaf

Leaf returns a single Leaf object by primary key, if one was loaded. Otherwise, it will return nil. It will not return Leaf objects that are not saved.

func (*Root) Leafs

func (o *Root) Leafs() []*Leaf

Leafs returns a slice of Leaf objects if loaded.

func (*Root) LoadLeafs

func (o *Root) LoadLeafs(ctx context.Context) ([]*Leaf, error)

LoadLeafs loads a new slice of Leaf objects and returns it.

func (*Root) MarshalBinary

func (o *Root) MarshalBinary() ([]byte, error)

MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.

func (*Root) MarshalJSON

func (o *Root) MarshalJSON() (data []byte, err error)

MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.

func (*Root) MarshalStringMap

func (o *Root) MarshalStringMap() map[string]interface{}

MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.

func (*Root) Name

func (o *Root) Name() string

Name returns the value of the loaded name field in the database.

func (*Root) NameIsLoaded

func (o *Root) NameIsLoaded() bool

NameIsLoaded returns true if the value was loaded from the database or has been set.

func (*Root) OriginalPrimaryKey

func (o *Root) OriginalPrimaryKey() query.AutoPrimaryKey

OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.

func (*Root) PrimaryKey

func (o *Root) PrimaryKey() query.AutoPrimaryKey

PrimaryKey returns the value of the primary key of the record.

func (*Root) Save

func (o *Root) Save(ctx context.Context) error

Save will update or insert the object, depending on the state of the object.

If it has an auto-generated primary key, it will be updated after an insert. Database errors generally will be handled by a panic and not returned here, since those indicate a problem with a database driver or configuration.

Save will return a db.OptimisticLockError if it detects a collision when two users are attempting to change the same database record.

It will return a db.UniqueValueError if it detects a collision when an attempt is made to add a record with a unique column that is given a value that is already in the database.

Updating a record that has not changed will have no effect on the database. Updating a record that has linked records will also update any linked records that are MODIFIED, and if optimistic locking is in effect, will also check whether those records have been altered or deleted, returning an OptimisticLockError if so.

func (*Root) SetID

func (o *Root) SetID(v query.AutoPrimaryKey)

SetID sets the value of ID in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the ID value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*Root) SetLeafs

func (o *Root) SetLeafs(objs ...*Leaf)

SetLeafs associates the objects in objs with this Root by setting their RootID values to this object's primary key. WARNING! If it has Leafs already associated with it that will not be associated after a save, Save will panic. Be sure to delete those Leafs or otherwise fix those pointers before calling save.

func (*Root) SetName

func (o *Root) SetName(v string)

SetName sets the value of Name in the object, to be saved later in the database using the Save() function.

func (*Root) SetPrimaryKey

func (o *Root) SetPrimaryKey(v query.AutoPrimaryKey)

SetPrimaryKey sets the value of the primary key in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the primary key value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*Root) String

func (o *Root) String() string

String implements the Stringer interface and returns a description of the record, primarily for debugging.

func (*Root) UnmarshalBinary

func (o *Root) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary converts a structure that was created with MarshalBinary into a Root object.

func (*Root) UnmarshalJSON

func (o *Root) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON unmarshalls the given json data into the Root. The Root can be a newly created object, or one loaded from the database.

After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.

Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.

The fields it expects are:

"id" - query.AutoPrimaryKey
"name" - string

func (*Root) UnmarshalStringMap

func (o *Root) UnmarshalStringMap(m map[string]interface{}) (err error)

UnmarshalStringMap will load the values from the stringmap into the object.

Override this in Root to modify the json before sending it here.

type RootBuilder

type RootBuilder struct {
	// contains filtered or unexported fields
}

The RootBuilder uses a builder pattern to create a query on the database. Create a RootBuilder by calling QueryRoots, which will select all the Root object in the database. Then filter and arrange those objects by calling Where, Select, etc. End a query by calling either Load, LoadI, LoadCursor, Get, or Count. A RootBuilder stores the context it will use to perform the query, and thus is meant to be a short-lived object. You should not save it for later use.

func QueryRoots

func QueryRoots(ctx context.Context) *RootBuilder

QueryRoots returns a new query builder. See RootBuilder for doc on how to use the builder. You should pass a context that has a timeout with it to protect against a long delay from the database possibly hanging your application. You can set a ReadTimeout value on the schema to do this by default during code generation.

func (*RootBuilder) Calculation

func (b *RootBuilder) Calculation(base query.TableNodeI, alias string, operation query.OperationNodeI) *RootBuilder

Calculation adds operation as an aliased value onto base. After the query, you can read the data by passing alias to GetAlias on the returned object.

func (*RootBuilder) Count

func (b *RootBuilder) Count() (int, error)

Count terminates a query and returns just the number of items in the result. If you have Select or Calculation columns in the query, it will count NULL results as well. To not count NULL values, use Where in the builder with a NotNull operation. To count distinct combinations of items, call Distinct() on the builder.

func (*RootBuilder) Distinct

func (b *RootBuilder) Distinct() *RootBuilder

Distinct removes duplicates from the results of the query. Adding a Select() is usually required.

func (*RootBuilder) Get

func (b *RootBuilder) Get() (*Root, error)

Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items. If an error occurs, or no results are found, a nil is returned.

func (*RootBuilder) GroupBy

func (b *RootBuilder) GroupBy(nodes ...query.Node) *RootBuilder

GroupBy controls how results are grouped when using aggregate functions with Calculation.

func (*RootBuilder) Having

func (b *RootBuilder) Having(node query.Node) *RootBuilder

Having does additional filtering on the results of the query after the query is performed.

func (*RootBuilder) Limit

func (b *RootBuilder) Limit(maxRowCount int, offset int) *RootBuilder

Limit will return a subset of the data, limited to the offset and number of rows specified. For large data sets and specific types of queries, this can be slow, because it will perform the entire query before computing the limit. You cannot limit a query that has embedded arrays.

func (*RootBuilder) Load

func (b *RootBuilder) Load() (roots []*Root, err error)

Load terminates the query builder, performs the query, and returns a slice of Root objects. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*RootBuilder) LoadCursor

func (b *RootBuilder) LoadCursor() (rootsCursor, error)

LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.

A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.

Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use

defer cursor.Close()

to make sure the cursor gets closed.

func (*RootBuilder) LoadI

func (b *RootBuilder) LoadI() (roots []query.OrmObj, err error)

LoadI terminates the query builder, performs the query, and returns a slice of interfaces. This can then satisfy a variety of interfaces that load arrays of objects, including KeyLabeler. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*RootBuilder) OrderBy

func (b *RootBuilder) OrderBy(nodes ...query.Sorter) *RootBuilder

OrderBy specifies how the resulting data should be sorted. By default, the given nodes are sorted in ascending order. Add Descending() to the node to specify that it should be sorted in descending order.

func (*RootBuilder) Select

func (b *RootBuilder) Select(nodes ...query.Node) *RootBuilder

Select specifies what specific columns will be loaded with data. By default, all the columns of the root table will be queried and loaded. If nodes contains columns from the root table, that will limit the columns queried and loaded to only those columns. If related tables are specified, then all the columns from those tables are queried, selected and joined to the result. If columns in related tables are specified, then only those columns will be queried and loaded. Depending on the query, additional columns may automatically be added to the query. In particular, primary key columns will be added in most situations. The exception to this would be in distinct queries, group by queries, or subqueries.

func (*RootBuilder) Where

func (b *RootBuilder) Where(c query.Node) *RootBuilder

Where adds a condition to filter what gets selected. Calling Where multiple times will AND the conditions together.

type RootL

type RootL struct {
	// contains filtered or unexported fields
}

RootL represents an item in the root_l table in the database.

func LoadRootL

func LoadRootL(ctx context.Context, pk query.AutoPrimaryKey, selectNodes ...query.Node) (*RootL, error)

LoadRootL returns a RootL from the database. selectNodes lets you provide nodes for selecting specific fields or additional fields from related tables. See [RootLsBuilder.Select] for more info.

func NewRootL

func NewRootL() *RootL

NewRootL creates a new RootL object and initializes it to default values.

func (*RootL) Copy

func (o *RootL) Copy() (newObject *RootL)

Copy copies most fields to a new RootL object. Forward reference ids will be copied, but reverse and many-many references will not. Attached objects will not be included in the copy. Automatically generated fields will not be included in the copy. The primary key field will not be copied, since it is normally auto-generated. Call Save() on the new object to save it into the database. Copy might panic if any fields in the database were set to a size larger than the maximum size through a process that accessed the database outside of the ORM.

func (*RootL) CountLeafLs

func (o *RootL) CountLeafLs(ctx context.Context) (int, error)

CountLeafLs does a database query and returns the number of LeafL objects currently in the database that have a RootLID value that equals this objects primary key.

func (*RootL) Delete

func (o *RootL) Delete(ctx context.Context) (err error)

Delete deletes the record from the database.

Associated LeafL will also be deleted since their RootL fields are not nullable.

func (*RootL) Get

func (o *RootL) Get(key string) interface{}

Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil. Get can be used to retrieve a value by using the Field() of a node.

func (*RootL) GetAlias

func (o *RootL) GetAlias(aliasKey string) query.AliasValue

GetAlias returns the value for the Alias node aliasKey that was returned in the most recent query.

func (*RootL) GroLock

func (o *RootL) GroLock() int64

GroLock returns the value of the loaded gro_lock field in the database.

func (*RootL) GroLockIsLoaded

func (o *RootL) GroLockIsLoaded() bool

GroLockIsLoaded returns true if the value was loaded from the database or has been set.

func (*RootL) ID

func (o *RootL) ID() query.AutoPrimaryKey

ID returns the loaded value of the id field in the database.

func (*RootL) IDIsLoaded

func (o *RootL) IDIsLoaded() bool

IDIsLoaded returns true if the value was loaded from the database or has been set.

func (*RootL) Initialize

func (o *RootL) Initialize()

Initialize will initialize or re-initialize a RootL database object to default values.

func (*RootL) IsDirty

func (o *RootL) IsDirty() (dirty bool)

IsDirty returns true if the object has been changed since it was read from the database or created.

func (*RootL) IsNew

func (o *RootL) IsNew() bool

IsNew returns true if the object will create a new record when saved.

func (*RootL) Key

func (o *RootL) Key() string

Key returns a unique key for the object, among a list of similar objects.

func (*RootL) Label

func (o *RootL) Label() string

Label returns a human-readable label of the object. This would be what a user would see as a description of the object if choosing from a list.

func (*RootL) LeafL

func (o *RootL) LeafL(pk query.AutoPrimaryKey) *LeafL

LeafL returns a single LeafL object by primary key, if one was loaded. Otherwise, it will return nil. It will not return LeafL objects that are not saved.

func (*RootL) LeafLs

func (o *RootL) LeafLs() []*LeafL

LeafLs returns a slice of LeafL objects if loaded.

func (*RootL) LoadLeafLs

func (o *RootL) LoadLeafLs(ctx context.Context) ([]*LeafL, error)

LoadLeafLs loads a new slice of LeafL objects and returns it.

func (*RootL) MarshalBinary

func (o *RootL) MarshalBinary() ([]byte, error)

MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.

func (*RootL) MarshalJSON

func (o *RootL) MarshalJSON() (data []byte, err error)

MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.

func (*RootL) MarshalStringMap

func (o *RootL) MarshalStringMap() map[string]interface{}

MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.

func (*RootL) Name

func (o *RootL) Name() string

Name returns the value of the loaded name field in the database.

func (*RootL) NameIsLoaded

func (o *RootL) NameIsLoaded() bool

NameIsLoaded returns true if the value was loaded from the database or has been set.

func (*RootL) OriginalPrimaryKey

func (o *RootL) OriginalPrimaryKey() query.AutoPrimaryKey

OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.

func (*RootL) PrimaryKey

func (o *RootL) PrimaryKey() query.AutoPrimaryKey

PrimaryKey returns the value of the primary key of the record.

func (*RootL) Save

func (o *RootL) Save(ctx context.Context) error

Save will update or insert the object, depending on the state of the object.

If it has an auto-generated primary key, it will be updated after an insert. Database errors generally will be handled by a panic and not returned here, since those indicate a problem with a database driver or configuration.

Save will return a db.OptimisticLockError if it detects a collision when two users are attempting to change the same database record.

It will return a db.UniqueValueError if it detects a collision when an attempt is made to add a record with a unique column that is given a value that is already in the database.

Updating a record that has not changed will have no effect on the database. Updating a record that has linked records will also update any linked records that are MODIFIED, and if optimistic locking is in effect, will also check whether those records have been altered or deleted, returning an OptimisticLockError if so.

func (*RootL) SetID

func (o *RootL) SetID(v query.AutoPrimaryKey)

SetID sets the value of ID in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the ID value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*RootL) SetLeafLs

func (o *RootL) SetLeafLs(objs ...*LeafL)

SetLeafLs associates the objects in objs with this RootL by setting their RootLID values to this object's primary key. WARNING! If it has LeafLs already associated with it that will not be associated after a save, Save will panic. Be sure to delete those LeafLs or otherwise fix those pointers before calling save.

func (*RootL) SetName

func (o *RootL) SetName(v string)

SetName sets the value of Name in the object, to be saved later in the database using the Save() function.

func (*RootL) SetPrimaryKey

func (o *RootL) SetPrimaryKey(v query.AutoPrimaryKey)

SetPrimaryKey sets the value of the primary key in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the primary key value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*RootL) String

func (o *RootL) String() string

String implements the Stringer interface and returns a description of the record, primarily for debugging.

func (*RootL) UnmarshalBinary

func (o *RootL) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary converts a structure that was created with MarshalBinary into a RootL object.

func (*RootL) UnmarshalJSON

func (o *RootL) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON unmarshalls the given json data into the RootL. The RootL can be a newly created object, or one loaded from the database.

After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.

Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.

The fields it expects are:

"id" - query.AutoPrimaryKey
"name" - string
"groLock" - int64

func (*RootL) UnmarshalStringMap

func (o *RootL) UnmarshalStringMap(m map[string]interface{}) (err error)

UnmarshalStringMap will load the values from the stringmap into the object.

Override this in RootL to modify the json before sending it here.

type RootLBuilder

type RootLBuilder struct {
	// contains filtered or unexported fields
}

The RootLBuilder uses a builder pattern to create a query on the database. Create a RootLBuilder by calling QueryRootLs, which will select all the RootL object in the database. Then filter and arrange those objects by calling Where, Select, etc. End a query by calling either Load, LoadI, LoadCursor, Get, or Count. A RootLBuilder stores the context it will use to perform the query, and thus is meant to be a short-lived object. You should not save it for later use.

func QueryRootLs

func QueryRootLs(ctx context.Context) *RootLBuilder

QueryRootLs returns a new query builder. See RootLBuilder for doc on how to use the builder. You should pass a context that has a timeout with it to protect against a long delay from the database possibly hanging your application. You can set a ReadTimeout value on the schema to do this by default during code generation.

func (*RootLBuilder) Calculation

func (b *RootLBuilder) Calculation(base query.TableNodeI, alias string, operation query.OperationNodeI) *RootLBuilder

Calculation adds operation as an aliased value onto base. After the query, you can read the data by passing alias to GetAlias on the returned object.

func (*RootLBuilder) Count

func (b *RootLBuilder) Count() (int, error)

Count terminates a query and returns just the number of items in the result. If you have Select or Calculation columns in the query, it will count NULL results as well. To not count NULL values, use Where in the builder with a NotNull operation. To count distinct combinations of items, call Distinct() on the builder.

func (*RootLBuilder) Distinct

func (b *RootLBuilder) Distinct() *RootLBuilder

Distinct removes duplicates from the results of the query. Adding a Select() is usually required.

func (*RootLBuilder) Get

func (b *RootLBuilder) Get() (*RootL, error)

Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items. If an error occurs, or no results are found, a nil is returned.

func (*RootLBuilder) GroupBy

func (b *RootLBuilder) GroupBy(nodes ...query.Node) *RootLBuilder

GroupBy controls how results are grouped when using aggregate functions with Calculation.

func (*RootLBuilder) Having

func (b *RootLBuilder) Having(node query.Node) *RootLBuilder

Having does additional filtering on the results of the query after the query is performed.

func (*RootLBuilder) Limit

func (b *RootLBuilder) Limit(maxRowCount int, offset int) *RootLBuilder

Limit will return a subset of the data, limited to the offset and number of rows specified. For large data sets and specific types of queries, this can be slow, because it will perform the entire query before computing the limit. You cannot limit a query that has embedded arrays.

func (*RootLBuilder) Load

func (b *RootLBuilder) Load() (rootLs []*RootL, err error)

Load terminates the query builder, performs the query, and returns a slice of RootL objects. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*RootLBuilder) LoadCursor

func (b *RootLBuilder) LoadCursor() (rootLsCursor, error)

LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.

A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.

Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use

defer cursor.Close()

to make sure the cursor gets closed.

func (*RootLBuilder) LoadI

func (b *RootLBuilder) LoadI() (rootLs []query.OrmObj, err error)

LoadI terminates the query builder, performs the query, and returns a slice of interfaces. This can then satisfy a variety of interfaces that load arrays of objects, including KeyLabeler. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*RootLBuilder) OrderBy

func (b *RootLBuilder) OrderBy(nodes ...query.Sorter) *RootLBuilder

OrderBy specifies how the resulting data should be sorted. By default, the given nodes are sorted in ascending order. Add Descending() to the node to specify that it should be sorted in descending order.

func (*RootLBuilder) Select

func (b *RootLBuilder) Select(nodes ...query.Node) *RootLBuilder

Select specifies what specific columns will be loaded with data. By default, all the columns of the root_l table will be queried and loaded. If nodes contains columns from the root_l table, that will limit the columns queried and loaded to only those columns. If related tables are specified, then all the columns from those tables are queried, selected and joined to the result. If columns in related tables are specified, then only those columns will be queried and loaded. Depending on the query, additional columns may automatically be added to the query. In particular, primary key columns will be added in most situations. The exception to this would be in distinct queries, group by queries, or subqueries.

func (*RootLBuilder) Where

func (b *RootLBuilder) Where(c query.Node) *RootLBuilder

Where adds a condition to filter what gets selected. Calling Where multiple times will AND the conditions together.

type RootN

type RootN struct {
	// contains filtered or unexported fields
}

RootN represents an item in the root_n table in the database.

func LoadRootN

func LoadRootN(ctx context.Context, pk query.AutoPrimaryKey, selectNodes ...query.Node) (*RootN, error)

LoadRootN returns a RootN from the database. selectNodes lets you provide nodes for selecting specific fields or additional fields from related tables. See [RootNsBuilder.Select] for more info.

func NewRootN

func NewRootN() *RootN

NewRootN creates a new RootN object and initializes it to default values.

func (*RootN) Copy

func (o *RootN) Copy() (newObject *RootN)

Copy copies most fields to a new RootN object. Forward reference ids will be copied, but reverse and many-many references will not. Attached objects will not be included in the copy. Automatically generated fields will not be included in the copy. The primary key field will not be copied, since it is normally auto-generated. Call Save() on the new object to save it into the database. Copy might panic if any fields in the database were set to a size larger than the maximum size through a process that accessed the database outside of the ORM.

func (*RootN) CountLeafNs

func (o *RootN) CountLeafNs(ctx context.Context) (int, error)

CountLeafNs does a database query and returns the number of LeafN objects currently in the database that have a RootNID value that equals this objects primary key.

func (*RootN) Delete

func (o *RootN) Delete(ctx context.Context) (err error)

Delete deletes the record from the database.

Associated LeafN will have their RootN field set to NULL.

func (*RootN) Get

func (o *RootN) Get(key string) interface{}

Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil. Get can be used to retrieve a value by using the Field() of a node.

func (*RootN) GetAlias

func (o *RootN) GetAlias(aliasKey string) query.AliasValue

GetAlias returns the value for the Alias node aliasKey that was returned in the most recent query.

func (*RootN) ID

func (o *RootN) ID() query.AutoPrimaryKey

ID returns the loaded value of the id field in the database.

func (*RootN) IDIsLoaded

func (o *RootN) IDIsLoaded() bool

IDIsLoaded returns true if the value was loaded from the database or has been set.

func (*RootN) Initialize

func (o *RootN) Initialize()

Initialize will initialize or re-initialize a RootN database object to default values.

func (*RootN) IsDirty

func (o *RootN) IsDirty() (dirty bool)

IsDirty returns true if the object has been changed since it was read from the database or created.

func (*RootN) IsNew

func (o *RootN) IsNew() bool

IsNew returns true if the object will create a new record when saved.

func (*RootN) Key

func (o *RootN) Key() string

Key returns a unique key for the object, among a list of similar objects.

func (*RootN) Label

func (o *RootN) Label() string

Label returns a human-readable label of the object. This would be what a user would see as a description of the object if choosing from a list.

func (*RootN) LeafN

func (o *RootN) LeafN(pk query.AutoPrimaryKey) *LeafN

LeafN returns a single LeafN object by primary key, if one was loaded. Otherwise, it will return nil. It will not return LeafN objects that are not saved.

func (*RootN) LeafNs

func (o *RootN) LeafNs() []*LeafN

LeafNs returns a slice of LeafN objects if loaded.

func (*RootN) LoadLeafNs

func (o *RootN) LoadLeafNs(ctx context.Context) ([]*LeafN, error)

LoadLeafNs loads a new slice of LeafN objects and returns it.

func (*RootN) MarshalBinary

func (o *RootN) MarshalBinary() ([]byte, error)

MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.

func (*RootN) MarshalJSON

func (o *RootN) MarshalJSON() (data []byte, err error)

MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.

func (*RootN) MarshalStringMap

func (o *RootN) MarshalStringMap() map[string]interface{}

MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.

func (*RootN) Name

func (o *RootN) Name() string

Name returns the value of the loaded name field in the database.

func (*RootN) NameIsLoaded

func (o *RootN) NameIsLoaded() bool

NameIsLoaded returns true if the value was loaded from the database or has been set.

func (*RootN) OriginalPrimaryKey

func (o *RootN) OriginalPrimaryKey() query.AutoPrimaryKey

OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.

func (*RootN) PrimaryKey

func (o *RootN) PrimaryKey() query.AutoPrimaryKey

PrimaryKey returns the value of the primary key of the record.

func (*RootN) Save

func (o *RootN) Save(ctx context.Context) error

Save will update or insert the object, depending on the state of the object.

If it has an auto-generated primary key, it will be updated after an insert. Database errors generally will be handled by a panic and not returned here, since those indicate a problem with a database driver or configuration.

Save will return a db.OptimisticLockError if it detects a collision when two users are attempting to change the same database record.

It will return a db.UniqueValueError if it detects a collision when an attempt is made to add a record with a unique column that is given a value that is already in the database.

Updating a record that has not changed will have no effect on the database. Updating a record that has linked records will also update any linked records that are MODIFIED, and if optimistic locking is in effect, will also check whether those records have been altered or deleted, returning an OptimisticLockError if so.

func (*RootN) SetID

func (o *RootN) SetID(v query.AutoPrimaryKey)

SetID sets the value of ID in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the ID value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*RootN) SetLeafNs

func (o *RootN) SetLeafNs(objs ...*LeafN)

SetLeafNs associates the objects in objs with this RootN by setting their RootNID values to this object's primary key. If it has LeafNs already associated with it that will not be associated after a save, the foreign keys for those LeafNs will be set to null. If you did not use a join to query the items in the first place, used a conditional join, or joined with an expansion, be particularly careful, since you may be changing items that are not currently attached to this RootN.

func (*RootN) SetName

func (o *RootN) SetName(v string)

SetName sets the value of Name in the object, to be saved later in the database using the Save() function.

func (*RootN) SetPrimaryKey

func (o *RootN) SetPrimaryKey(v query.AutoPrimaryKey)

SetPrimaryKey sets the value of the primary key in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the primary key value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*RootN) String

func (o *RootN) String() string

String implements the Stringer interface and returns a description of the record, primarily for debugging.

func (*RootN) UnmarshalBinary

func (o *RootN) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary converts a structure that was created with MarshalBinary into a RootN object.

func (*RootN) UnmarshalJSON

func (o *RootN) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON unmarshalls the given json data into the RootN. The RootN can be a newly created object, or one loaded from the database.

After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.

Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.

The fields it expects are:

"id" - query.AutoPrimaryKey
"name" - string

func (*RootN) UnmarshalStringMap

func (o *RootN) UnmarshalStringMap(m map[string]interface{}) (err error)

UnmarshalStringMap will load the values from the stringmap into the object.

Override this in RootN to modify the json before sending it here.

type RootNBuilder

type RootNBuilder struct {
	// contains filtered or unexported fields
}

The RootNBuilder uses a builder pattern to create a query on the database. Create a RootNBuilder by calling QueryRootNs, which will select all the RootN object in the database. Then filter and arrange those objects by calling Where, Select, etc. End a query by calling either Load, LoadI, LoadCursor, Get, or Count. A RootNBuilder stores the context it will use to perform the query, and thus is meant to be a short-lived object. You should not save it for later use.

func QueryRootNs

func QueryRootNs(ctx context.Context) *RootNBuilder

QueryRootNs returns a new query builder. See RootNBuilder for doc on how to use the builder. You should pass a context that has a timeout with it to protect against a long delay from the database possibly hanging your application. You can set a ReadTimeout value on the schema to do this by default during code generation.

func (*RootNBuilder) Calculation

func (b *RootNBuilder) Calculation(base query.TableNodeI, alias string, operation query.OperationNodeI) *RootNBuilder

Calculation adds operation as an aliased value onto base. After the query, you can read the data by passing alias to GetAlias on the returned object.

func (*RootNBuilder) Count

func (b *RootNBuilder) Count() (int, error)

Count terminates a query and returns just the number of items in the result. If you have Select or Calculation columns in the query, it will count NULL results as well. To not count NULL values, use Where in the builder with a NotNull operation. To count distinct combinations of items, call Distinct() on the builder.

func (*RootNBuilder) Distinct

func (b *RootNBuilder) Distinct() *RootNBuilder

Distinct removes duplicates from the results of the query. Adding a Select() is usually required.

func (*RootNBuilder) Get

func (b *RootNBuilder) Get() (*RootN, error)

Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items. If an error occurs, or no results are found, a nil is returned.

func (*RootNBuilder) GroupBy

func (b *RootNBuilder) GroupBy(nodes ...query.Node) *RootNBuilder

GroupBy controls how results are grouped when using aggregate functions with Calculation.

func (*RootNBuilder) Having

func (b *RootNBuilder) Having(node query.Node) *RootNBuilder

Having does additional filtering on the results of the query after the query is performed.

func (*RootNBuilder) Limit

func (b *RootNBuilder) Limit(maxRowCount int, offset int) *RootNBuilder

Limit will return a subset of the data, limited to the offset and number of rows specified. For large data sets and specific types of queries, this can be slow, because it will perform the entire query before computing the limit. You cannot limit a query that has embedded arrays.

func (*RootNBuilder) Load

func (b *RootNBuilder) Load() (rootNs []*RootN, err error)

Load terminates the query builder, performs the query, and returns a slice of RootN objects. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*RootNBuilder) LoadCursor

func (b *RootNBuilder) LoadCursor() (rootNsCursor, error)

LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.

A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.

Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use

defer cursor.Close()

to make sure the cursor gets closed.

func (*RootNBuilder) LoadI

func (b *RootNBuilder) LoadI() (rootNs []query.OrmObj, err error)

LoadI terminates the query builder, performs the query, and returns a slice of interfaces. This can then satisfy a variety of interfaces that load arrays of objects, including KeyLabeler. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*RootNBuilder) OrderBy

func (b *RootNBuilder) OrderBy(nodes ...query.Sorter) *RootNBuilder

OrderBy specifies how the resulting data should be sorted. By default, the given nodes are sorted in ascending order. Add Descending() to the node to specify that it should be sorted in descending order.

func (*RootNBuilder) Select

func (b *RootNBuilder) Select(nodes ...query.Node) *RootNBuilder

Select specifies what specific columns will be loaded with data. By default, all the columns of the root_n table will be queried and loaded. If nodes contains columns from the root_n table, that will limit the columns queried and loaded to only those columns. If related tables are specified, then all the columns from those tables are queried, selected and joined to the result. If columns in related tables are specified, then only those columns will be queried and loaded. Depending on the query, additional columns may automatically be added to the query. In particular, primary key columns will be added in most situations. The exception to this would be in distinct queries, group by queries, or subqueries.

func (*RootNBuilder) Where

func (b *RootNBuilder) Where(c query.Node) *RootNBuilder

Where adds a condition to filter what gets selected. Calling Where multiple times will AND the conditions together.

type RootNl

type RootNl struct {
	// contains filtered or unexported fields
}

RootNl represents an item in the root_nl table in the database.

func LoadRootNl

func LoadRootNl(ctx context.Context, pk query.AutoPrimaryKey, selectNodes ...query.Node) (*RootNl, error)

LoadRootNl returns a RootNl from the database. selectNodes lets you provide nodes for selecting specific fields or additional fields from related tables. See [RootNlsBuilder.Select] for more info.

func NewRootNl

func NewRootNl() *RootNl

NewRootNl creates a new RootNl object and initializes it to default values.

func (*RootNl) Copy

func (o *RootNl) Copy() (newObject *RootNl)

Copy copies most fields to a new RootNl object. Forward reference ids will be copied, but reverse and many-many references will not. Attached objects will not be included in the copy. Automatically generated fields will not be included in the copy. The primary key field will not be copied, since it is normally auto-generated. Call Save() on the new object to save it into the database. Copy might panic if any fields in the database were set to a size larger than the maximum size through a process that accessed the database outside of the ORM.

func (*RootNl) CountLeafNls

func (o *RootNl) CountLeafNls(ctx context.Context) (int, error)

CountLeafNls does a database query and returns the number of LeafNl objects currently in the database that have a RootNlID value that equals this objects primary key.

func (*RootNl) Delete

func (o *RootNl) Delete(ctx context.Context) (err error)

Delete deletes the record from the database.

Associated LeafNl will have their RootNl field set to NULL.

func (*RootNl) Get

func (o *RootNl) Get(key string) interface{}

Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil. Get can be used to retrieve a value by using the Field() of a node.

func (*RootNl) GetAlias

func (o *RootNl) GetAlias(aliasKey string) query.AliasValue

GetAlias returns the value for the Alias node aliasKey that was returned in the most recent query.

func (*RootNl) GroLock

func (o *RootNl) GroLock() int64

GroLock returns the value of the loaded gro_lock field in the database.

func (*RootNl) GroLockIsLoaded

func (o *RootNl) GroLockIsLoaded() bool

GroLockIsLoaded returns true if the value was loaded from the database or has been set.

func (*RootNl) ID

func (o *RootNl) ID() query.AutoPrimaryKey

ID returns the loaded value of the id field in the database.

func (*RootNl) IDIsLoaded

func (o *RootNl) IDIsLoaded() bool

IDIsLoaded returns true if the value was loaded from the database or has been set.

func (*RootNl) Initialize

func (o *RootNl) Initialize()

Initialize will initialize or re-initialize a RootNl database object to default values.

func (*RootNl) IsDirty

func (o *RootNl) IsDirty() (dirty bool)

IsDirty returns true if the object has been changed since it was read from the database or created.

func (*RootNl) IsNew

func (o *RootNl) IsNew() bool

IsNew returns true if the object will create a new record when saved.

func (*RootNl) Key

func (o *RootNl) Key() string

Key returns a unique key for the object, among a list of similar objects.

func (*RootNl) Label

func (o *RootNl) Label() string

Label returns a human-readable label of the object. This would be what a user would see as a description of the object if choosing from a list.

func (*RootNl) LeafNl

func (o *RootNl) LeafNl(pk query.AutoPrimaryKey) *LeafNl

LeafNl returns a single LeafNl object by primary key, if one was loaded. Otherwise, it will return nil. It will not return LeafNl objects that are not saved.

func (*RootNl) LeafNls

func (o *RootNl) LeafNls() []*LeafNl

LeafNls returns a slice of LeafNl objects if loaded.

func (*RootNl) LoadLeafNls

func (o *RootNl) LoadLeafNls(ctx context.Context) ([]*LeafNl, error)

LoadLeafNls loads a new slice of LeafNl objects and returns it.

func (*RootNl) MarshalBinary

func (o *RootNl) MarshalBinary() ([]byte, error)

MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.

func (*RootNl) MarshalJSON

func (o *RootNl) MarshalJSON() (data []byte, err error)

MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.

func (*RootNl) MarshalStringMap

func (o *RootNl) MarshalStringMap() map[string]interface{}

MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.

func (*RootNl) Name

func (o *RootNl) Name() string

Name returns the value of the loaded name field in the database.

func (*RootNl) NameIsLoaded

func (o *RootNl) NameIsLoaded() bool

NameIsLoaded returns true if the value was loaded from the database or has been set.

func (*RootNl) OriginalPrimaryKey

func (o *RootNl) OriginalPrimaryKey() query.AutoPrimaryKey

OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.

func (*RootNl) PrimaryKey

func (o *RootNl) PrimaryKey() query.AutoPrimaryKey

PrimaryKey returns the value of the primary key of the record.

func (*RootNl) Save

func (o *RootNl) Save(ctx context.Context) error

Save will update or insert the object, depending on the state of the object.

If it has an auto-generated primary key, it will be updated after an insert. Database errors generally will be handled by a panic and not returned here, since those indicate a problem with a database driver or configuration.

Save will return a db.OptimisticLockError if it detects a collision when two users are attempting to change the same database record.

It will return a db.UniqueValueError if it detects a collision when an attempt is made to add a record with a unique column that is given a value that is already in the database.

Updating a record that has not changed will have no effect on the database. Updating a record that has linked records will also update any linked records that are MODIFIED, and if optimistic locking is in effect, will also check whether those records have been altered or deleted, returning an OptimisticLockError if so.

func (*RootNl) SetID

func (o *RootNl) SetID(v query.AutoPrimaryKey)

SetID sets the value of ID in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the ID value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*RootNl) SetLeafNls

func (o *RootNl) SetLeafNls(objs ...*LeafNl)

SetLeafNls associates the objects in objs with this RootNl by setting their RootNlID values to this object's primary key. If it has LeafNls already associated with it that will not be associated after a save, the foreign keys for those LeafNls will be set to null. If you did not use a join to query the items in the first place, used a conditional join, or joined with an expansion, be particularly careful, since you may be changing items that are not currently attached to this RootNl.

func (*RootNl) SetName

func (o *RootNl) SetName(v string)

SetName sets the value of Name in the object, to be saved later in the database using the Save() function.

func (*RootNl) SetPrimaryKey

func (o *RootNl) SetPrimaryKey(v query.AutoPrimaryKey)

SetPrimaryKey sets the value of the primary key in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the primary key value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*RootNl) String

func (o *RootNl) String() string

String implements the Stringer interface and returns a description of the record, primarily for debugging.

func (*RootNl) UnmarshalBinary

func (o *RootNl) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary converts a structure that was created with MarshalBinary into a RootNl object.

func (*RootNl) UnmarshalJSON

func (o *RootNl) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON unmarshalls the given json data into the RootNl. The RootNl can be a newly created object, or one loaded from the database.

After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.

Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.

The fields it expects are:

"id" - query.AutoPrimaryKey
"name" - string
"groLock" - int64

func (*RootNl) UnmarshalStringMap

func (o *RootNl) UnmarshalStringMap(m map[string]interface{}) (err error)

UnmarshalStringMap will load the values from the stringmap into the object.

Override this in RootNl to modify the json before sending it here.

type RootNlBuilder

type RootNlBuilder struct {
	// contains filtered or unexported fields
}

The RootNlBuilder uses a builder pattern to create a query on the database. Create a RootNlBuilder by calling QueryRootNls, which will select all the RootNl object in the database. Then filter and arrange those objects by calling Where, Select, etc. End a query by calling either Load, LoadI, LoadCursor, Get, or Count. A RootNlBuilder stores the context it will use to perform the query, and thus is meant to be a short-lived object. You should not save it for later use.

func QueryRootNls

func QueryRootNls(ctx context.Context) *RootNlBuilder

QueryRootNls returns a new query builder. See RootNlBuilder for doc on how to use the builder. You should pass a context that has a timeout with it to protect against a long delay from the database possibly hanging your application. You can set a ReadTimeout value on the schema to do this by default during code generation.

func (*RootNlBuilder) Calculation

func (b *RootNlBuilder) Calculation(base query.TableNodeI, alias string, operation query.OperationNodeI) *RootNlBuilder

Calculation adds operation as an aliased value onto base. After the query, you can read the data by passing alias to GetAlias on the returned object.

func (*RootNlBuilder) Count

func (b *RootNlBuilder) Count() (int, error)

Count terminates a query and returns just the number of items in the result. If you have Select or Calculation columns in the query, it will count NULL results as well. To not count NULL values, use Where in the builder with a NotNull operation. To count distinct combinations of items, call Distinct() on the builder.

func (*RootNlBuilder) Distinct

func (b *RootNlBuilder) Distinct() *RootNlBuilder

Distinct removes duplicates from the results of the query. Adding a Select() is usually required.

func (*RootNlBuilder) Get

func (b *RootNlBuilder) Get() (*RootNl, error)

Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items. If an error occurs, or no results are found, a nil is returned.

func (*RootNlBuilder) GroupBy

func (b *RootNlBuilder) GroupBy(nodes ...query.Node) *RootNlBuilder

GroupBy controls how results are grouped when using aggregate functions with Calculation.

func (*RootNlBuilder) Having

func (b *RootNlBuilder) Having(node query.Node) *RootNlBuilder

Having does additional filtering on the results of the query after the query is performed.

func (*RootNlBuilder) Limit

func (b *RootNlBuilder) Limit(maxRowCount int, offset int) *RootNlBuilder

Limit will return a subset of the data, limited to the offset and number of rows specified. For large data sets and specific types of queries, this can be slow, because it will perform the entire query before computing the limit. You cannot limit a query that has embedded arrays.

func (*RootNlBuilder) Load

func (b *RootNlBuilder) Load() (rootNls []*RootNl, err error)

Load terminates the query builder, performs the query, and returns a slice of RootNl objects. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*RootNlBuilder) LoadCursor

func (b *RootNlBuilder) LoadCursor() (rootNlsCursor, error)

LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.

A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.

Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use

defer cursor.Close()

to make sure the cursor gets closed.

func (*RootNlBuilder) LoadI

func (b *RootNlBuilder) LoadI() (rootNls []query.OrmObj, err error)

LoadI terminates the query builder, performs the query, and returns a slice of interfaces. This can then satisfy a variety of interfaces that load arrays of objects, including KeyLabeler. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*RootNlBuilder) OrderBy

func (b *RootNlBuilder) OrderBy(nodes ...query.Sorter) *RootNlBuilder

OrderBy specifies how the resulting data should be sorted. By default, the given nodes are sorted in ascending order. Add Descending() to the node to specify that it should be sorted in descending order.

func (*RootNlBuilder) Select

func (b *RootNlBuilder) Select(nodes ...query.Node) *RootNlBuilder

Select specifies what specific columns will be loaded with data. By default, all the columns of the root_nl table will be queried and loaded. If nodes contains columns from the root_nl table, that will limit the columns queried and loaded to only those columns. If related tables are specified, then all the columns from those tables are queried, selected and joined to the result. If columns in related tables are specified, then only those columns will be queried and loaded. Depending on the query, additional columns may automatically be added to the query. In particular, primary key columns will be added in most situations. The exception to this would be in distinct queries, group by queries, or subqueries.

func (*RootNlBuilder) Where

func (b *RootNlBuilder) Where(c query.Node) *RootNlBuilder

Where adds a condition to filter what gets selected. Calling Where multiple times will AND the conditions together.

type RootU

type RootU struct {
	// contains filtered or unexported fields
}

RootU represents an item in the root_u table in the database.

func LoadRootU

func LoadRootU(ctx context.Context, pk query.AutoPrimaryKey, selectNodes ...query.Node) (*RootU, error)

LoadRootU returns a RootU from the database. selectNodes lets you provide nodes for selecting specific fields or additional fields from related tables. See [RootUsBuilder.Select] for more info.

func NewRootU

func NewRootU() *RootU

NewRootU creates a new RootU object and initializes it to default values.

func (*RootU) Copy

func (o *RootU) Copy() (newObject *RootU)

Copy copies most fields to a new RootU object. Forward reference ids will be copied, but reverse and many-many references will not. Attached objects will not be included in the copy. Automatically generated fields will not be included in the copy. The primary key field will not be copied, since it is normally auto-generated. Call Save() on the new object to save it into the database. Copy might panic if any fields in the database were set to a size larger than the maximum size through a process that accessed the database outside of the ORM.

func (*RootU) Delete

func (o *RootU) Delete(ctx context.Context) (err error)

Delete deletes the record from the database.

An associated {= rev.ReverseIdentifier will also be deleted since its RootU field is not nullable.

func (*RootU) Get

func (o *RootU) Get(key string) interface{}

Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil. Get can be used to retrieve a value by using the Field() of a node.

func (*RootU) GetAlias

func (o *RootU) GetAlias(aliasKey string) query.AliasValue

GetAlias returns the value for the Alias node aliasKey that was returned in the most recent query.

func (*RootU) ID

func (o *RootU) ID() query.AutoPrimaryKey

ID returns the loaded value of the id field in the database.

func (*RootU) IDIsLoaded

func (o *RootU) IDIsLoaded() bool

IDIsLoaded returns true if the value was loaded from the database or has been set.

func (*RootU) Initialize

func (o *RootU) Initialize()

Initialize will initialize or re-initialize a RootU database object to default values.

func (*RootU) IsDirty

func (o *RootU) IsDirty() (dirty bool)

IsDirty returns true if the object has been changed since it was read from the database or created.

func (*RootU) IsNew

func (o *RootU) IsNew() bool

IsNew returns true if the object will create a new record when saved.

func (*RootU) Key

func (o *RootU) Key() string

Key returns a unique key for the object, among a list of similar objects.

func (*RootU) Label

func (o *RootU) Label() string

Label returns a human-readable label of the object. This would be what a user would see as a description of the object if choosing from a list.

func (*RootU) LeafU

func (o *RootU) LeafU() *LeafU

LeafU returns the connected LeafU object, if one was loaded. Otherwise, it will return nil.

func (*RootU) LoadLeafU

func (o *RootU) LoadLeafU(ctx context.Context) (*LeafU, error)

LoadLeafU returns the connected LeafU object, if one was loaded. Otherwise, it will load a new one and return it.

func (*RootU) MarshalBinary

func (o *RootU) MarshalBinary() ([]byte, error)

MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.

func (*RootU) MarshalJSON

func (o *RootU) MarshalJSON() (data []byte, err error)

MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.

func (*RootU) MarshalStringMap

func (o *RootU) MarshalStringMap() map[string]interface{}

MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.

func (*RootU) Name

func (o *RootU) Name() string

Name returns the value of the loaded name field in the database.

func (*RootU) NameIsLoaded

func (o *RootU) NameIsLoaded() bool

NameIsLoaded returns true if the value was loaded from the database or has been set.

func (*RootU) OriginalPrimaryKey

func (o *RootU) OriginalPrimaryKey() query.AutoPrimaryKey

OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.

func (*RootU) PrimaryKey

func (o *RootU) PrimaryKey() query.AutoPrimaryKey

PrimaryKey returns the value of the primary key of the record.

func (*RootU) Save

func (o *RootU) Save(ctx context.Context) error

Save will update or insert the object, depending on the state of the object.

If it has an auto-generated primary key, it will be updated after an insert. Database errors generally will be handled by a panic and not returned here, since those indicate a problem with a database driver or configuration.

Save will return a db.OptimisticLockError if it detects a collision when two users are attempting to change the same database record.

It will return a db.UniqueValueError if it detects a collision when an attempt is made to add a record with a unique column that is given a value that is already in the database.

Updating a record that has not changed will have no effect on the database. Updating a record that has linked records will also update any linked records that are MODIFIED, and if optimistic locking is in effect, will also check whether those records have been altered or deleted, returning an OptimisticLockError if so.

func (*RootU) SetID

func (o *RootU) SetID(v query.AutoPrimaryKey)

SetID sets the value of ID in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the ID value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*RootU) SetLeafU

func (o *RootU) SetLeafU(obj *LeafU)

SetLeafU associates obj with this RootU through the reverse relationship in LeafU.RootU.

The association is temporary until you call Save(). WARNING! Since this is a non-nullable unique relationship, if a different LeafU object is currently pointing to this RootU, it will be deleted. Pass nil to just delete the old object.

func (*RootU) SetName

func (o *RootU) SetName(v string)

SetName sets the value of Name in the object, to be saved later in the database using the Save() function.

func (*RootU) SetPrimaryKey

func (o *RootU) SetPrimaryKey(v query.AutoPrimaryKey)

SetPrimaryKey sets the value of the primary key in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the primary key value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*RootU) String

func (o *RootU) String() string

String implements the Stringer interface and returns a description of the record, primarily for debugging.

func (*RootU) UnmarshalBinary

func (o *RootU) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary converts a structure that was created with MarshalBinary into a RootU object.

func (*RootU) UnmarshalJSON

func (o *RootU) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON unmarshalls the given json data into the RootU. The RootU can be a newly created object, or one loaded from the database.

After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.

Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.

The fields it expects are:

"id" - query.AutoPrimaryKey
"name" - string

func (*RootU) UnmarshalStringMap

func (o *RootU) UnmarshalStringMap(m map[string]interface{}) (err error)

UnmarshalStringMap will load the values from the stringmap into the object.

Override this in RootU to modify the json before sending it here.

type RootUBuilder

type RootUBuilder struct {
	// contains filtered or unexported fields
}

The RootUBuilder uses a builder pattern to create a query on the database. Create a RootUBuilder by calling QueryRootUs, which will select all the RootU object in the database. Then filter and arrange those objects by calling Where, Select, etc. End a query by calling either Load, LoadI, LoadCursor, Get, or Count. A RootUBuilder stores the context it will use to perform the query, and thus is meant to be a short-lived object. You should not save it for later use.

func QueryRootUs

func QueryRootUs(ctx context.Context) *RootUBuilder

QueryRootUs returns a new query builder. See RootUBuilder for doc on how to use the builder. You should pass a context that has a timeout with it to protect against a long delay from the database possibly hanging your application. You can set a ReadTimeout value on the schema to do this by default during code generation.

func (*RootUBuilder) Calculation

func (b *RootUBuilder) Calculation(base query.TableNodeI, alias string, operation query.OperationNodeI) *RootUBuilder

Calculation adds operation as an aliased value onto base. After the query, you can read the data by passing alias to GetAlias on the returned object.

func (*RootUBuilder) Count

func (b *RootUBuilder) Count() (int, error)

Count terminates a query and returns just the number of items in the result. If you have Select or Calculation columns in the query, it will count NULL results as well. To not count NULL values, use Where in the builder with a NotNull operation. To count distinct combinations of items, call Distinct() on the builder.

func (*RootUBuilder) Distinct

func (b *RootUBuilder) Distinct() *RootUBuilder

Distinct removes duplicates from the results of the query. Adding a Select() is usually required.

func (*RootUBuilder) Get

func (b *RootUBuilder) Get() (*RootU, error)

Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items. If an error occurs, or no results are found, a nil is returned.

func (*RootUBuilder) GroupBy

func (b *RootUBuilder) GroupBy(nodes ...query.Node) *RootUBuilder

GroupBy controls how results are grouped when using aggregate functions with Calculation.

func (*RootUBuilder) Having

func (b *RootUBuilder) Having(node query.Node) *RootUBuilder

Having does additional filtering on the results of the query after the query is performed.

func (*RootUBuilder) Limit

func (b *RootUBuilder) Limit(maxRowCount int, offset int) *RootUBuilder

Limit will return a subset of the data, limited to the offset and number of rows specified. For large data sets and specific types of queries, this can be slow, because it will perform the entire query before computing the limit. You cannot limit a query that has embedded arrays.

func (*RootUBuilder) Load

func (b *RootUBuilder) Load() (rootUs []*RootU, err error)

Load terminates the query builder, performs the query, and returns a slice of RootU objects. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*RootUBuilder) LoadCursor

func (b *RootUBuilder) LoadCursor() (rootUsCursor, error)

LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.

A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.

Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use

defer cursor.Close()

to make sure the cursor gets closed.

func (*RootUBuilder) LoadI

func (b *RootUBuilder) LoadI() (rootUs []query.OrmObj, err error)

LoadI terminates the query builder, performs the query, and returns a slice of interfaces. This can then satisfy a variety of interfaces that load arrays of objects, including KeyLabeler. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*RootUBuilder) OrderBy

func (b *RootUBuilder) OrderBy(nodes ...query.Sorter) *RootUBuilder

OrderBy specifies how the resulting data should be sorted. By default, the given nodes are sorted in ascending order. Add Descending() to the node to specify that it should be sorted in descending order.

func (*RootUBuilder) Select

func (b *RootUBuilder) Select(nodes ...query.Node) *RootUBuilder

Select specifies what specific columns will be loaded with data. By default, all the columns of the root_u table will be queried and loaded. If nodes contains columns from the root_u table, that will limit the columns queried and loaded to only those columns. If related tables are specified, then all the columns from those tables are queried, selected and joined to the result. If columns in related tables are specified, then only those columns will be queried and loaded. Depending on the query, additional columns may automatically be added to the query. In particular, primary key columns will be added in most situations. The exception to this would be in distinct queries, group by queries, or subqueries.

func (*RootUBuilder) Where

func (b *RootUBuilder) Where(c query.Node) *RootUBuilder

Where adds a condition to filter what gets selected. Calling Where multiple times will AND the conditions together.

type RootUl

type RootUl struct {
	// contains filtered or unexported fields
}

RootUl represents an item in the root_ul table in the database.

func LoadRootUl

func LoadRootUl(ctx context.Context, pk query.AutoPrimaryKey, selectNodes ...query.Node) (*RootUl, error)

LoadRootUl returns a RootUl from the database. selectNodes lets you provide nodes for selecting specific fields or additional fields from related tables. See [RootUlsBuilder.Select] for more info.

func NewRootUl

func NewRootUl() *RootUl

NewRootUl creates a new RootUl object and initializes it to default values.

func (*RootUl) Copy

func (o *RootUl) Copy() (newObject *RootUl)

Copy copies most fields to a new RootUl object. Forward reference ids will be copied, but reverse and many-many references will not. Attached objects will not be included in the copy. Automatically generated fields will not be included in the copy. The primary key field will not be copied, since it is normally auto-generated. Call Save() on the new object to save it into the database. Copy might panic if any fields in the database were set to a size larger than the maximum size through a process that accessed the database outside of the ORM.

func (*RootUl) Delete

func (o *RootUl) Delete(ctx context.Context) (err error)

Delete deletes the record from the database.

An associated {= rev.ReverseIdentifier will also be deleted since its RootUl field is not nullable.

func (*RootUl) Get

func (o *RootUl) Get(key string) interface{}

Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil. Get can be used to retrieve a value by using the Field() of a node.

func (*RootUl) GetAlias

func (o *RootUl) GetAlias(aliasKey string) query.AliasValue

GetAlias returns the value for the Alias node aliasKey that was returned in the most recent query.

func (*RootUl) GroLock

func (o *RootUl) GroLock() int64

GroLock returns the value of the loaded gro_lock field in the database.

func (*RootUl) GroLockIsLoaded

func (o *RootUl) GroLockIsLoaded() bool

GroLockIsLoaded returns true if the value was loaded from the database or has been set.

func (*RootUl) ID

func (o *RootUl) ID() query.AutoPrimaryKey

ID returns the loaded value of the id field in the database.

func (*RootUl) IDIsLoaded

func (o *RootUl) IDIsLoaded() bool

IDIsLoaded returns true if the value was loaded from the database or has been set.

func (*RootUl) Initialize

func (o *RootUl) Initialize()

Initialize will initialize or re-initialize a RootUl database object to default values.

func (*RootUl) IsDirty

func (o *RootUl) IsDirty() (dirty bool)

IsDirty returns true if the object has been changed since it was read from the database or created.

func (*RootUl) IsNew

func (o *RootUl) IsNew() bool

IsNew returns true if the object will create a new record when saved.

func (*RootUl) Key

func (o *RootUl) Key() string

Key returns a unique key for the object, among a list of similar objects.

func (*RootUl) Label

func (o *RootUl) Label() string

Label returns a human-readable label of the object. This would be what a user would see as a description of the object if choosing from a list.

func (*RootUl) LeafUl

func (o *RootUl) LeafUl() *LeafUl

LeafUl returns the connected LeafUl object, if one was loaded. Otherwise, it will return nil.

func (*RootUl) LoadLeafUl

func (o *RootUl) LoadLeafUl(ctx context.Context) (*LeafUl, error)

LoadLeafUl returns the connected LeafUl object, if one was loaded. Otherwise, it will load a new one and return it.

func (*RootUl) MarshalBinary

func (o *RootUl) MarshalBinary() ([]byte, error)

MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.

func (*RootUl) MarshalJSON

func (o *RootUl) MarshalJSON() (data []byte, err error)

MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.

func (*RootUl) MarshalStringMap

func (o *RootUl) MarshalStringMap() map[string]interface{}

MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.

func (*RootUl) Name

func (o *RootUl) Name() string

Name returns the value of the loaded name field in the database.

func (*RootUl) NameIsLoaded

func (o *RootUl) NameIsLoaded() bool

NameIsLoaded returns true if the value was loaded from the database or has been set.

func (*RootUl) OriginalPrimaryKey

func (o *RootUl) OriginalPrimaryKey() query.AutoPrimaryKey

OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.

func (*RootUl) PrimaryKey

func (o *RootUl) PrimaryKey() query.AutoPrimaryKey

PrimaryKey returns the value of the primary key of the record.

func (*RootUl) Save

func (o *RootUl) Save(ctx context.Context) error

Save will update or insert the object, depending on the state of the object.

If it has an auto-generated primary key, it will be updated after an insert. Database errors generally will be handled by a panic and not returned here, since those indicate a problem with a database driver or configuration.

Save will return a db.OptimisticLockError if it detects a collision when two users are attempting to change the same database record.

It will return a db.UniqueValueError if it detects a collision when an attempt is made to add a record with a unique column that is given a value that is already in the database.

Updating a record that has not changed will have no effect on the database. Updating a record that has linked records will also update any linked records that are MODIFIED, and if optimistic locking is in effect, will also check whether those records have been altered or deleted, returning an OptimisticLockError if so.

func (*RootUl) SetID

func (o *RootUl) SetID(v query.AutoPrimaryKey)

SetID sets the value of ID in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the ID value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*RootUl) SetLeafUl

func (o *RootUl) SetLeafUl(obj *LeafUl)

SetLeafUl associates obj with this RootUl through the reverse relationship in LeafUl.RootUl.

The association is temporary until you call Save(). WARNING! Since this is a non-nullable unique relationship, if a different LeafUl object is currently pointing to this RootUl, it will be deleted. Pass nil to just delete the old object.

func (*RootUl) SetName

func (o *RootUl) SetName(v string)

SetName sets the value of Name in the object, to be saved later in the database using the Save() function.

func (*RootUl) SetPrimaryKey

func (o *RootUl) SetPrimaryKey(v query.AutoPrimaryKey)

SetPrimaryKey sets the value of the primary key in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the primary key value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*RootUl) String

func (o *RootUl) String() string

String implements the Stringer interface and returns a description of the record, primarily for debugging.

func (*RootUl) UnmarshalBinary

func (o *RootUl) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary converts a structure that was created with MarshalBinary into a RootUl object.

func (*RootUl) UnmarshalJSON

func (o *RootUl) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON unmarshalls the given json data into the RootUl. The RootUl can be a newly created object, or one loaded from the database.

After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.

Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.

The fields it expects are:

"id" - query.AutoPrimaryKey
"name" - string
"groLock" - int64

func (*RootUl) UnmarshalStringMap

func (o *RootUl) UnmarshalStringMap(m map[string]interface{}) (err error)

UnmarshalStringMap will load the values from the stringmap into the object.

Override this in RootUl to modify the json before sending it here.

type RootUlBuilder

type RootUlBuilder struct {
	// contains filtered or unexported fields
}

The RootUlBuilder uses a builder pattern to create a query on the database. Create a RootUlBuilder by calling QueryRootUls, which will select all the RootUl object in the database. Then filter and arrange those objects by calling Where, Select, etc. End a query by calling either Load, LoadI, LoadCursor, Get, or Count. A RootUlBuilder stores the context it will use to perform the query, and thus is meant to be a short-lived object. You should not save it for later use.

func QueryRootUls

func QueryRootUls(ctx context.Context) *RootUlBuilder

QueryRootUls returns a new query builder. See RootUlBuilder for doc on how to use the builder. You should pass a context that has a timeout with it to protect against a long delay from the database possibly hanging your application. You can set a ReadTimeout value on the schema to do this by default during code generation.

func (*RootUlBuilder) Calculation

func (b *RootUlBuilder) Calculation(base query.TableNodeI, alias string, operation query.OperationNodeI) *RootUlBuilder

Calculation adds operation as an aliased value onto base. After the query, you can read the data by passing alias to GetAlias on the returned object.

func (*RootUlBuilder) Count

func (b *RootUlBuilder) Count() (int, error)

Count terminates a query and returns just the number of items in the result. If you have Select or Calculation columns in the query, it will count NULL results as well. To not count NULL values, use Where in the builder with a NotNull operation. To count distinct combinations of items, call Distinct() on the builder.

func (*RootUlBuilder) Distinct

func (b *RootUlBuilder) Distinct() *RootUlBuilder

Distinct removes duplicates from the results of the query. Adding a Select() is usually required.

func (*RootUlBuilder) Get

func (b *RootUlBuilder) Get() (*RootUl, error)

Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items. If an error occurs, or no results are found, a nil is returned.

func (*RootUlBuilder) GroupBy

func (b *RootUlBuilder) GroupBy(nodes ...query.Node) *RootUlBuilder

GroupBy controls how results are grouped when using aggregate functions with Calculation.

func (*RootUlBuilder) Having

func (b *RootUlBuilder) Having(node query.Node) *RootUlBuilder

Having does additional filtering on the results of the query after the query is performed.

func (*RootUlBuilder) Limit

func (b *RootUlBuilder) Limit(maxRowCount int, offset int) *RootUlBuilder

Limit will return a subset of the data, limited to the offset and number of rows specified. For large data sets and specific types of queries, this can be slow, because it will perform the entire query before computing the limit. You cannot limit a query that has embedded arrays.

func (*RootUlBuilder) Load

func (b *RootUlBuilder) Load() (rootUls []*RootUl, err error)

Load terminates the query builder, performs the query, and returns a slice of RootUl objects. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*RootUlBuilder) LoadCursor

func (b *RootUlBuilder) LoadCursor() (rootUlsCursor, error)

LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.

A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.

Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use

defer cursor.Close()

to make sure the cursor gets closed.

func (*RootUlBuilder) LoadI

func (b *RootUlBuilder) LoadI() (rootUls []query.OrmObj, err error)

LoadI terminates the query builder, performs the query, and returns a slice of interfaces. This can then satisfy a variety of interfaces that load arrays of objects, including KeyLabeler. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*RootUlBuilder) OrderBy

func (b *RootUlBuilder) OrderBy(nodes ...query.Sorter) *RootUlBuilder

OrderBy specifies how the resulting data should be sorted. By default, the given nodes are sorted in ascending order. Add Descending() to the node to specify that it should be sorted in descending order.

func (*RootUlBuilder) Select

func (b *RootUlBuilder) Select(nodes ...query.Node) *RootUlBuilder

Select specifies what specific columns will be loaded with data. By default, all the columns of the root_ul table will be queried and loaded. If nodes contains columns from the root_ul table, that will limit the columns queried and loaded to only those columns. If related tables are specified, then all the columns from those tables are queried, selected and joined to the result. If columns in related tables are specified, then only those columns will be queried and loaded. Depending on the query, additional columns may automatically be added to the query. In particular, primary key columns will be added in most situations. The exception to this would be in distinct queries, group by queries, or subqueries.

func (*RootUlBuilder) Where

func (b *RootUlBuilder) Where(c query.Node) *RootUlBuilder

Where adds a condition to filter what gets selected. Calling Where multiple times will AND the conditions together.

type RootUn

type RootUn struct {
	// contains filtered or unexported fields
}

RootUn represents an item in the root_un table in the database.

func LoadRootUn

func LoadRootUn(ctx context.Context, pk query.AutoPrimaryKey, selectNodes ...query.Node) (*RootUn, error)

LoadRootUn returns a RootUn from the database. selectNodes lets you provide nodes for selecting specific fields or additional fields from related tables. See [RootUnsBuilder.Select] for more info.

func NewRootUn

func NewRootUn() *RootUn

NewRootUn creates a new RootUn object and initializes it to default values.

func (*RootUn) Copy

func (o *RootUn) Copy() (newObject *RootUn)

Copy copies most fields to a new RootUn object. Forward reference ids will be copied, but reverse and many-many references will not. Attached objects will not be included in the copy. Automatically generated fields will not be included in the copy. The primary key field will not be copied, since it is normally auto-generated. Call Save() on the new object to save it into the database. Copy might panic if any fields in the database were set to a size larger than the maximum size through a process that accessed the database outside of the ORM.

func (*RootUn) Delete

func (o *RootUn) Delete(ctx context.Context) (err error)

Delete deletes the record from the database.

An associated LeafUn will have its RootUn field set to NULL.

func (*RootUn) Get

func (o *RootUn) Get(key string) interface{}

Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil. Get can be used to retrieve a value by using the Field() of a node.

func (*RootUn) GetAlias

func (o *RootUn) GetAlias(aliasKey string) query.AliasValue

GetAlias returns the value for the Alias node aliasKey that was returned in the most recent query.

func (*RootUn) ID

func (o *RootUn) ID() query.AutoPrimaryKey

ID returns the loaded value of the id field in the database.

func (*RootUn) IDIsLoaded

func (o *RootUn) IDIsLoaded() bool

IDIsLoaded returns true if the value was loaded from the database or has been set.

func (*RootUn) Initialize

func (o *RootUn) Initialize()

Initialize will initialize or re-initialize a RootUn database object to default values.

func (*RootUn) IsDirty

func (o *RootUn) IsDirty() (dirty bool)

IsDirty returns true if the object has been changed since it was read from the database or created.

func (*RootUn) IsNew

func (o *RootUn) IsNew() bool

IsNew returns true if the object will create a new record when saved.

func (*RootUn) Key

func (o *RootUn) Key() string

Key returns a unique key for the object, among a list of similar objects.

func (*RootUn) Label

func (o *RootUn) Label() string

Label returns a human-readable label of the object. This would be what a user would see as a description of the object if choosing from a list.

func (*RootUn) LeafUn

func (o *RootUn) LeafUn() *LeafUn

LeafUn returns the connected LeafUn object, if one was loaded. Otherwise, it will return nil.

func (*RootUn) LoadLeafUn

func (o *RootUn) LoadLeafUn(ctx context.Context) (*LeafUn, error)

LoadLeafUn returns the connected LeafUn object, if one was loaded. Otherwise, it will load a new one and return it.

func (*RootUn) MarshalBinary

func (o *RootUn) MarshalBinary() ([]byte, error)

MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.

func (*RootUn) MarshalJSON

func (o *RootUn) MarshalJSON() (data []byte, err error)

MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.

func (*RootUn) MarshalStringMap

func (o *RootUn) MarshalStringMap() map[string]interface{}

MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.

func (*RootUn) Name

func (o *RootUn) Name() string

Name returns the value of the loaded name field in the database.

func (*RootUn) NameIsLoaded

func (o *RootUn) NameIsLoaded() bool

NameIsLoaded returns true if the value was loaded from the database or has been set.

func (*RootUn) OriginalPrimaryKey

func (o *RootUn) OriginalPrimaryKey() query.AutoPrimaryKey

OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.

func (*RootUn) PrimaryKey

func (o *RootUn) PrimaryKey() query.AutoPrimaryKey

PrimaryKey returns the value of the primary key of the record.

func (*RootUn) Save

func (o *RootUn) Save(ctx context.Context) error

Save will update or insert the object, depending on the state of the object.

If it has an auto-generated primary key, it will be updated after an insert. Database errors generally will be handled by a panic and not returned here, since those indicate a problem with a database driver or configuration.

Save will return a db.OptimisticLockError if it detects a collision when two users are attempting to change the same database record.

It will return a db.UniqueValueError if it detects a collision when an attempt is made to add a record with a unique column that is given a value that is already in the database.

Updating a record that has not changed will have no effect on the database. Updating a record that has linked records will also update any linked records that are MODIFIED, and if optimistic locking is in effect, will also check whether those records have been altered or deleted, returning an OptimisticLockError if so.

func (*RootUn) SetID

func (o *RootUn) SetID(v query.AutoPrimaryKey)

SetID sets the value of ID in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the ID value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*RootUn) SetLeafUn

func (o *RootUn) SetLeafUn(obj *LeafUn)

SetLeafUn associates obj with this RootUn through the reverse relationship in LeafUn.RootUn.

The association is temporary until you call Save(). Since this is a unique relationship, if a different LeafUn object is currently pointing to this RootUn, that LeafUn's RootUn value will be set to null when Save is called. If you did not use a join to query the attached LeafUn in the first place, used a conditional join, or joined with an expansion, be particularly careful, since you may be inadvertently changing an item that is not currently attached to this RootUn.

func (*RootUn) SetName

func (o *RootUn) SetName(v string)

SetName sets the value of Name in the object, to be saved later in the database using the Save() function.

func (*RootUn) SetPrimaryKey

func (o *RootUn) SetPrimaryKey(v query.AutoPrimaryKey)

SetPrimaryKey sets the value of the primary key in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the primary key value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*RootUn) String

func (o *RootUn) String() string

String implements the Stringer interface and returns a description of the record, primarily for debugging.

func (*RootUn) UnmarshalBinary

func (o *RootUn) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary converts a structure that was created with MarshalBinary into a RootUn object.

func (*RootUn) UnmarshalJSON

func (o *RootUn) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON unmarshalls the given json data into the RootUn. The RootUn can be a newly created object, or one loaded from the database.

After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.

Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.

The fields it expects are:

"id" - query.AutoPrimaryKey
"name" - string

func (*RootUn) UnmarshalStringMap

func (o *RootUn) UnmarshalStringMap(m map[string]interface{}) (err error)

UnmarshalStringMap will load the values from the stringmap into the object.

Override this in RootUn to modify the json before sending it here.

type RootUnBuilder

type RootUnBuilder struct {
	// contains filtered or unexported fields
}

The RootUnBuilder uses a builder pattern to create a query on the database. Create a RootUnBuilder by calling QueryRootUns, which will select all the RootUn object in the database. Then filter and arrange those objects by calling Where, Select, etc. End a query by calling either Load, LoadI, LoadCursor, Get, or Count. A RootUnBuilder stores the context it will use to perform the query, and thus is meant to be a short-lived object. You should not save it for later use.

func QueryRootUns

func QueryRootUns(ctx context.Context) *RootUnBuilder

QueryRootUns returns a new query builder. See RootUnBuilder for doc on how to use the builder. You should pass a context that has a timeout with it to protect against a long delay from the database possibly hanging your application. You can set a ReadTimeout value on the schema to do this by default during code generation.

func (*RootUnBuilder) Calculation

func (b *RootUnBuilder) Calculation(base query.TableNodeI, alias string, operation query.OperationNodeI) *RootUnBuilder

Calculation adds operation as an aliased value onto base. After the query, you can read the data by passing alias to GetAlias on the returned object.

func (*RootUnBuilder) Count

func (b *RootUnBuilder) Count() (int, error)

Count terminates a query and returns just the number of items in the result. If you have Select or Calculation columns in the query, it will count NULL results as well. To not count NULL values, use Where in the builder with a NotNull operation. To count distinct combinations of items, call Distinct() on the builder.

func (*RootUnBuilder) Distinct

func (b *RootUnBuilder) Distinct() *RootUnBuilder

Distinct removes duplicates from the results of the query. Adding a Select() is usually required.

func (*RootUnBuilder) Get

func (b *RootUnBuilder) Get() (*RootUn, error)

Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items. If an error occurs, or no results are found, a nil is returned.

func (*RootUnBuilder) GroupBy

func (b *RootUnBuilder) GroupBy(nodes ...query.Node) *RootUnBuilder

GroupBy controls how results are grouped when using aggregate functions with Calculation.

func (*RootUnBuilder) Having

func (b *RootUnBuilder) Having(node query.Node) *RootUnBuilder

Having does additional filtering on the results of the query after the query is performed.

func (*RootUnBuilder) Limit

func (b *RootUnBuilder) Limit(maxRowCount int, offset int) *RootUnBuilder

Limit will return a subset of the data, limited to the offset and number of rows specified. For large data sets and specific types of queries, this can be slow, because it will perform the entire query before computing the limit. You cannot limit a query that has embedded arrays.

func (*RootUnBuilder) Load

func (b *RootUnBuilder) Load() (rootUns []*RootUn, err error)

Load terminates the query builder, performs the query, and returns a slice of RootUn objects. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*RootUnBuilder) LoadCursor

func (b *RootUnBuilder) LoadCursor() (rootUnsCursor, error)

LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.

A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.

Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use

defer cursor.Close()

to make sure the cursor gets closed.

func (*RootUnBuilder) LoadI

func (b *RootUnBuilder) LoadI() (rootUns []query.OrmObj, err error)

LoadI terminates the query builder, performs the query, and returns a slice of interfaces. This can then satisfy a variety of interfaces that load arrays of objects, including KeyLabeler. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*RootUnBuilder) OrderBy

func (b *RootUnBuilder) OrderBy(nodes ...query.Sorter) *RootUnBuilder

OrderBy specifies how the resulting data should be sorted. By default, the given nodes are sorted in ascending order. Add Descending() to the node to specify that it should be sorted in descending order.

func (*RootUnBuilder) Select

func (b *RootUnBuilder) Select(nodes ...query.Node) *RootUnBuilder

Select specifies what specific columns will be loaded with data. By default, all the columns of the root_un table will be queried and loaded. If nodes contains columns from the root_un table, that will limit the columns queried and loaded to only those columns. If related tables are specified, then all the columns from those tables are queried, selected and joined to the result. If columns in related tables are specified, then only those columns will be queried and loaded. Depending on the query, additional columns may automatically be added to the query. In particular, primary key columns will be added in most situations. The exception to this would be in distinct queries, group by queries, or subqueries.

func (*RootUnBuilder) Where

func (b *RootUnBuilder) Where(c query.Node) *RootUnBuilder

Where adds a condition to filter what gets selected. Calling Where multiple times will AND the conditions together.

type RootUnl

type RootUnl struct {
	// contains filtered or unexported fields
}

RootUnl represents an item in the root_unl table in the database.

func LoadRootUnl

func LoadRootUnl(ctx context.Context, pk query.AutoPrimaryKey, selectNodes ...query.Node) (*RootUnl, error)

LoadRootUnl returns a RootUnl from the database. selectNodes lets you provide nodes for selecting specific fields or additional fields from related tables. See [RootUnlsBuilder.Select] for more info.

func NewRootUnl

func NewRootUnl() *RootUnl

NewRootUnl creates a new RootUnl object and initializes it to default values.

func (*RootUnl) Copy

func (o *RootUnl) Copy() (newObject *RootUnl)

Copy copies most fields to a new RootUnl object. Forward reference ids will be copied, but reverse and many-many references will not. Attached objects will not be included in the copy. Automatically generated fields will not be included in the copy. The primary key field will not be copied, since it is normally auto-generated. Call Save() on the new object to save it into the database. Copy might panic if any fields in the database were set to a size larger than the maximum size through a process that accessed the database outside of the ORM.

func (*RootUnl) Delete

func (o *RootUnl) Delete(ctx context.Context) (err error)

Delete deletes the record from the database.

An associated LeafUnl will have its RootUnl field set to NULL.

func (*RootUnl) Get

func (o *RootUnl) Get(key string) interface{}

Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil. Get can be used to retrieve a value by using the Field() of a node.

func (*RootUnl) GetAlias

func (o *RootUnl) GetAlias(aliasKey string) query.AliasValue

GetAlias returns the value for the Alias node aliasKey that was returned in the most recent query.

func (*RootUnl) GroLock

func (o *RootUnl) GroLock() int64

GroLock returns the value of the loaded gro_lock field in the database.

func (*RootUnl) GroLockIsLoaded

func (o *RootUnl) GroLockIsLoaded() bool

GroLockIsLoaded returns true if the value was loaded from the database or has been set.

func (*RootUnl) ID

func (o *RootUnl) ID() query.AutoPrimaryKey

ID returns the loaded value of the id field in the database.

func (*RootUnl) IDIsLoaded

func (o *RootUnl) IDIsLoaded() bool

IDIsLoaded returns true if the value was loaded from the database or has been set.

func (*RootUnl) Initialize

func (o *RootUnl) Initialize()

Initialize will initialize or re-initialize a RootUnl database object to default values.

func (*RootUnl) IsDirty

func (o *RootUnl) IsDirty() (dirty bool)

IsDirty returns true if the object has been changed since it was read from the database or created.

func (*RootUnl) IsNew

func (o *RootUnl) IsNew() bool

IsNew returns true if the object will create a new record when saved.

func (*RootUnl) Key

func (o *RootUnl) Key() string

Key returns a unique key for the object, among a list of similar objects.

func (*RootUnl) Label

func (o *RootUnl) Label() string

Label returns a human-readable label of the object. This would be what a user would see as a description of the object if choosing from a list.

func (*RootUnl) LeafUnl

func (o *RootUnl) LeafUnl() *LeafUnl

LeafUnl returns the connected LeafUnl object, if one was loaded. Otherwise, it will return nil.

func (*RootUnl) LoadLeafUnl

func (o *RootUnl) LoadLeafUnl(ctx context.Context) (*LeafUnl, error)

LoadLeafUnl returns the connected LeafUnl object, if one was loaded. Otherwise, it will load a new one and return it.

func (*RootUnl) MarshalBinary

func (o *RootUnl) MarshalBinary() ([]byte, error)

MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.

func (*RootUnl) MarshalJSON

func (o *RootUnl) MarshalJSON() (data []byte, err error)

MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.

func (*RootUnl) MarshalStringMap

func (o *RootUnl) MarshalStringMap() map[string]interface{}

MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.

func (*RootUnl) Name

func (o *RootUnl) Name() string

Name returns the value of the loaded name field in the database.

func (*RootUnl) NameIsLoaded

func (o *RootUnl) NameIsLoaded() bool

NameIsLoaded returns true if the value was loaded from the database or has been set.

func (*RootUnl) OriginalPrimaryKey

func (o *RootUnl) OriginalPrimaryKey() query.AutoPrimaryKey

OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.

func (*RootUnl) PrimaryKey

func (o *RootUnl) PrimaryKey() query.AutoPrimaryKey

PrimaryKey returns the value of the primary key of the record.

func (*RootUnl) Save

func (o *RootUnl) Save(ctx context.Context) error

Save will update or insert the object, depending on the state of the object.

If it has an auto-generated primary key, it will be updated after an insert. Database errors generally will be handled by a panic and not returned here, since those indicate a problem with a database driver or configuration.

Save will return a db.OptimisticLockError if it detects a collision when two users are attempting to change the same database record.

It will return a db.UniqueValueError if it detects a collision when an attempt is made to add a record with a unique column that is given a value that is already in the database.

Updating a record that has not changed will have no effect on the database. Updating a record that has linked records will also update any linked records that are MODIFIED, and if optimistic locking is in effect, will also check whether those records have been altered or deleted, returning an OptimisticLockError if so.

func (*RootUnl) SetID

func (o *RootUnl) SetID(v query.AutoPrimaryKey)

SetID sets the value of ID in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the ID value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*RootUnl) SetLeafUnl

func (o *RootUnl) SetLeafUnl(obj *LeafUnl)

SetLeafUnl associates obj with this RootUnl through the reverse relationship in LeafUnl.RootUnl.

The association is temporary until you call Save(). Since this is a unique relationship, if a different LeafUnl object is currently pointing to this RootUnl, that LeafUnl's RootUnl value will be set to null when Save is called. If you did not use a join to query the attached LeafUnl in the first place, used a conditional join, or joined with an expansion, be particularly careful, since you may be inadvertently changing an item that is not currently attached to this RootUnl.

func (*RootUnl) SetName

func (o *RootUnl) SetName(v string)

SetName sets the value of Name in the object, to be saved later in the database using the Save() function.

func (*RootUnl) SetPrimaryKey

func (o *RootUnl) SetPrimaryKey(v query.AutoPrimaryKey)

SetPrimaryKey sets the value of the primary key in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the primary key value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*RootUnl) String

func (o *RootUnl) String() string

String implements the Stringer interface and returns a description of the record, primarily for debugging.

func (*RootUnl) UnmarshalBinary

func (o *RootUnl) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary converts a structure that was created with MarshalBinary into a RootUnl object.

func (*RootUnl) UnmarshalJSON

func (o *RootUnl) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON unmarshalls the given json data into the RootUnl. The RootUnl can be a newly created object, or one loaded from the database.

After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.

Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.

The fields it expects are:

"id" - query.AutoPrimaryKey
"name" - string
"groLock" - int64

func (*RootUnl) UnmarshalStringMap

func (o *RootUnl) UnmarshalStringMap(m map[string]interface{}) (err error)

UnmarshalStringMap will load the values from the stringmap into the object.

Override this in RootUnl to modify the json before sending it here.

type RootUnlBuilder

type RootUnlBuilder struct {
	// contains filtered or unexported fields
}

The RootUnlBuilder uses a builder pattern to create a query on the database. Create a RootUnlBuilder by calling QueryRootUnls, which will select all the RootUnl object in the database. Then filter and arrange those objects by calling Where, Select, etc. End a query by calling either Load, LoadI, LoadCursor, Get, or Count. A RootUnlBuilder stores the context it will use to perform the query, and thus is meant to be a short-lived object. You should not save it for later use.

func QueryRootUnls

func QueryRootUnls(ctx context.Context) *RootUnlBuilder

QueryRootUnls returns a new query builder. See RootUnlBuilder for doc on how to use the builder. You should pass a context that has a timeout with it to protect against a long delay from the database possibly hanging your application. You can set a ReadTimeout value on the schema to do this by default during code generation.

func (*RootUnlBuilder) Calculation

func (b *RootUnlBuilder) Calculation(base query.TableNodeI, alias string, operation query.OperationNodeI) *RootUnlBuilder

Calculation adds operation as an aliased value onto base. After the query, you can read the data by passing alias to GetAlias on the returned object.

func (*RootUnlBuilder) Count

func (b *RootUnlBuilder) Count() (int, error)

Count terminates a query and returns just the number of items in the result. If you have Select or Calculation columns in the query, it will count NULL results as well. To not count NULL values, use Where in the builder with a NotNull operation. To count distinct combinations of items, call Distinct() on the builder.

func (*RootUnlBuilder) Distinct

func (b *RootUnlBuilder) Distinct() *RootUnlBuilder

Distinct removes duplicates from the results of the query. Adding a Select() is usually required.

func (*RootUnlBuilder) Get

func (b *RootUnlBuilder) Get() (*RootUnl, error)

Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items. If an error occurs, or no results are found, a nil is returned.

func (*RootUnlBuilder) GroupBy

func (b *RootUnlBuilder) GroupBy(nodes ...query.Node) *RootUnlBuilder

GroupBy controls how results are grouped when using aggregate functions with Calculation.

func (*RootUnlBuilder) Having

func (b *RootUnlBuilder) Having(node query.Node) *RootUnlBuilder

Having does additional filtering on the results of the query after the query is performed.

func (*RootUnlBuilder) Limit

func (b *RootUnlBuilder) Limit(maxRowCount int, offset int) *RootUnlBuilder

Limit will return a subset of the data, limited to the offset and number of rows specified. For large data sets and specific types of queries, this can be slow, because it will perform the entire query before computing the limit. You cannot limit a query that has embedded arrays.

func (*RootUnlBuilder) Load

func (b *RootUnlBuilder) Load() (rootUnls []*RootUnl, err error)

Load terminates the query builder, performs the query, and returns a slice of RootUnl objects. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*RootUnlBuilder) LoadCursor

func (b *RootUnlBuilder) LoadCursor() (rootUnlsCursor, error)

LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.

A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.

Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use

defer cursor.Close()

to make sure the cursor gets closed.

func (*RootUnlBuilder) LoadI

func (b *RootUnlBuilder) LoadI() (rootUnls []query.OrmObj, err error)

LoadI terminates the query builder, performs the query, and returns a slice of interfaces. This can then satisfy a variety of interfaces that load arrays of objects, including KeyLabeler. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*RootUnlBuilder) OrderBy

func (b *RootUnlBuilder) OrderBy(nodes ...query.Sorter) *RootUnlBuilder

OrderBy specifies how the resulting data should be sorted. By default, the given nodes are sorted in ascending order. Add Descending() to the node to specify that it should be sorted in descending order.

func (*RootUnlBuilder) Select

func (b *RootUnlBuilder) Select(nodes ...query.Node) *RootUnlBuilder

Select specifies what specific columns will be loaded with data. By default, all the columns of the root_unl table will be queried and loaded. If nodes contains columns from the root_unl table, that will limit the columns queried and loaded to only those columns. If related tables are specified, then all the columns from those tables are queried, selected and joined to the result. If columns in related tables are specified, then only those columns will be queried and loaded. Depending on the query, additional columns may automatically be added to the query. In particular, primary key columns will be added in most situations. The exception to this would be in distinct queries, group by queries, or subqueries.

func (*RootUnlBuilder) Where

func (b *RootUnlBuilder) Where(c query.Node) *RootUnlBuilder

Where adds a condition to filter what gets selected. Calling Where multiple times will AND the conditions together.

type TimeoutTest

type TimeoutTest struct {
	// contains filtered or unexported fields
}

TimeoutTest represents an item in the timeout_test table in the database.

func LoadTimeoutTest

func LoadTimeoutTest(ctx context.Context, pk query.AutoPrimaryKey, selectNodes ...query.Node) (*TimeoutTest, error)

LoadTimeoutTest returns a TimeoutTest from the database. selectNodes lets you provide nodes for selecting specific fields or additional fields from related tables. See [TimeoutTestsBuilder.Select] for more info.

func NewTimeoutTest

func NewTimeoutTest() *TimeoutTest

NewTimeoutTest creates a new TimeoutTest object and initializes it to default values.

func (*TimeoutTest) Copy

func (o *TimeoutTest) Copy() (newObject *TimeoutTest)

Copy copies most fields to a new TimeoutTest object. Forward reference ids will be copied, but reverse and many-many references will not. Attached objects will not be included in the copy. Automatically generated fields will not be included in the copy. The primary key field will not be copied, since it is normally auto-generated. Call Save() on the new object to save it into the database. Copy might panic if any fields in the database were set to a size larger than the maximum size through a process that accessed the database outside of the ORM.

func (*TimeoutTest) Delete

func (o *TimeoutTest) Delete(ctx context.Context) (err error)

Delete deletes the record from the database.

func (*TimeoutTest) Get

func (o *TimeoutTest) Get(key string) interface{}

Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil. Get can be used to retrieve a value by using the Field() of a node.

func (*TimeoutTest) GetAlias

func (o *TimeoutTest) GetAlias(aliasKey string) query.AliasValue

GetAlias returns the value for the Alias node aliasKey that was returned in the most recent query.

func (*TimeoutTest) ID

func (o *TimeoutTest) ID() query.AutoPrimaryKey

ID returns the loaded value of the id field in the database.

func (*TimeoutTest) IDIsLoaded

func (o *TimeoutTest) IDIsLoaded() bool

IDIsLoaded returns true if the value was loaded from the database or has been set.

func (*TimeoutTest) Initialize

func (o *TimeoutTest) Initialize()

Initialize will initialize or re-initialize a TimeoutTest database object to default values.

func (*TimeoutTest) IsDirty

func (o *TimeoutTest) IsDirty() (dirty bool)

IsDirty returns true if the object has been changed since it was read from the database or created.

func (*TimeoutTest) IsNew

func (o *TimeoutTest) IsNew() bool

IsNew returns true if the object will create a new record when saved.

func (*TimeoutTest) Key

func (o *TimeoutTest) Key() string

Key returns a unique key for the object, among a list of similar objects.

func (*TimeoutTest) Label

func (o *TimeoutTest) Label() string

Label returns a human-readable label of the object. This would be what a user would see as a description of the object if choosing from a list.

func (*TimeoutTest) MarshalBinary

func (o *TimeoutTest) MarshalBinary() ([]byte, error)

MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.

func (*TimeoutTest) MarshalJSON

func (o *TimeoutTest) MarshalJSON() (data []byte, err error)

MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.

func (*TimeoutTest) MarshalStringMap

func (o *TimeoutTest) MarshalStringMap() map[string]interface{}

MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.

func (*TimeoutTest) Name

func (o *TimeoutTest) Name() string

Name returns the value of the loaded name field in the database.

func (*TimeoutTest) NameIsLoaded

func (o *TimeoutTest) NameIsLoaded() bool

NameIsLoaded returns true if the value was loaded from the database or has been set.

func (*TimeoutTest) OriginalPrimaryKey

func (o *TimeoutTest) OriginalPrimaryKey() query.AutoPrimaryKey

OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.

func (*TimeoutTest) PrimaryKey

func (o *TimeoutTest) PrimaryKey() query.AutoPrimaryKey

PrimaryKey returns the value of the primary key of the record.

func (*TimeoutTest) Save

func (o *TimeoutTest) Save(ctx context.Context) error

Save will update or insert the object, depending on the state of the object.

If it has an auto-generated primary key, it will be updated after an insert. Database errors generally will be handled by a panic and not returned here, since those indicate a problem with a database driver or configuration.

Save will return a db.OptimisticLockError if it detects a collision when two users are attempting to change the same database record.

It will return a db.UniqueValueError if it detects a collision when an attempt is made to add a record with a unique column that is given a value that is already in the database.

Updating a record that has not changed will have no effect on the database. Updating a record that has linked records will also update any linked records that are MODIFIED, and if optimistic locking is in effect, will also check whether those records have been altered or deleted, returning an OptimisticLockError if so.

func (*TimeoutTest) SetID

func (o *TimeoutTest) SetID(v query.AutoPrimaryKey)

SetID sets the value of ID in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the ID value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*TimeoutTest) SetName

func (o *TimeoutTest) SetName(v string)

SetName sets the value of Name in the object, to be saved later in the database using the Save() function.

func (*TimeoutTest) SetPrimaryKey

func (o *TimeoutTest) SetPrimaryKey(v query.AutoPrimaryKey)

SetPrimaryKey sets the value of the primary key in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the primary key value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*TimeoutTest) String

func (o *TimeoutTest) String() string

String implements the Stringer interface and returns a description of the record, primarily for debugging.

func (*TimeoutTest) UnmarshalBinary

func (o *TimeoutTest) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary converts a structure that was created with MarshalBinary into a TimeoutTest object.

func (*TimeoutTest) UnmarshalJSON

func (o *TimeoutTest) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON unmarshalls the given json data into the TimeoutTest. The TimeoutTest can be a newly created object, or one loaded from the database.

After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.

Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.

The fields it expects are:

"id" - query.AutoPrimaryKey
"name" - string

func (*TimeoutTest) UnmarshalStringMap

func (o *TimeoutTest) UnmarshalStringMap(m map[string]interface{}) (err error)

UnmarshalStringMap will load the values from the stringmap into the object.

Override this in TimeoutTest to modify the json before sending it here.

type TimeoutTestBuilder

type TimeoutTestBuilder struct {
	// contains filtered or unexported fields
}

The TimeoutTestBuilder uses a builder pattern to create a query on the database. Create a TimeoutTestBuilder by calling QueryTimeoutTests, which will select all the TimeoutTest object in the database. Then filter and arrange those objects by calling Where, Select, etc. End a query by calling either Load, LoadI, LoadCursor, Get, or Count. A TimeoutTestBuilder stores the context it will use to perform the query, and thus is meant to be a short-lived object. You should not save it for later use.

func QueryTimeoutTests

func QueryTimeoutTests(ctx context.Context) *TimeoutTestBuilder

QueryTimeoutTests returns a new query builder. See TimeoutTestBuilder for doc on how to use the builder.

func (*TimeoutTestBuilder) Calculation

func (b *TimeoutTestBuilder) Calculation(base query.TableNodeI, alias string, operation query.OperationNodeI) *TimeoutTestBuilder

Calculation adds operation as an aliased value onto base. After the query, you can read the data by passing alias to GetAlias on the returned object.

func (*TimeoutTestBuilder) Count

func (b *TimeoutTestBuilder) Count() (int, error)

Count terminates a query and returns just the number of items in the result. If you have Select or Calculation columns in the query, it will count NULL results as well. To not count NULL values, use Where in the builder with a NotNull operation. To count distinct combinations of items, call Distinct() on the builder.

func (*TimeoutTestBuilder) Distinct

func (b *TimeoutTestBuilder) Distinct() *TimeoutTestBuilder

Distinct removes duplicates from the results of the query. Adding a Select() is usually required.

func (*TimeoutTestBuilder) Get

func (b *TimeoutTestBuilder) Get() (*TimeoutTest, error)

Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items. If an error occurs, or no results are found, a nil is returned.

func (*TimeoutTestBuilder) GroupBy

func (b *TimeoutTestBuilder) GroupBy(nodes ...query.Node) *TimeoutTestBuilder

GroupBy controls how results are grouped when using aggregate functions with Calculation.

func (*TimeoutTestBuilder) Having

Having does additional filtering on the results of the query after the query is performed.

func (*TimeoutTestBuilder) Limit

func (b *TimeoutTestBuilder) Limit(maxRowCount int, offset int) *TimeoutTestBuilder

Limit will return a subset of the data, limited to the offset and number of rows specified. For large data sets and specific types of queries, this can be slow, because it will perform the entire query before computing the limit. You cannot limit a query that has embedded arrays.

func (*TimeoutTestBuilder) Load

func (b *TimeoutTestBuilder) Load() (timeoutTests []*TimeoutTest, err error)

Load terminates the query builder, performs the query, and returns a slice of TimeoutTest objects. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*TimeoutTestBuilder) LoadCursor

func (b *TimeoutTestBuilder) LoadCursor() (timeoutTestsCursor, error)

LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.

A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.

Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use

defer cursor.Close()

to make sure the cursor gets closed.

LoadCursor is NOT protected by a timeout on the context. You should set your own timeout on the context, but all the rows of the cursor must be read before canceling the cursor.

func (*TimeoutTestBuilder) LoadI

func (b *TimeoutTestBuilder) LoadI() (timeoutTests []query.OrmObj, err error)

LoadI terminates the query builder, performs the query, and returns a slice of interfaces. This can then satisfy a variety of interfaces that load arrays of objects, including KeyLabeler. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*TimeoutTestBuilder) OrderBy

func (b *TimeoutTestBuilder) OrderBy(nodes ...query.Sorter) *TimeoutTestBuilder

OrderBy specifies how the resulting data should be sorted. By default, the given nodes are sorted in ascending order. Add Descending() to the node to specify that it should be sorted in descending order.

func (*TimeoutTestBuilder) Select

func (b *TimeoutTestBuilder) Select(nodes ...query.Node) *TimeoutTestBuilder

Select specifies what specific columns will be loaded with data. By default, all the columns of the timeout_test table will be queried and loaded. If nodes contains columns from the timeout_test table, that will limit the columns queried and loaded to only those columns. If related tables are specified, then all the columns from those tables are queried, selected and joined to the result. If columns in related tables are specified, then only those columns will be queried and loaded. Depending on the query, additional columns may automatically be added to the query. In particular, primary key columns will be added in most situations. The exception to this would be in distinct queries, group by queries, or subqueries.

func (*TimeoutTestBuilder) Where

Where adds a condition to filter what gets selected. Calling Where multiple times will AND the conditions together.

type TwoKey

type TwoKey struct {
	// contains filtered or unexported fields
}

TwoKey represents an item in the two_key table in the database.

func LoadTwoKey

func LoadTwoKey(ctx context.Context, pk TwoKeyPrimaryKey, selectNodes ...query.Node) (*TwoKey, error)

LoadTwoKey returns a TwoKey from the database. selectNodes lets you provide nodes for selecting specific fields or additional fields from related tables. See [TwoKeysBuilder.Select] for more info.

func NewTwoKey

func NewTwoKey() *TwoKey

NewTwoKey creates a new TwoKey object and initializes it to default values.

func (*TwoKey) Copy

func (o *TwoKey) Copy() (newObject *TwoKey)

Copy copies most fields to a new TwoKey object. Forward reference ids will be copied, but reverse and many-many references will not. Attached objects will not be included in the copy. Automatically generated fields will not be included in the copy. The primary key field will not be copied. You will need to manually set the primary key field before saving. Call Save() on the new object to save it into the database. Copy might panic if any fields in the database were set to a size larger than the maximum size through a process that accessed the database outside of the ORM.

func (*TwoKey) Delete

func (o *TwoKey) Delete(ctx context.Context) (err error)

Delete deletes the record from the database.

func (*TwoKey) Directory

func (o *TwoKey) Directory() string

Directory returns the loaded value of the directory field in the database.

func (*TwoKey) DirectoryIsLoaded

func (o *TwoKey) DirectoryIsLoaded() bool

DirectoryIsLoaded returns true if the value was loaded from the database or has been set.

func (*TwoKey) FileName

func (o *TwoKey) FileName() string

FileName returns the value of the loaded file_name field in the database.

func (*TwoKey) FileNameIsLoaded

func (o *TwoKey) FileNameIsLoaded() bool

FileNameIsLoaded returns true if the value was loaded from the database or has been set.

func (*TwoKey) Get

func (o *TwoKey) Get(key string) interface{}

Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil. Get can be used to retrieve a value by using the Field() of a node.

func (*TwoKey) GetAlias

func (o *TwoKey) GetAlias(aliasKey string) query.AliasValue

GetAlias returns the value for the Alias node aliasKey that was returned in the most recent query.

func (*TwoKey) Initialize

func (o *TwoKey) Initialize()

Initialize will initialize or re-initialize a TwoKey database object to default values.

func (*TwoKey) IsDirty

func (o *TwoKey) IsDirty() (dirty bool)

IsDirty returns true if the object has been changed since it was read from the database or created.

func (*TwoKey) IsNew

func (o *TwoKey) IsNew() bool

IsNew returns true if the object will create a new record when saved.

func (*TwoKey) Key

func (o *TwoKey) Key() string

Key returns a unique key for the object, among a list of similar objects.

func (*TwoKey) Label

func (o *TwoKey) Label() string

Label returns a human-readable label of the object. This would be what a user would see as a description of the object if choosing from a list.

func (*TwoKey) MarshalBinary

func (o *TwoKey) MarshalBinary() ([]byte, error)

MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.

func (*TwoKey) MarshalJSON

func (o *TwoKey) MarshalJSON() (data []byte, err error)

MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.

func (*TwoKey) MarshalStringMap

func (o *TwoKey) MarshalStringMap() map[string]interface{}

MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.

func (*TwoKey) OriginalPrimaryKey

func (o *TwoKey) OriginalPrimaryKey() TwoKeyPrimaryKey

OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.

func (*TwoKey) PrimaryKey

func (o *TwoKey) PrimaryKey() TwoKeyPrimaryKey

PrimaryKey returns the value of the primary key of the record.

func (*TwoKey) Save

func (o *TwoKey) Save(ctx context.Context) error

Save will update or insert the object, depending on the state of the object.

If it has an auto-generated primary key, it will be updated after an insert. Database errors generally will be handled by a panic and not returned here, since those indicate a problem with a database driver or configuration.

Save will return a db.OptimisticLockError if it detects a collision when two users are attempting to change the same database record.

It will return a db.UniqueValueError if it detects a collision when an attempt is made to add a record with a unique column that is given a value that is already in the database.

Updating a record that has not changed will have no effect on the database. Updating a record that has linked records will also update any linked records that are MODIFIED, and if optimistic locking is in effect, will also check whether those records have been altered or deleted, returning an OptimisticLockError if so.

func (*TwoKey) Server

func (o *TwoKey) Server() string

Server returns the loaded value of the server field in the database.

func (*TwoKey) ServerIsLoaded

func (o *TwoKey) ServerIsLoaded() bool

ServerIsLoaded returns true if the value was loaded from the database or has been set.

func (*TwoKey) SetDirectory

func (o *TwoKey) SetDirectory(v string)

SetDirectory sets the value of Directory in the object, to be saved later in the database using the Save() function. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*TwoKey) SetFileName

func (o *TwoKey) SetFileName(v string)

SetFileName sets the value of FileName in the object, to be saved later in the database using the Save() function.

func (*TwoKey) SetPrimaryKey

func (o *TwoKey) SetPrimaryKey(v TwoKeyPrimaryKey)

SetPrimaryKey sets the value of the primary key in the object, to be saved later in the database using the Save() function. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*TwoKey) SetServer

func (o *TwoKey) SetServer(v string)

SetServer sets the value of Server in the object, to be saved later in the database using the Save() function. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*TwoKey) String

func (o *TwoKey) String() string

String implements the Stringer interface and returns a description of the record, primarily for debugging.

func (*TwoKey) UnmarshalBinary

func (o *TwoKey) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary converts a structure that was created with MarshalBinary into a TwoKey object.

func (*TwoKey) UnmarshalJSON

func (o *TwoKey) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON unmarshalls the given json data into the TwoKey. The TwoKey can be a newly created object, or one loaded from the database.

After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.

Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.

The fields it expects are:

"server" - string
"directory" - string
"fileName" - string

func (*TwoKey) UnmarshalStringMap

func (o *TwoKey) UnmarshalStringMap(m map[string]interface{}) (err error)

UnmarshalStringMap will load the values from the stringmap into the object.

Override this in TwoKey to modify the json before sending it here.

type TwoKeyBuilder

type TwoKeyBuilder struct {
	// contains filtered or unexported fields
}

The TwoKeyBuilder uses a builder pattern to create a query on the database. Create a TwoKeyBuilder by calling QueryTwoKeys, which will select all the TwoKey object in the database. Then filter and arrange those objects by calling Where, Select, etc. End a query by calling either Load, LoadI, LoadCursor, Get, or Count. A TwoKeyBuilder stores the context it will use to perform the query, and thus is meant to be a short-lived object. You should not save it for later use.

func QueryTwoKeys

func QueryTwoKeys(ctx context.Context) *TwoKeyBuilder

QueryTwoKeys returns a new query builder. See TwoKeyBuilder for doc on how to use the builder. You should pass a context that has a timeout with it to protect against a long delay from the database possibly hanging your application. You can set a ReadTimeout value on the schema to do this by default during code generation.

func (*TwoKeyBuilder) Calculation

func (b *TwoKeyBuilder) Calculation(base query.TableNodeI, alias string, operation query.OperationNodeI) *TwoKeyBuilder

Calculation adds operation as an aliased value onto base. After the query, you can read the data by passing alias to GetAlias on the returned object.

func (*TwoKeyBuilder) Count

func (b *TwoKeyBuilder) Count() (int, error)

Count terminates a query and returns just the number of items in the result. If you have Select or Calculation columns in the query, it will count NULL results as well. To not count NULL values, use Where in the builder with a NotNull operation. To count distinct combinations of items, call Distinct() on the builder.

func (*TwoKeyBuilder) Distinct

func (b *TwoKeyBuilder) Distinct() *TwoKeyBuilder

Distinct removes duplicates from the results of the query. Adding a Select() is usually required.

func (*TwoKeyBuilder) Get

func (b *TwoKeyBuilder) Get() (*TwoKey, error)

Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items. If an error occurs, or no results are found, a nil is returned.

func (*TwoKeyBuilder) GroupBy

func (b *TwoKeyBuilder) GroupBy(nodes ...query.Node) *TwoKeyBuilder

GroupBy controls how results are grouped when using aggregate functions with Calculation.

func (*TwoKeyBuilder) Having

func (b *TwoKeyBuilder) Having(node query.Node) *TwoKeyBuilder

Having does additional filtering on the results of the query after the query is performed.

func (*TwoKeyBuilder) Limit

func (b *TwoKeyBuilder) Limit(maxRowCount int, offset int) *TwoKeyBuilder

Limit will return a subset of the data, limited to the offset and number of rows specified. For large data sets and specific types of queries, this can be slow, because it will perform the entire query before computing the limit. You cannot limit a query that has embedded arrays.

func (*TwoKeyBuilder) Load

func (b *TwoKeyBuilder) Load() (twoKeys []*TwoKey, err error)

Load terminates the query builder, performs the query, and returns a slice of TwoKey objects. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*TwoKeyBuilder) LoadCursor

func (b *TwoKeyBuilder) LoadCursor() (twoKeysCursor, error)

LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.

A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.

Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use

defer cursor.Close()

to make sure the cursor gets closed.

func (*TwoKeyBuilder) LoadI

func (b *TwoKeyBuilder) LoadI() (twoKeys []query.OrmObj, err error)

LoadI terminates the query builder, performs the query, and returns a slice of interfaces. This can then satisfy a variety of interfaces that load arrays of objects, including KeyLabeler. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*TwoKeyBuilder) OrderBy

func (b *TwoKeyBuilder) OrderBy(nodes ...query.Sorter) *TwoKeyBuilder

OrderBy specifies how the resulting data should be sorted. By default, the given nodes are sorted in ascending order. Add Descending() to the node to specify that it should be sorted in descending order.

func (*TwoKeyBuilder) Select

func (b *TwoKeyBuilder) Select(nodes ...query.Node) *TwoKeyBuilder

Select specifies what specific columns will be loaded with data. By default, all the columns of the two_key table will be queried and loaded. If nodes contains columns from the two_key table, that will limit the columns queried and loaded to only those columns. If related tables are specified, then all the columns from those tables are queried, selected and joined to the result. If columns in related tables are specified, then only those columns will be queried and loaded. Depending on the query, additional columns may automatically be added to the query. In particular, primary key columns will be added in most situations. The exception to this would be in distinct queries, group by queries, or subqueries.

func (*TwoKeyBuilder) Where

func (b *TwoKeyBuilder) Where(c query.Node) *TwoKeyBuilder

Where adds a condition to filter what gets selected. Calling Where multiple times will AND the conditions together.

type TwoKeyPrimaryKey

type TwoKeyPrimaryKey struct {
	Server    string
	Directory string
}

type TypeTest

type TypeTest struct {
	// contains filtered or unexported fields
}

TypeTest represents an item in the type_test table in the database.

func LoadTypeTest

func LoadTypeTest(ctx context.Context, pk query.AutoPrimaryKey, selectNodes ...query.Node) (*TypeTest, error)

LoadTypeTest returns a TypeTest from the database. selectNodes lets you provide nodes for selecting specific fields or additional fields from related tables. See [TypeTestsBuilder.Select] for more info.

func NewTypeTest

func NewTypeTest() *TypeTest

NewTypeTest creates a new TypeTest object and initializes it to default values.

func (*TypeTest) Copy

func (o *TypeTest) Copy() (newObject *TypeTest)

Copy copies most fields to a new TypeTest object. Forward reference ids will be copied, but reverse and many-many references will not. Attached objects will not be included in the copy. Automatically generated fields will not be included in the copy. The primary key field will not be copied, since it is normally auto-generated. Call Save() on the new object to save it into the database. Copy might panic if any fields in the database were set to a size larger than the maximum size through a process that accessed the database outside of the ORM.

func (*TypeTest) CreationTime

func (o *TypeTest) CreationTime() time.Time

CreationTime returns the value of the loaded creation_time field in the database.

func (*TypeTest) CreationTimeIsLoaded

func (o *TypeTest) CreationTimeIsLoaded() bool

CreationTimeIsLoaded returns true if the value was loaded from the database or has been set.

func (*TypeTest) Date

func (o *TypeTest) Date() time.Time

Date returns the value of the loaded date field in the database.

func (*TypeTest) DateIsLoaded

func (o *TypeTest) DateIsLoaded() bool

DateIsLoaded returns true if the value was loaded from the database or has been set.

func (*TypeTest) DateIsNull

func (o *TypeTest) DateIsNull() bool

DateIsNull returns true if the related database value is null.

func (*TypeTest) DateTime

func (o *TypeTest) DateTime() time.Time

DateTime returns the value of the loaded date_time field in the database.

func (*TypeTest) DateTimeIsLoaded

func (o *TypeTest) DateTimeIsLoaded() bool

DateTimeIsLoaded returns true if the value was loaded from the database or has been set.

func (*TypeTest) DateTimeIsNull

func (o *TypeTest) DateTimeIsNull() bool

DateTimeIsNull returns true if the related database value is null.

func (*TypeTest) Delete

func (o *TypeTest) Delete(ctx context.Context) (err error)

Delete deletes the record from the database.

func (*TypeTest) Get

func (o *TypeTest) Get(key string) interface{}

Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil. Get can be used to retrieve a value by using the Field() of a node.

func (*TypeTest) GetAlias

func (o *TypeTest) GetAlias(aliasKey string) query.AliasValue

GetAlias returns the value for the Alias node aliasKey that was returned in the most recent query.

func (*TypeTest) ID

func (o *TypeTest) ID() query.AutoPrimaryKey

ID returns the loaded value of the id field in the database.

func (*TypeTest) IDIsLoaded

func (o *TypeTest) IDIsLoaded() bool

IDIsLoaded returns true if the value was loaded from the database or has been set.

func (*TypeTest) Initialize

func (o *TypeTest) Initialize()

Initialize will initialize or re-initialize a TypeTest database object to default values.

func (*TypeTest) IsDirty

func (o *TypeTest) IsDirty() (dirty bool)

IsDirty returns true if the object has been changed since it was read from the database or created.

func (*TypeTest) IsNew

func (o *TypeTest) IsNew() bool

IsNew returns true if the object will create a new record when saved.

func (*TypeTest) Key

func (o *TypeTest) Key() string

Key returns a unique key for the object, among a list of similar objects.

func (*TypeTest) Label

func (o *TypeTest) Label() string

Label returns a human-readable label of the object. This would be what a user would see as a description of the object if choosing from a list.

func (*TypeTest) MarshalBinary

func (o *TypeTest) MarshalBinary() ([]byte, error)

MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.

func (*TypeTest) MarshalJSON

func (o *TypeTest) MarshalJSON() (data []byte, err error)

MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.

func (*TypeTest) MarshalStringMap

func (o *TypeTest) MarshalStringMap() map[string]interface{}

MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.

func (*TypeTest) ModifiedTime

func (o *TypeTest) ModifiedTime() time.Time

ModifiedTime returns the value of the loaded modified_time field in the database.

func (*TypeTest) ModifiedTimeIsLoaded

func (o *TypeTest) ModifiedTimeIsLoaded() bool

ModifiedTimeIsLoaded returns true if the value was loaded from the database or has been set.

func (*TypeTest) OriginalPrimaryKey

func (o *TypeTest) OriginalPrimaryKey() query.AutoPrimaryKey

OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.

func (*TypeTest) PrimaryKey

func (o *TypeTest) PrimaryKey() query.AutoPrimaryKey

PrimaryKey returns the value of the primary key of the record.

func (*TypeTest) Save

func (o *TypeTest) Save(ctx context.Context) error

Save will update or insert the object, depending on the state of the object.

If it has an auto-generated primary key, it will be updated after an insert. Database errors generally will be handled by a panic and not returned here, since those indicate a problem with a database driver or configuration.

Save will return a db.OptimisticLockError if it detects a collision when two users are attempting to change the same database record.

It will return a db.UniqueValueError if it detects a collision when an attempt is made to add a record with a unique column that is given a value that is already in the database.

Updating a record that has not changed will have no effect on the database. Updating a record that has linked records will also update any linked records that are MODIFIED, and if optimistic locking is in effect, will also check whether those records have been altered or deleted, returning an OptimisticLockError if so.

func (*TypeTest) SetDate

func (o *TypeTest) SetDate(v time.Time)

SetDate sets the value of Date in the object, to be saved later in the database using the Save() function.

The value v will be converted to UTC time. The time will also be zeroed. This may cause the date value to change. To prevent this, be sure that the date given is already in UTC time.

func (*TypeTest) SetDateTime

func (o *TypeTest) SetDateTime(v time.Time)

SetDateTime sets the value of DateTime in the object, to be saved later in the database using the Save() function.

The value v will be converted to UTC time.

func (*TypeTest) SetDateTimeToNull

func (o *TypeTest) SetDateTimeToNull()

SetDateTimeToNull() will set the date_time value in the database to NULL. DateTime() will return the column's default value after this.

func (*TypeTest) SetDateToNull

func (o *TypeTest) SetDateToNull()

SetDateToNull() will set the date value in the database to NULL. Date() will return the column's default value after this.

func (*TypeTest) SetID

func (o *TypeTest) SetID(v query.AutoPrimaryKey)

SetID sets the value of ID in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the ID value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*TypeTest) SetPrimaryKey

func (o *TypeTest) SetPrimaryKey(v query.AutoPrimaryKey)

SetPrimaryKey sets the value of the primary key in the object, to be saved later in the database using the Save() function. Normally you will not need to call this function, since the primary key value is automatically generated by the database driver. Exceptions might include importing data to a new database, or correcting primary key conflicts when merging data. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*TypeTest) SetTestBool

func (o *TypeTest) SetTestBool(v bool)

SetTestBool sets the value of TestBool in the object, to be saved later in the database using the Save() function.

func (*TypeTest) SetTestFloat32

func (o *TypeTest) SetTestFloat32(v float32)

SetTestFloat32 sets the value of TestFloat32 in the object, to be saved later in the database using the Save() function.

func (*TypeTest) SetTestFloat32ToNull

func (o *TypeTest) SetTestFloat32ToNull()

SetTestFloat32ToNull() will set the test_float32 value in the database to NULL. TestFloat32() will return the column's default value after this.

func (*TypeTest) SetTestFloat64

func (o *TypeTest) SetTestFloat64(v float64)

SetTestFloat64 sets the value of TestFloat64 in the object, to be saved later in the database using the Save() function.

func (*TypeTest) SetTestInt

func (o *TypeTest) SetTestInt(v int)

SetTestInt sets the value of TestInt in the object, to be saved later in the database using the Save() function.

func (*TypeTest) SetTestInt64

func (o *TypeTest) SetTestInt64(v int64)

SetTestInt64 sets the value of TestInt64 in the object, to be saved later in the database using the Save() function.

func (*TypeTest) SetTestIntToNull

func (o *TypeTest) SetTestIntToNull()

SetTestIntToNull() will set the test_int value in the database to NULL. TestInt() will return the column's default value after this.

func (*TypeTest) SetTestLimitedBytes

func (o *TypeTest) SetTestLimitedBytes(v []byte)

SetTestLimitedBytes copies the value of TestLimitedBytes, to be saved later in the database using the Save() function. Passing nil will set test_limited_bytes to an empty array.

func (*TypeTest) SetTestLimitedString

func (o *TypeTest) SetTestLimitedString(v string)

SetTestLimitedString sets the value of TestLimitedString in the object, to be saved later in the database using the Save() function.

func (*TypeTest) SetTestLongstring

func (o *TypeTest) SetTestLongstring(v string)

SetTestLongstring sets the value of TestLongstring in the object, to be saved later in the database using the Save() function.

func (*TypeTest) SetTestNumeric

func (o *TypeTest) SetTestNumeric(v string)

SetTestNumeric sets the value of TestNumeric in the object, to be saved later in the database using the Save() function.

func (*TypeTest) SetTestUint64

func (o *TypeTest) SetTestUint64(v uint64)

SetTestUint64 sets the value of TestUint64 in the object, to be saved later in the database using the Save() function.

func (*TypeTest) SetTestUnlimitedBytes

func (o *TypeTest) SetTestUnlimitedBytes(v []byte)

SetTestUnlimitedBytes copies the value of TestUnlimitedBytes, to be saved later in the database using the Save() function. Passing nil will set test_unlimited_bytes to an empty array.

func (*TypeTest) SetTestUnlimitedString

func (o *TypeTest) SetTestUnlimitedString(v string)

SetTestUnlimitedString sets the value of TestUnlimitedString in the object, to be saved later in the database using the Save() function.

func (*TypeTest) SetTestUnsigned

func (o *TypeTest) SetTestUnsigned(v uint)

SetTestUnsigned sets the value of TestUnsigned in the object, to be saved later in the database using the Save() function.

func (*TypeTest) SetTime

func (o *TypeTest) SetTime(v time.Time)

SetTime sets the value of Time in the object, to be saved later in the database using the Save() function.

The value v will be converted to UTC time. The date will also be zeroed. This process may cause the time value to change. To prevent this, be sure that the time given is already in UTC time.

func (*TypeTest) SetTimeToNull

func (o *TypeTest) SetTimeToNull()

SetTimeToNull() will set the time value in the database to NULL. Time() will return the column's default value after this.

func (*TypeTest) SetTypeLongBytes

func (o *TypeTest) SetTypeLongBytes(v []byte)

SetTypeLongBytes copies the value of TypeLongBytes, to be saved later in the database using the Save() function. Passing nil will set type_long_bytes to an empty array.

func (*TypeTest) String

func (o *TypeTest) String() string

String implements the Stringer interface and returns a description of the record, primarily for debugging.

func (*TypeTest) TestBool

func (o *TypeTest) TestBool() bool

TestBool returns the value of the loaded test_bool field in the database.

func (*TypeTest) TestBoolIsLoaded

func (o *TypeTest) TestBoolIsLoaded() bool

TestBoolIsLoaded returns true if the value was loaded from the database or has been set.

func (*TypeTest) TestFloat32

func (o *TypeTest) TestFloat32() float32

TestFloat32 returns the value of the loaded test_float32 field in the database.

func (*TypeTest) TestFloat32IsLoaded

func (o *TypeTest) TestFloat32IsLoaded() bool

TestFloat32IsLoaded returns true if the value was loaded from the database or has been set.

func (*TypeTest) TestFloat32IsNull

func (o *TypeTest) TestFloat32IsNull() bool

TestFloat32IsNull returns true if the related database value is null.

func (*TypeTest) TestFloat64

func (o *TypeTest) TestFloat64() float64

TestFloat64 returns the value of the loaded test_float64 field in the database.

func (*TypeTest) TestFloat64IsLoaded

func (o *TypeTest) TestFloat64IsLoaded() bool

TestFloat64IsLoaded returns true if the value was loaded from the database or has been set.

func (*TypeTest) TestInt

func (o *TypeTest) TestInt() int

TestInt returns the value of the loaded test_int field in the database.

func (*TypeTest) TestInt64

func (o *TypeTest) TestInt64() int64

TestInt64 returns the value of the loaded test_int64 field in the database.

func (*TypeTest) TestInt64IsLoaded

func (o *TypeTest) TestInt64IsLoaded() bool

TestInt64IsLoaded returns true if the value was loaded from the database or has been set.

func (*TypeTest) TestIntIsLoaded

func (o *TypeTest) TestIntIsLoaded() bool

TestIntIsLoaded returns true if the value was loaded from the database or has been set.

func (*TypeTest) TestIntIsNull

func (o *TypeTest) TestIntIsNull() bool

TestIntIsNull returns true if the related database value is null.

func (*TypeTest) TestLimitedBytes

func (o *TypeTest) TestLimitedBytes() []byte

TestLimitedBytes returns the value of the loaded test_limited_bytes field in the database.

func (*TypeTest) TestLimitedBytesIsLoaded

func (o *TypeTest) TestLimitedBytesIsLoaded() bool

TestLimitedBytesIsLoaded returns true if the value was loaded from the database or has been set.

func (*TypeTest) TestLimitedString

func (o *TypeTest) TestLimitedString() string

TestLimitedString returns the value of the loaded test_limited_string field in the database.

func (*TypeTest) TestLimitedStringIsLoaded

func (o *TypeTest) TestLimitedStringIsLoaded() bool

TestLimitedStringIsLoaded returns true if the value was loaded from the database or has been set.

func (*TypeTest) TestLongstring

func (o *TypeTest) TestLongstring() string

TestLongstring returns the value of the loaded test_longstring field in the database.

func (*TypeTest) TestLongstringIsLoaded

func (o *TypeTest) TestLongstringIsLoaded() bool

TestLongstringIsLoaded returns true if the value was loaded from the database or has been set.

func (*TypeTest) TestNumeric

func (o *TypeTest) TestNumeric() string

TestNumeric returns the value of the loaded test_numeric field in the database.

func (*TypeTest) TestNumericIsLoaded

func (o *TypeTest) TestNumericIsLoaded() bool

TestNumericIsLoaded returns true if the value was loaded from the database or has been set.

func (*TypeTest) TestUint64

func (o *TypeTest) TestUint64() uint64

TestUint64 returns the value of the loaded test_uint64 field in the database.

func (*TypeTest) TestUint64IsLoaded

func (o *TypeTest) TestUint64IsLoaded() bool

TestUint64IsLoaded returns true if the value was loaded from the database or has been set.

func (*TypeTest) TestUnlimitedBytes

func (o *TypeTest) TestUnlimitedBytes() []byte

TestUnlimitedBytes returns the value of the loaded test_unlimited_bytes field in the database.

func (*TypeTest) TestUnlimitedBytesIsLoaded

func (o *TypeTest) TestUnlimitedBytesIsLoaded() bool

TestUnlimitedBytesIsLoaded returns true if the value was loaded from the database or has been set.

func (*TypeTest) TestUnlimitedString

func (o *TypeTest) TestUnlimitedString() string

TestUnlimitedString returns the value of the loaded test_unlimited_string field in the database.

func (*TypeTest) TestUnlimitedStringIsLoaded

func (o *TypeTest) TestUnlimitedStringIsLoaded() bool

TestUnlimitedStringIsLoaded returns true if the value was loaded from the database or has been set.

func (*TypeTest) TestUnsigned

func (o *TypeTest) TestUnsigned() uint

TestUnsigned returns the value of the loaded test_unsigned field in the database.

func (*TypeTest) TestUnsignedIsLoaded

func (o *TypeTest) TestUnsignedIsLoaded() bool

TestUnsignedIsLoaded returns true if the value was loaded from the database or has been set.

func (*TypeTest) Time

func (o *TypeTest) Time() time.Time

Time returns the value of the loaded time field in the database.

func (*TypeTest) TimeIsLoaded

func (o *TypeTest) TimeIsLoaded() bool

TimeIsLoaded returns true if the value was loaded from the database or has been set.

func (*TypeTest) TimeIsNull

func (o *TypeTest) TimeIsNull() bool

TimeIsNull returns true if the related database value is null.

func (*TypeTest) TypeLongBytes

func (o *TypeTest) TypeLongBytes() []byte

TypeLongBytes returns the value of the loaded type_long_bytes field in the database.

func (*TypeTest) TypeLongBytesIsLoaded

func (o *TypeTest) TypeLongBytesIsLoaded() bool

TypeLongBytesIsLoaded returns true if the value was loaded from the database or has been set.

func (*TypeTest) UnmarshalBinary

func (o *TypeTest) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary converts a structure that was created with MarshalBinary into a TypeTest object.

func (*TypeTest) UnmarshalJSON

func (o *TypeTest) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON unmarshalls the given json data into the TypeTest. The TypeTest can be a newly created object, or one loaded from the database.

After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.

Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.

The fields it expects are:

"id" - query.AutoPrimaryKey
"date" - time.Time, nullable
"time" - time.Time, nullable
"dateTime" - time.Time, nullable
"creationTime" - time.Time
"modifiedTime" - time.Time
"testInt" - int, nullable
"testUnsigned" - uint
"testInt64" - int64
"testUint64" - uint64
"testFloat32" - float32, nullable
"testFloat64" - float64
"testNumeric" - string
"testBool" - bool
"testUnlimitedString" - string
"testLimitedString" - string
"testLongstring" - string
"testUnlimitedBytes" - []byte
"testLimitedBytes" - []byte
"typeLongBytes" - []byte

func (*TypeTest) UnmarshalStringMap

func (o *TypeTest) UnmarshalStringMap(m map[string]interface{}) (err error)

UnmarshalStringMap will load the values from the stringmap into the object.

Override this in TypeTest to modify the json before sending it here.

type TypeTestBuilder

type TypeTestBuilder struct {
	// contains filtered or unexported fields
}

The TypeTestBuilder uses a builder pattern to create a query on the database. Create a TypeTestBuilder by calling QueryTypeTests, which will select all the TypeTest object in the database. Then filter and arrange those objects by calling Where, Select, etc. End a query by calling either Load, LoadI, LoadCursor, Get, or Count. A TypeTestBuilder stores the context it will use to perform the query, and thus is meant to be a short-lived object. You should not save it for later use.

func QueryTypeTests

func QueryTypeTests(ctx context.Context) *TypeTestBuilder

QueryTypeTests returns a new query builder. See TypeTestBuilder for doc on how to use the builder. You should pass a context that has a timeout with it to protect against a long delay from the database possibly hanging your application. You can set a ReadTimeout value on the schema to do this by default during code generation.

func (*TypeTestBuilder) Calculation

func (b *TypeTestBuilder) Calculation(base query.TableNodeI, alias string, operation query.OperationNodeI) *TypeTestBuilder

Calculation adds operation as an aliased value onto base. After the query, you can read the data by passing alias to GetAlias on the returned object.

func (*TypeTestBuilder) Count

func (b *TypeTestBuilder) Count() (int, error)

Count terminates a query and returns just the number of items in the result. If you have Select or Calculation columns in the query, it will count NULL results as well. To not count NULL values, use Where in the builder with a NotNull operation. To count distinct combinations of items, call Distinct() on the builder.

func (*TypeTestBuilder) Distinct

func (b *TypeTestBuilder) Distinct() *TypeTestBuilder

Distinct removes duplicates from the results of the query. Adding a Select() is usually required.

func (*TypeTestBuilder) Get

func (b *TypeTestBuilder) Get() (*TypeTest, error)

Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items. If an error occurs, or no results are found, a nil is returned.

func (*TypeTestBuilder) GroupBy

func (b *TypeTestBuilder) GroupBy(nodes ...query.Node) *TypeTestBuilder

GroupBy controls how results are grouped when using aggregate functions with Calculation.

func (*TypeTestBuilder) Having

func (b *TypeTestBuilder) Having(node query.Node) *TypeTestBuilder

Having does additional filtering on the results of the query after the query is performed.

func (*TypeTestBuilder) Limit

func (b *TypeTestBuilder) Limit(maxRowCount int, offset int) *TypeTestBuilder

Limit will return a subset of the data, limited to the offset and number of rows specified. For large data sets and specific types of queries, this can be slow, because it will perform the entire query before computing the limit. You cannot limit a query that has embedded arrays.

func (*TypeTestBuilder) Load

func (b *TypeTestBuilder) Load() (typeTests []*TypeTest, err error)

Load terminates the query builder, performs the query, and returns a slice of TypeTest objects. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*TypeTestBuilder) LoadCursor

func (b *TypeTestBuilder) LoadCursor() (typeTestsCursor, error)

LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.

A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.

Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use

defer cursor.Close()

to make sure the cursor gets closed.

func (*TypeTestBuilder) LoadI

func (b *TypeTestBuilder) LoadI() (typeTests []query.OrmObj, err error)

LoadI terminates the query builder, performs the query, and returns a slice of interfaces. This can then satisfy a variety of interfaces that load arrays of objects, including KeyLabeler. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*TypeTestBuilder) OrderBy

func (b *TypeTestBuilder) OrderBy(nodes ...query.Sorter) *TypeTestBuilder

OrderBy specifies how the resulting data should be sorted. By default, the given nodes are sorted in ascending order. Add Descending() to the node to specify that it should be sorted in descending order.

func (*TypeTestBuilder) Select

func (b *TypeTestBuilder) Select(nodes ...query.Node) *TypeTestBuilder

Select specifies what specific columns will be loaded with data. By default, all the columns of the type_test table will be queried and loaded. If nodes contains columns from the type_test table, that will limit the columns queried and loaded to only those columns. If related tables are specified, then all the columns from those tables are queried, selected and joined to the result. If columns in related tables are specified, then only those columns will be queried and loaded. Depending on the query, additional columns may automatically be added to the query. In particular, primary key columns will be added in most situations. The exception to this would be in distinct queries, group by queries, or subqueries.

func (*TypeTestBuilder) Where

Where adds a condition to filter what gets selected. Calling Where multiple times will AND the conditions together.

type UnsupportedType

type UnsupportedType struct {
	// contains filtered or unexported fields
}

UnsupportedType represents an item in the unsupported_type table in the database.

func LoadUnsupportedType

func LoadUnsupportedType(ctx context.Context, pk uint64, selectNodes ...query.Node) (*UnsupportedType, error)

LoadUnsupportedType returns a UnsupportedType from the database. selectNodes lets you provide nodes for selecting specific fields or additional fields from related tables. See [UnsupportedTypesBuilder.Select] for more info.

func LoadUnsupportedTypesByTypeMultFk1TypeMultiFk2

func LoadUnsupportedTypesByTypeMultFk1TypeMultiFk2(ctx context.Context, typeMultFk1 string, typeMultiFk2 string, selectNodes ...query.Node) ([]*UnsupportedType, error)

LoadUnsupportedTypesByTypeMultFk1TypeMultiFk2 queries UnsupportedType objects by the given index values. selectNodes optionally let you provide nodes for joining to other tables or selecting specific fields. See [UnsupportedTypesBuilder.Select]. If you need a more elaborate query, use QueryUnsupportedTypes() to start a query builder.

func NewUnsupportedType

func NewUnsupportedType() *UnsupportedType

NewUnsupportedType creates a new UnsupportedType object and initializes it to default values.

func (*UnsupportedType) Copy

func (o *UnsupportedType) Copy() (newObject *UnsupportedType)

Copy copies most fields to a new UnsupportedType object. Forward reference ids will be copied, but reverse and many-many references will not. Attached objects will not be included in the copy. Automatically generated fields will not be included in the copy. The primary key field will not be copied. You will need to manually set the primary key field before saving. Call Save() on the new object to save it into the database. Copy might panic if any fields in the database were set to a size larger than the maximum size through a process that accessed the database outside of the ORM.

func (*UnsupportedType) Delete

func (o *UnsupportedType) Delete(ctx context.Context) (err error)

Delete deletes the record from the database.

func (*UnsupportedType) Get

func (o *UnsupportedType) Get(key string) interface{}

Get returns the value of a field in the object based on the field's name. It will also get related objects if they are loaded. Invalid fields and objects are returned as nil. Get can be used to retrieve a value by using the Field() of a node.

func (*UnsupportedType) GetAlias

func (o *UnsupportedType) GetAlias(aliasKey string) query.AliasValue

GetAlias returns the value for the Alias node aliasKey that was returned in the most recent query.

func (*UnsupportedType) Initialize

func (o *UnsupportedType) Initialize()

Initialize will initialize or re-initialize a UnsupportedType database object to default values.

func (*UnsupportedType) IsDirty

func (o *UnsupportedType) IsDirty() (dirty bool)

IsDirty returns true if the object has been changed since it was read from the database or created.

func (*UnsupportedType) IsNew

func (o *UnsupportedType) IsNew() bool

IsNew returns true if the object will create a new record when saved.

func (*UnsupportedType) Key

func (o *UnsupportedType) Key() string

Key returns a unique key for the object, among a list of similar objects.

func (*UnsupportedType) Label

func (o *UnsupportedType) Label() string

Label returns a human-readable label of the object. This would be what a user would see as a description of the object if choosing from a list.

func (*UnsupportedType) MarshalBinary

func (o *UnsupportedType) MarshalBinary() ([]byte, error)

MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database objects over the wire, or for temporary storage. It does not send a version number, so if the data format changes, its up to you to invalidate the old stored objects. The framework uses this to serialize the object when it is stored in a control.

func (*UnsupportedType) MarshalJSON

func (o *UnsupportedType) MarshalJSON() (data []byte, err error)

MarshalJSON serializes the object into a JSON object. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. Another way to control the output is to call MarshalStringMap, modify the map, then encode the map.

func (*UnsupportedType) MarshalStringMap

func (o *UnsupportedType) MarshalStringMap() map[string]interface{}

MarshalStringMap serializes the object into a string map of interfaces. Only valid data will be serialized, meaning, you can control what gets serialized by using Select to select only the fields you want when you query for the object. The keys are the same as the json keys.

func (*UnsupportedType) OriginalPrimaryKey

func (o *UnsupportedType) OriginalPrimaryKey() uint64

OriginalPrimaryKey returns the value of the primary key that was originally loaded into the object when it was read from the database.

func (*UnsupportedType) PrimaryKey

func (o *UnsupportedType) PrimaryKey() uint64

PrimaryKey returns the value of the primary key of the record.

func (*UnsupportedType) Save

func (o *UnsupportedType) Save(ctx context.Context) error

Save will update or insert the object, depending on the state of the object.

If it has an auto-generated primary key, it will be updated after an insert. Database errors generally will be handled by a panic and not returned here, since those indicate a problem with a database driver or configuration.

Save will return a db.OptimisticLockError if it detects a collision when two users are attempting to change the same database record.

It will return a db.UniqueValueError if it detects a collision when an attempt is made to add a record with a unique column that is given a value that is already in the database.

Updating a record that has not changed will have no effect on the database. Updating a record that has linked records will also update any linked records that are MODIFIED, and if optimistic locking is in effect, will also check whether those records have been altered or deleted, returning an OptimisticLockError if so.

func (*UnsupportedType) SetPrimaryKey

func (o *UnsupportedType) SetPrimaryKey(v uint64)

SetPrimaryKey sets the value of the primary key in the object, to be saved later in the database using the Save() function. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*UnsupportedType) SetTypeBinary

func (o *UnsupportedType) SetTypeBinary(v []byte)

SetTypeBinary copies the value of TypeBinary, to be saved later in the database using the Save() function. Passing nil will set type_binary to an empty array.

func (*UnsupportedType) SetTypeEnumerated

func (o *UnsupportedType) SetTypeEnumerated(v []byte)

SetTypeEnumerated copies the value of TypeEnumerated, to be saved later in the database using the Save() function. Passing nil will set type_enumerated to an empty array.

func (*UnsupportedType) SetTypeGeo

func (o *UnsupportedType) SetTypeGeo(v []byte)

SetTypeGeo copies the value of TypeGeo, to be saved later in the database using the Save() function. Passing nil will set type_geo to an empty array.

func (*UnsupportedType) SetTypeMedium

func (o *UnsupportedType) SetTypeMedium(v int)

SetTypeMedium sets the value of TypeMedium in the object, to be saved later in the database using the Save() function.

func (*UnsupportedType) SetTypeMultFk1

func (o *UnsupportedType) SetTypeMultFk1(v string)

SetTypeMultFk1 sets the value of TypeMultFk1 in the object, to be saved later in the database using the Save() function.

func (*UnsupportedType) SetTypeMultiFk2

func (o *UnsupportedType) SetTypeMultiFk2(v string)

SetTypeMultiFk2 sets the value of TypeMultiFk2 in the object, to be saved later in the database using the Save() function.

func (*UnsupportedType) SetTypePolygon

func (o *UnsupportedType) SetTypePolygon(v []byte)

SetTypePolygon copies the value of TypePolygon, to be saved later in the database using the Save() function. Passing nil will set type_polygon to an empty array.

func (*UnsupportedType) SetTypeSerial

func (o *UnsupportedType) SetTypeSerial(v uint64)

SetTypeSerial sets the value of TypeSerial in the object, to be saved later in the database using the Save() function. You cannot change a primary key for a record that has been written to the database. While SQL databases will allow it, NoSql databases will not. Save a copy and delete this one instead.

func (*UnsupportedType) SetTypeSet

func (o *UnsupportedType) SetTypeSet(v []byte)

SetTypeSet copies the value of TypeSet, to be saved later in the database using the Save() function. Passing nil will set type_set to an empty array.

func (*UnsupportedType) SetTypeSmall

func (o *UnsupportedType) SetTypeSmall(v int)

SetTypeSmall sets the value of TypeSmall in the object, to be saved later in the database using the Save() function.

func (*UnsupportedType) SetTypeTinyblob

func (o *UnsupportedType) SetTypeTinyblob(v []byte)

SetTypeTinyblob copies the value of TypeTinyblob, to be saved later in the database using the Save() function. Passing nil will set type_tinyblob to an empty array.

func (*UnsupportedType) String

func (o *UnsupportedType) String() string

String implements the Stringer interface and returns a description of the record, primarily for debugging.

func (*UnsupportedType) TypeBinary

func (o *UnsupportedType) TypeBinary() []byte

TypeBinary returns the value of the loaded type_binary field in the database.

func (*UnsupportedType) TypeBinaryIsLoaded

func (o *UnsupportedType) TypeBinaryIsLoaded() bool

TypeBinaryIsLoaded returns true if the value was loaded from the database or has been set.

func (*UnsupportedType) TypeEnumerated

func (o *UnsupportedType) TypeEnumerated() []byte

TypeEnumerated returns the value of the loaded type_enumerated field in the database.

func (*UnsupportedType) TypeEnumeratedIsLoaded

func (o *UnsupportedType) TypeEnumeratedIsLoaded() bool

TypeEnumeratedIsLoaded returns true if the value was loaded from the database or has been set.

func (*UnsupportedType) TypeGeo

func (o *UnsupportedType) TypeGeo() []byte

TypeGeo returns the value of the loaded type_geo field in the database.

func (*UnsupportedType) TypeGeoIsLoaded

func (o *UnsupportedType) TypeGeoIsLoaded() bool

TypeGeoIsLoaded returns true if the value was loaded from the database or has been set.

func (*UnsupportedType) TypeMedium

func (o *UnsupportedType) TypeMedium() int

TypeMedium returns the value of the loaded type_medium field in the database.

func (*UnsupportedType) TypeMediumIsLoaded

func (o *UnsupportedType) TypeMediumIsLoaded() bool

TypeMediumIsLoaded returns true if the value was loaded from the database or has been set.

func (*UnsupportedType) TypeMultFk1

func (o *UnsupportedType) TypeMultFk1() string

TypeMultFk1 returns the value of the loaded type_mult_fk1 field in the database.

func (*UnsupportedType) TypeMultFk1IsLoaded

func (o *UnsupportedType) TypeMultFk1IsLoaded() bool

TypeMultFk1IsLoaded returns true if the value was loaded from the database or has been set.

func (*UnsupportedType) TypeMultiFk2

func (o *UnsupportedType) TypeMultiFk2() string

TypeMultiFk2 returns the value of the loaded type_multi_fk2 field in the database.

func (*UnsupportedType) TypeMultiFk2IsLoaded

func (o *UnsupportedType) TypeMultiFk2IsLoaded() bool

TypeMultiFk2IsLoaded returns true if the value was loaded from the database or has been set.

func (*UnsupportedType) TypePolygon

func (o *UnsupportedType) TypePolygon() []byte

TypePolygon returns the value of the loaded type_polygon field in the database.

func (*UnsupportedType) TypePolygonIsLoaded

func (o *UnsupportedType) TypePolygonIsLoaded() bool

TypePolygonIsLoaded returns true if the value was loaded from the database or has been set.

func (*UnsupportedType) TypeSerial

func (o *UnsupportedType) TypeSerial() uint64

TypeSerial returns the loaded value of the type_serial field in the database.

func (*UnsupportedType) TypeSerialIsLoaded

func (o *UnsupportedType) TypeSerialIsLoaded() bool

TypeSerialIsLoaded returns true if the value was loaded from the database or has been set.

func (*UnsupportedType) TypeSet

func (o *UnsupportedType) TypeSet() []byte

TypeSet returns the value of the loaded type_set field in the database.

func (*UnsupportedType) TypeSetIsLoaded

func (o *UnsupportedType) TypeSetIsLoaded() bool

TypeSetIsLoaded returns true if the value was loaded from the database or has been set.

func (*UnsupportedType) TypeSmall

func (o *UnsupportedType) TypeSmall() int

TypeSmall returns the value of the loaded type_small field in the database.

func (*UnsupportedType) TypeSmallIsLoaded

func (o *UnsupportedType) TypeSmallIsLoaded() bool

TypeSmallIsLoaded returns true if the value was loaded from the database or has been set.

func (*UnsupportedType) TypeTinyblob

func (o *UnsupportedType) TypeTinyblob() []byte

TypeTinyblob returns the value of the loaded type_tinyblob field in the database.

func (*UnsupportedType) TypeTinyblobIsLoaded

func (o *UnsupportedType) TypeTinyblobIsLoaded() bool

TypeTinyblobIsLoaded returns true if the value was loaded from the database or has been set.

func (*UnsupportedType) UnmarshalBinary

func (o *UnsupportedType) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary converts a structure that was created with MarshalBinary into a UnsupportedType object.

func (*UnsupportedType) UnmarshalJSON

func (o *UnsupportedType) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON unmarshalls the given json data into the UnsupportedType. The UnsupportedType can be a newly created object, or one loaded from the database.

After unmarshalling, the object is not saved. You must call Save to insert it into the database or update it.

Unmarshalling of sub-objects, as in objects linked via foreign keys, is not currently supported.

The fields it expects are:

"typeSerial" - uint64
"typeSet" - []byte
"typeEnumerated" - []byte
"typeGeo" - []byte
"typeTinyblob" - []byte
"typeBinary" - []byte
"typeSmall" - int
"typeMedium" - int
"typePolygon" - []byte
"typeMultFk1" - string
"typeMultiFk2" - string

func (*UnsupportedType) UnmarshalStringMap

func (o *UnsupportedType) UnmarshalStringMap(m map[string]interface{}) (err error)

UnmarshalStringMap will load the values from the stringmap into the object.

Override this in UnsupportedType to modify the json before sending it here.

type UnsupportedTypeBuilder

type UnsupportedTypeBuilder struct {
	// contains filtered or unexported fields
}

The UnsupportedTypeBuilder uses a builder pattern to create a query on the database. Create a UnsupportedTypeBuilder by calling QueryUnsupportedTypes, which will select all the UnsupportedType object in the database. Then filter and arrange those objects by calling Where, Select, etc. End a query by calling either Load, LoadI, LoadCursor, Get, or Count. A UnsupportedTypeBuilder stores the context it will use to perform the query, and thus is meant to be a short-lived object. You should not save it for later use.

func QueryUnsupportedTypes

func QueryUnsupportedTypes(ctx context.Context) *UnsupportedTypeBuilder

QueryUnsupportedTypes returns a new query builder. See UnsupportedTypeBuilder for doc on how to use the builder. You should pass a context that has a timeout with it to protect against a long delay from the database possibly hanging your application. You can set a ReadTimeout value on the schema to do this by default during code generation.

func (*UnsupportedTypeBuilder) Calculation

Calculation adds operation as an aliased value onto base. After the query, you can read the data by passing alias to GetAlias on the returned object.

func (*UnsupportedTypeBuilder) Count

func (b *UnsupportedTypeBuilder) Count() (int, error)

Count terminates a query and returns just the number of items in the result. If you have Select or Calculation columns in the query, it will count NULL results as well. To not count NULL values, use Where in the builder with a NotNull operation. To count distinct combinations of items, call Distinct() on the builder.

func (*UnsupportedTypeBuilder) Distinct

Distinct removes duplicates from the results of the query. Adding a Select() is usually required.

func (*UnsupportedTypeBuilder) Get

Get is a convenience method to return only the first item found in a query. The entire query is performed, so you should generally use this only if you know you are selecting on one or very few items. If an error occurs, or no results are found, a nil is returned.

func (*UnsupportedTypeBuilder) GroupBy

GroupBy controls how results are grouped when using aggregate functions with Calculation.

func (*UnsupportedTypeBuilder) Having

Having does additional filtering on the results of the query after the query is performed.

func (*UnsupportedTypeBuilder) Limit

func (b *UnsupportedTypeBuilder) Limit(maxRowCount int, offset int) *UnsupportedTypeBuilder

Limit will return a subset of the data, limited to the offset and number of rows specified. For large data sets and specific types of queries, this can be slow, because it will perform the entire query before computing the limit. You cannot limit a query that has embedded arrays.

func (*UnsupportedTypeBuilder) Load

func (b *UnsupportedTypeBuilder) Load() (unsupportedTypes []*UnsupportedType, err error)

Load terminates the query builder, performs the query, and returns a slice of UnsupportedType objects. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*UnsupportedTypeBuilder) LoadCursor

func (b *UnsupportedTypeBuilder) LoadCursor() (unsupportedTypesCursor, error)

LoadCursor terminates the query builder, performs the query, and returns a cursor to the query.

A query cursor is useful for dealing with large amounts of query results. However, there are some limitations to its use. When working with SQL databases, you cannot use a cursor while querying many-to-many or reverse relationships that will create an array of values.

Call Next() on the returned cursor object to step through the results. Make sure you call Close on the cursor object when you are done. You should use

defer cursor.Close()

to make sure the cursor gets closed.

func (*UnsupportedTypeBuilder) LoadI

func (b *UnsupportedTypeBuilder) LoadI() (unsupportedTypes []query.OrmObj, err error)

LoadI terminates the query builder, performs the query, and returns a slice of interfaces. This can then satisfy a variety of interfaces that load arrays of objects, including KeyLabeler. If there are any errors, nil is returned and the specific error is stored in the context. If no results come back from the query, it will return a non-nil empty slice.

func (*UnsupportedTypeBuilder) OrderBy

OrderBy specifies how the resulting data should be sorted. By default, the given nodes are sorted in ascending order. Add Descending() to the node to specify that it should be sorted in descending order.

func (*UnsupportedTypeBuilder) Select

Select specifies what specific columns will be loaded with data. By default, all the columns of the unsupported_type table will be queried and loaded. If nodes contains columns from the unsupported_type table, that will limit the columns queried and loaded to only those columns. If related tables are specified, then all the columns from those tables are queried, selected and joined to the result. If columns in related tables are specified, then only those columns will be queried and loaded. Depending on the query, additional columns may automatically be added to the query. In particular, primary key columns will be added in most situations. The exception to this would be in distinct queries, group by queries, or subqueries.

func (*UnsupportedTypeBuilder) Where

Where adds a condition to filter what gets selected. Calling Where multiple times will AND the conditions together.

Directories

Path Synopsis
Package node contains the generated node objects that refer to tables, columns and aliases when doing a query.
Package node contains the generated node objects that refer to tables, columns and aliases when doing a query.

Jump to

Keyboard shortcuts

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