model

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ForwardIDDefault                     = ""
	ForwardNameDefault                   = ""
	ForwardReverseNotNullIDDefault       = ""
	ForwardReverseUniqueNotNullIDDefault = ""
	ForwardReverseNullIDDefault          = ""
	ForwardReverseUniqueNullIDDefault    = ""
)
View Source
const (
	Forward_ID                     = `ID`
	Forward_Name                   = `Name`
	Forward_ReverseNotNullID       = `ReverseNotNullID`
	Forward_ReverseNotNull         = `ReverseNotNull`
	Forward_ReverseUniqueNotNullID = `ReverseUniqueNotNullID`
	Forward_ReverseUniqueNotNull   = `ReverseUniqueNotNull`
	Forward_ReverseNullID          = `ReverseNullID`
	Forward_ReverseNull            = `ReverseNull`
	Forward_ReverseUniqueNullID    = `ReverseUniqueNullID`
	Forward_ReverseUniqueNull      = `ReverseUniqueNull`
)
View Source
const (
	ReverseIDDefault   = ""
	ReverseNameDefault = ""
)
View Source
const (
	Reverse_ID             = `ID`
	Reverse_Name           = `Name`
	ReverseForwardCascades = `ForwardCascades`

	ReverseForwardCascadeUnique = `ForwardCascadeUnique`
	ReverseForwardNulls         = `ForwardNulls`

	ReverseForwardNullUnique = `ForwardNullUnique`
	ReverseForwardRestricts  = `ForwardRestricts`

	ReverseForwardRestrictUnique = `ForwardRestrictUnique`
)

Variables

This section is empty.

Functions

func CountForwardByID

func CountForwardByID(ctx context.Context, id string) uint

func CountForwardByName

func CountForwardByName(ctx context.Context, name string) uint

func CountForwardByReverseNotNullID

func CountForwardByReverseNotNullID(ctx context.Context, reverseNotNullID string) uint

func CountForwardByReverseNullID

func CountForwardByReverseNullID(ctx context.Context, reverseNullID string) uint

func CountForwardByReverseUniqueNotNullID

func CountForwardByReverseUniqueNotNullID(ctx context.Context, reverseUniqueNotNullID string) uint

func CountForwardByReverseUniqueNullID

func CountForwardByReverseUniqueNullID(ctx context.Context, reverseUniqueNullID string) uint

func CountReverseByID

func CountReverseByID(ctx context.Context, id string) uint

func CountReverseByName

func CountReverseByName(ctx context.Context, name string) uint

func Database

func Database() db.DatabaseI

func DeleteForward

func DeleteForward(ctx context.Context, pk string)

DeleteForward deletes the given record from the database. Note that you can also delete loaded Forward objects by calling Delete on them.

func DeleteReverse

func DeleteReverse(ctx context.Context, pk string)

DeleteReverse deletes the given record from the database. Note that you can also delete loaded Reverse objects by calling Delete on them.

Types

type Forward

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

func LoadForward

func LoadForward(ctx context.Context, primaryKey string, joinOrSelectNodes ...query.NodeI) *Forward

Load returns a Forward from the database. joinOrSelectNodes lets you provide nodes for joining to other tables or selecting specific fields. Table nodes will be considered Join nodes, and column nodes will be Select nodes. See Join() and Select() for more info.

func LoadForwardByReverseUniqueNotNullID

func LoadForwardByReverseUniqueNotNullID(ctx context.Context, reverse_unique_not_null_id string, joinOrSelectNodes ...query.NodeI) *Forward

LoadForwardByReverseUniqueNotNullID queries for a single Forward object by the given unique index values. joinOrSelectNodes lets you provide nodes for joining to other tables or selecting specific fields. Table nodes will be considered Join nodes, and column nodes will be Select nodes. See Join() and Select() for more info. If you need a more elaborate query, use QueryForwards() to start a query builder.

func LoadForwardByReverseUniqueNullID

func LoadForwardByReverseUniqueNullID(ctx context.Context, reverse_unique_null_id string, joinOrSelectNodes ...query.NodeI) *Forward

LoadForwardByReverseUniqueNullID queries for a single Forward object by the given unique index values. joinOrSelectNodes lets you provide nodes for joining to other tables or selecting specific fields. Table nodes will be considered Join nodes, and column nodes will be Select nodes. See Join() and Select() for more info. If you need a more elaborate query, use QueryForwards() to start a query builder.

func NewForward

func NewForward() *Forward

Create a new Forward object and initialize to default values.

func (*Forward) Delete

func (o *Forward) Delete(ctx context.Context)

Delete deletes the associated record from the database.

func (*Forward) Get

func (o *Forward) 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

func (*Forward) GetAlias

func (o *Forward) GetAlias(key string) query.AliasValue

GetAlias returns the alias for the given key.

func (*Forward) ID

func (o *Forward) ID() string

ID returns the loaded value of ID.

func (*Forward) IDIsValid

func (o *Forward) IDIsValid() bool

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

func (*Forward) Initialize

func (o *Forward) Initialize()

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

func (*Forward) Insert

func (o *Forward) Insert(ctx context.Context)

Insert forces the object to be inserted into the database. If the object was loaded from the database originally, this will create a duplicate in the database.

func (*Forward) IsDirty

func (o *Forward) IsDirty() bool

func (*Forward) LoadReverseNotNull

func (o *Forward) LoadReverseNotNull(ctx context.Context) *Reverse

LoadReverseNotNull returns the related ReverseNotNull. If it is not already loaded, it will attempt to load it first.

func (*Forward) LoadReverseNull

func (o *Forward) LoadReverseNull(ctx context.Context) *Reverse

LoadReverseNull returns the related ReverseNull. If it is not already loaded, it will attempt to load it first.

func (*Forward) LoadReverseUniqueNotNull

func (o *Forward) LoadReverseUniqueNotNull(ctx context.Context) *Reverse

LoadReverseUniqueNotNull returns the related ReverseUniqueNotNull. If it is not already loaded, it will attempt to load it first.

func (*Forward) LoadReverseUniqueNull

func (o *Forward) LoadReverseUniqueNull(ctx context.Context) *Reverse

LoadReverseUniqueNull returns the related ReverseUniqueNull. If it is not already loaded, it will attempt to load it first.

func (*Forward) MarshalBinary

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

MarshalBinary serializes the object into a buffer that is deserializable using UnmarshalBinary. It should be used for transmitting database object 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 (*Forward) MarshalJSON

func (o *Forward) 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.

func (*Forward) Name

func (o *Forward) Name() string

func (*Forward) NameIsValid

func (o *Forward) NameIsValid() bool

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

func (*Forward) PrimaryKey

func (o *Forward) PrimaryKey() string

func (*Forward) ReverseNotNull

func (o *Forward) ReverseNotNull() *Reverse

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

func (*Forward) ReverseNotNullID

func (o *Forward) ReverseNotNullID() string

func (*Forward) ReverseNotNullIDIsValid

func (o *Forward) ReverseNotNullIDIsValid() bool

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

func (*Forward) ReverseNull

func (o *Forward) ReverseNull() *Reverse

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

func (*Forward) ReverseNullID

func (o *Forward) ReverseNullID() string

func (*Forward) ReverseNullIDIsNull

func (o *Forward) ReverseNullIDIsNull() bool

ReverseNullIDIsNull returns true if the related database value is null.

func (*Forward) ReverseNullIDIsValid

func (o *Forward) ReverseNullIDIsValid() bool

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

func (*Forward) ReverseUniqueNotNull

func (o *Forward) ReverseUniqueNotNull() *Reverse

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

func (*Forward) ReverseUniqueNotNullID

func (o *Forward) ReverseUniqueNotNullID() string

func (*Forward) ReverseUniqueNotNullIDIsValid

func (o *Forward) ReverseUniqueNotNullIDIsValid() bool

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

func (*Forward) ReverseUniqueNull

func (o *Forward) ReverseUniqueNull() *Reverse

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

func (*Forward) ReverseUniqueNullID

func (o *Forward) ReverseUniqueNullID() string

func (*Forward) ReverseUniqueNullIDIsNull

func (o *Forward) ReverseUniqueNullIDIsNull() bool

ReverseUniqueNullIDIsNull returns true if the related database value is null.

func (*Forward) ReverseUniqueNullIDIsValid

func (o *Forward) ReverseUniqueNullIDIsValid() bool

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

func (*Forward) Save

func (o *Forward) Save(ctx context.Context)

Save will update or insert the object, depending on the state of the object. If it has any auto-generated ids, those will be updated.

func (*Forward) SetName

func (o *Forward) SetName(v string)

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

func (*Forward) SetReverseNotNull

func (o *Forward) SetReverseNotNull(v *Reverse)

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

func (*Forward) SetReverseNotNullID

func (o *Forward) SetReverseNotNullID(v string)

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

func (*Forward) SetReverseNull

func (o *Forward) SetReverseNull(v *Reverse)

func (*Forward) SetReverseNullID

func (o *Forward) SetReverseNullID(i interface{})

func (*Forward) SetReverseUniqueNotNull

func (o *Forward) SetReverseUniqueNotNull(v *Reverse)

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

func (*Forward) SetReverseUniqueNotNullID

func (o *Forward) SetReverseUniqueNotNullID(v string)

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

func (*Forward) SetReverseUniqueNull

func (o *Forward) SetReverseUniqueNull(v *Reverse)

func (*Forward) SetReverseUniqueNullID

func (o *Forward) SetReverseUniqueNullID(i interface{})

func (*Forward) String

func (o *Forward) String() string

String implements the Stringer interface and returns the default label for the object as it appears in html lists. Typically you would change this to whatever was pertinent to your application.

func (*Forward) UnmarshalBinary

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

func (*Forward) Update

func (o *Forward) Update(ctx context.Context)

Update will update the values in the database, saving any changed values.

type ForwardsBuilder

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

The ForwardsBuilder uses the QueryBuilderI interface from the database to build a query. All query operations go through this query builder. End a query by calling either Load, Count, or Delete

func QueryForwards

func QueryForwards(ctx context.Context) *ForwardsBuilder

QueryForwards returns a new builder that gives you general purpose access to the Forward records in the database. Its here to give public access to the query builder, but you can remove it if you do not need it.

func (*ForwardsBuilder) Alias

func (b *ForwardsBuilder) Alias(name string, n query.NodeI) *ForwardsBuilder

Alias lets you add a node with a custom name. After the query, you can read out the data using GetAlias() on a returned object. Alias is useful for adding calculations or subqueries to the query.

func (*ForwardsBuilder) Count

func (b *ForwardsBuilder) Count(ctx context.Context, distinct bool, nodes ...query.NodeI) uint

Count terminates a query and returns just the number of items selected.

func (*ForwardsBuilder) Delete

func (b *ForwardsBuilder) Delete(ctx context.Context)

Delete uses the query builder to delete a group of records that match the criteria

func (*ForwardsBuilder) Distinct

func (b *ForwardsBuilder) Distinct() *ForwardsBuilder

Distinct removes duplicates from the results of the query. Adding a Select() may help you get to the data you want, although using Distinct with joined tables is often not effective, since we force joined tables to include primary keys in the query, and this often ruins the effect of Distinct.

func (*ForwardsBuilder) Expand

Expand expands an array type node so that it will produce individual rows instead of an array of items

func (*ForwardsBuilder) Get

func (b *ForwardsBuilder) Get(ctx context.Context) *Forward

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.

func (*ForwardsBuilder) GroupBy

func (b *ForwardsBuilder) GroupBy(nodes ...query.NodeI) *ForwardsBuilder

GroupBy controls how results are grouped when using aggregate functions in an Alias() call.

func (*ForwardsBuilder) Having

func (b *ForwardsBuilder) Having(node query.NodeI) *ForwardsBuilder

Having does additional filtering on the results of the query.

func (*ForwardsBuilder) Join

func (b *ForwardsBuilder) Join(n query.NodeI, conditions ...query.NodeI) *ForwardsBuilder

Join adds a node to the node tree so that its fields will appear in the query. Optionally add conditions to filter what gets included. The conditions will be AND'd with the basic condition matching the primary keys of the join.

func (*ForwardsBuilder) Limit

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

Limit will return a subset of the data, limited to the offset and number of rows specified

func (*ForwardsBuilder) Load

func (b *ForwardsBuilder) Load(ctx context.Context) (forwardSlice []*Forward)

Load terminates the query builder, performs the query, and returns a slice of Forward objects. If there are any errors, they are returned in the context object. If no results come back from the query, it will return an empty slice

func (*ForwardsBuilder) LoadI

func (b *ForwardsBuilder) LoadI(ctx context.Context) (forwardSlice []interface{})

LoadI terminates the query builder, performs the query, and returns a slice of interfaces. If there are any errors, they are returned in the context object. If no results come back from the query, it will return an empty slice.

func (*ForwardsBuilder) OrderBy

func (b *ForwardsBuilder) OrderBy(nodes ...query.NodeI) *ForwardsBuilder

OrderBy specifies how the resulting data should be sorted.

func (*ForwardsBuilder) Select

func (b *ForwardsBuilder) Select(nodes ...query.NodeI) *ForwardsBuilder

Select optimizes the query to only return the specified fields. Once you put a Select in your query, you must specify all the fields that you will eventually read out. Be careful when selecting fields in joined tables, as joined tables will also contain pointers back to the parent table, and so the parent node should have the same field selected as the child node if you are querying those fields.

func (*ForwardsBuilder) Subquery

func (b *ForwardsBuilder) Subquery() *query.SubqueryNode

Subquery uses the query builder to define a subquery within a larger query. You MUST include what you are selecting by adding Alias or Select functions on the subquery builder. Generally you would use this as a node to an Alias function on the surrounding query builder.

func (*ForwardsBuilder) Where

Where adds a condition to filter what gets selected.

type Reverse

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

func LoadReverse

func LoadReverse(ctx context.Context, primaryKey string, joinOrSelectNodes ...query.NodeI) *Reverse

Load returns a Reverse from the database. joinOrSelectNodes lets you provide nodes for joining to other tables or selecting specific fields. Table nodes will be considered Join nodes, and column nodes will be Select nodes. See Join() and Select() for more info.

func NewReverse

func NewReverse() *Reverse

Create a new Reverse object and initialize to default values.

func (*Reverse) Delete

func (o *Reverse) Delete(ctx context.Context)

Delete deletes the associated record from the database.

func (*Reverse) ForwardCascade

func (o *Reverse) ForwardCascade(pk string) *ForwardCascade

ForwardCascade returns a single ForwardCascade object by primary key, if one was loaded. Otherwise, it will return nil. It will not return ForwardCascade objects that are not saved.

func (*Reverse) ForwardCascadeUnique

func (o *Reverse) ForwardCascadeUnique() *ForwardCascadeUnique

ForwardCascadeUnique returns the connected ForwardCascadeUnique object, if one was loaded otherwise, it will return nil.

func (*Reverse) ForwardCascades

func (o *Reverse) ForwardCascades() []*ForwardCascade

ForwardCascades returns a slice of ForwardCascade objects if loaded.

func (*Reverse) ForwardNull

func (o *Reverse) ForwardNull(pk string) *ForwardNull

ForwardNull returns a single ForwardNull object by primary key, if one was loaded. Otherwise, it will return nil. It will not return ForwardNull objects that are not saved.

func (*Reverse) ForwardNullUnique

func (o *Reverse) ForwardNullUnique() *ForwardNullUnique

ForwardNullUnique returns the connected ForwardNullUnique object, if one was loaded otherwise, it will return nil.

func (*Reverse) ForwardNulls

func (o *Reverse) ForwardNulls() []*ForwardNull

ForwardNulls returns a slice of ForwardNull objects if loaded.

func (*Reverse) ForwardRestrict

func (o *Reverse) ForwardRestrict(pk string) *ForwardRestrict

ForwardRestrict returns a single ForwardRestrict object by primary key, if one was loaded. Otherwise, it will return nil. It will not return ForwardRestrict objects that are not saved.

func (*Reverse) ForwardRestrictUnique

func (o *Reverse) ForwardRestrictUnique() *ForwardRestrictUnique

ForwardRestrictUnique returns the connected ForwardRestrictUnique object, if one was loaded otherwise, it will return nil.

func (*Reverse) ForwardRestricts

func (o *Reverse) ForwardRestricts() []*ForwardRestrict

ForwardRestricts returns a slice of ForwardRestrict objects if loaded.

func (*Reverse) Get

func (o *Reverse) 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

func (*Reverse) GetAlias

func (o *Reverse) GetAlias(key string) query.AliasValue

GetAlias returns the alias for the given key.

func (*Reverse) ID

func (o *Reverse) ID() string

ID returns the loaded value of ID.

func (*Reverse) IDIsValid

func (o *Reverse) IDIsValid() bool

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

func (*Reverse) Initialize

func (o *Reverse) Initialize()

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

func (*Reverse) IsDirty

func (o *Reverse) IsDirty() bool

func (*Reverse) LoadForwardCascadeUnique

func (o *Reverse) LoadForwardCascadeUnique(ctx context.Context) *ForwardCascadeUnique

LoadForwardCascadeUnique returns the connected ForwardCascadeUnique object, if one was loaded otherwise, it will return nil.

func (*Reverse) LoadForwardCascades

func (o *Reverse) LoadForwardCascades(ctx context.Context, conditions ...interface{}) []*ForwardCascade

LoadForwardCascades loads a new slice of ForwardCascade objects and returns it.

func (*Reverse) LoadForwardNullUnique

func (o *Reverse) LoadForwardNullUnique(ctx context.Context) *ForwardNullUnique

LoadForwardNullUnique returns the connected ForwardNullUnique object, if one was loaded otherwise, it will return nil.

func (*Reverse) LoadForwardNulls

func (o *Reverse) LoadForwardNulls(ctx context.Context, conditions ...interface{}) []*ForwardNull

LoadForwardNulls loads a new slice of ForwardNull objects and returns it.

func (*Reverse) LoadForwardRestrictUnique

func (o *Reverse) LoadForwardRestrictUnique(ctx context.Context) *ForwardRestrictUnique

LoadForwardRestrictUnique returns the connected ForwardRestrictUnique object, if one was loaded otherwise, it will return nil.

func (*Reverse) LoadForwardRestricts

func (o *Reverse) LoadForwardRestricts(ctx context.Context, conditions ...interface{}) []*ForwardRestrict

LoadForwardRestricts loads a new slice of ForwardRestrict objects and returns it.

func (*Reverse) MarshalBinary

func (o *Reverse) 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 (*Reverse) MarshalJSON

func (o *Reverse) 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.

func (*Reverse) Name

func (o *Reverse) Name() string

func (*Reverse) NameIsValid

func (o *Reverse) NameIsValid() bool

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

func (*Reverse) PrimaryKey

func (o *Reverse) PrimaryKey() string

func (*Reverse) Save

func (o *Reverse) Save(ctx context.Context)

Save will update or insert the object, depending on the state of the object. If it has any auto-generated ids, those will be updated.

func (*Reverse) SetForwardCascadeUnique

func (o *Reverse) SetForwardCascadeUnique(obj *ForwardCascadeUnique)

SetForwardCascadeUnique associates the given object with the Reverse. If it has an item already associated with it, the foreign key for that item 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 an item that is not currently attached to this Reverse.

func (*Reverse) SetForwardCascades

func (o *Reverse) SetForwardCascades(objs []*ForwardCascade)

SetForwardCascades associates the given objects with the Reverse. If it has items already associated with it that will not be associated after a save, the foreign keys for those 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 Reverse.

func (*Reverse) SetForwardNullUnique

func (o *Reverse) SetForwardNullUnique(obj *ForwardNullUnique)

SetForwardNullUnique associates the given object with the Reverse. If it has an item already associated with it, the foreign key for that item 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 an item that is not currently attached to this Reverse.

func (*Reverse) SetForwardNulls

func (o *Reverse) SetForwardNulls(objs []*ForwardNull)

SetForwardNulls associates the given objects with the Reverse. If it has items already associated with it that will not be associated after a save, the foreign keys for those 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 Reverse.

func (*Reverse) SetForwardRestrictUnique

func (o *Reverse) SetForwardRestrictUnique(obj *ForwardRestrictUnique)

SetForwardRestrictUnique associates the given object with the Reverse. If it has an item already associated with it, the foreign key for that item 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 an item that is not currently attached to this Reverse.

func (*Reverse) SetForwardRestricts

func (o *Reverse) SetForwardRestricts(objs []*ForwardRestrict)

SetForwardRestricts associates the given objects with the Reverse. WARNING! If it has items already associated with it that will not be associated after a save, those items will be DELETED since they cannot be 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 Reverse.

func (*Reverse) SetName

func (o *Reverse) SetName(v string)

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

func (*Reverse) String

func (o *Reverse) String() string

String implements the Stringer interface and returns the default label for the object as it appears in html lists. Typically you would change this to whatever was pertinent to your application.

func (*Reverse) UnmarshalBinary

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

type ReversesBuilder

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

The ReversesBuilder uses the QueryBuilderI interface from the database to build a query. All query operations go through this query builder. End a query by calling either Load, Count, or Delete

func QueryReverses

func QueryReverses(ctx context.Context) *ReversesBuilder

QueryReverses returns a new builder that gives you general purpose access to the Reverse records in the database. Its here to give public access to the query builder, but you can remove it if you do not need it.

func (*ReversesBuilder) Alias

func (b *ReversesBuilder) Alias(name string, n query.NodeI) *ReversesBuilder

Alias lets you add a node with a custom name. After the query, you can read out the data using GetAlias() on a returned object. Alias is useful for adding calculations or subqueries to the query.

func (*ReversesBuilder) Count

func (b *ReversesBuilder) Count(ctx context.Context, distinct bool, nodes ...query.NodeI) uint

Count terminates a query and returns just the number of items selected.

func (*ReversesBuilder) Delete

func (b *ReversesBuilder) Delete(ctx context.Context)

Delete uses the query builder to delete a group of records that match the criteria

func (*ReversesBuilder) Distinct

func (b *ReversesBuilder) Distinct() *ReversesBuilder

Distinct removes duplicates from the results of the query. Adding a Select() may help you get to the data you want, although using Distinct with joined tables is often not effective, since we force joined tables to include primary keys in the query, and this often ruins the effect of Distinct.

func (*ReversesBuilder) Expand

Expand expands an array type node so that it will produce individual rows instead of an array of items

func (*ReversesBuilder) Get

func (b *ReversesBuilder) Get(ctx context.Context) *Reverse

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.

func (*ReversesBuilder) GroupBy

func (b *ReversesBuilder) GroupBy(nodes ...query.NodeI) *ReversesBuilder

GroupBy controls how results are grouped when using aggregate functions in an Alias() call.

func (*ReversesBuilder) Having

func (b *ReversesBuilder) Having(node query.NodeI) *ReversesBuilder

Having does additional filtering on the results of the query.

func (*ReversesBuilder) Join

func (b *ReversesBuilder) Join(n query.NodeI, conditions ...query.NodeI) *ReversesBuilder

Join adds a node to the node tree so that its fields will appear in the query. Optionally add conditions to filter what gets included. The conditions will be AND'd with the basic condition matching the primary keys of the join.

func (*ReversesBuilder) Limit

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

Limit will return a subset of the data, limited to the offset and number of rows specified

func (*ReversesBuilder) Load

func (b *ReversesBuilder) Load(ctx context.Context) (reverseSlice []*Reverse)

Load terminates the query builder, performs the query, and returns a slice of Reverse objects. If there are any errors, they are returned in the context object. If no results come back from the query, it will return an empty slice

func (*ReversesBuilder) LoadI

func (b *ReversesBuilder) LoadI(ctx context.Context) (reverseSlice []interface{})

LoadI terminates the query builder, performs the query, and returns a slice of interfaces. If there are any errors, they are returned in the context object. If no results come back from the query, it will return an empty slice.

func (*ReversesBuilder) OrderBy

func (b *ReversesBuilder) OrderBy(nodes ...query.NodeI) *ReversesBuilder

OrderBy specifies how the resulting data should be sorted.

func (*ReversesBuilder) Select

func (b *ReversesBuilder) Select(nodes ...query.NodeI) *ReversesBuilder

Select optimizes the query to only return the specified fields. Once you put a Select in your query, you must specify all the fields that you will eventually read out. Be careful when selecting fields in joined tables, as joined tables will also contain pointers back to the parent table, and so the parent node should have the same field selected as the child node if you are querying those fields.

func (*ReversesBuilder) Subquery

func (b *ReversesBuilder) Subquery() *query.SubqueryNode

Subquery uses the query builder to define a subquery within a larger query. You MUST include what you are selecting by adding Alias or Select functions on the subquery builder. Generally you would use this as a node to an Alias function on the surrounding query builder.

func (*ReversesBuilder) Where

Where adds a condition to filter what gets selected.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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