demo

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2018 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const AUserColumnNames = "uid, login, emailaddress, avatar, active, admin, fave, lastupdated, token, secret"
View Source
const AUserDataColumnNames = "login, emailaddress, avatar, active, admin, fave, lastupdated, token, secret"
View Source
const AUserPk = "Uid"
View Source
const AssociationColumnNames = "id, name, quality, ref1, ref2, category"
View Source
const AssociationDataColumnNames = "name, quality, ref1, ref2, category"
View Source
const AssociationPk = "Id"
View Source
const DbCompoundColumnNames = "alpha, beta, category"
View Source
const DbCompoundDataColumnNames = "alpha, beta, category"
View Source
const DbUserColumnNames = "uid, login, emailaddress, avatar, active, admin, fave, lastupdated, token, secret"
View Source
const DbUserDataColumnNames = "login, emailaddress, avatar, active, admin, fave, lastupdated, token, secret"
View Source
const DbUserPk = "Uid"
View Source
const HookColumnNames = "" /* 258-byte string literal not displayed */
View Source
const HookDataColumnNames = "" /* 254-byte string literal not displayed */
View Source
const HookPk = "Id"
View Source
const IssueColumnNames = "id, number, date, title, bigbody, assignee, state, labels"
View Source
const IssueDataColumnNames = "number, date, title, bigbody, assignee, state, labels"
View Source
const IssuePk = "Id"
View Source
const NumAUserColumns = 10
View Source
const NumAUserDataColumns = 9
View Source
const NumAssociationColumns = 6
View Source
const NumAssociationDataColumns = 5
View Source
const NumDbCompoundColumns = 3
View Source
const NumDbCompoundDataColumns = 3
View Source
const NumDbUserColumns = 10
View Source
const NumDbUserDataColumns = 9
View Source
const NumHookColumns = 17
View Source
const NumHookDataColumns = 16
View Source
const NumIssueColumns = 8
View Source
const NumIssueDataColumns = 7
View Source
const RUserColumnNames = "uid, login, emailaddress, avatar, active, admin, fave, lastupdated, token, secret"

Variables

This section is empty.

Functions

This section is empty.

Types

type AUserTable added in v0.8.0

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

AUserTable holds a given table name with the database reference, providing access methods below. The Prefix field is often blank but can be used to hold a table name prefix (e.g. ending in '_'). Or it can specify the name of the schema, in which case it should have a trailing '.'.

func CopyTableAsAUserTable added in v0.8.0

func CopyTableAsAUserTable(origin sqlgen2.Table) AUserTable

CopyTableAsAUserTable copies a table instance, retaining the name etc but providing methods appropriate for 'User'.

func NewAUserTable added in v0.8.0

func NewAUserTable(name sqlgen2.TableName, d sqlgen2.Execer, dialect schema.Dialect) AUserTable

NewAUserTable returns a new table instance. If a blank table name is supplied, the default name "users" will be used instead. The request context is initialised with the background.

func (AUserTable) BeginTx added in v0.8.0

func (tbl AUserTable) BeginTx(opts *sql.TxOptions) (AUserTable, error)

Begin starts a transaction. The default isolation level is dependent on the driver.

func (AUserTable) Count added in v0.8.0

func (tbl AUserTable) Count(wh where.Expression) (count int64, err error)

Count counts the Users in the table that match a 'where' clause. Use a nil value for the 'wh' argument if it is not needed.

func (AUserTable) CountSA added in v0.8.0

func (tbl AUserTable) CountSA(where string, args ...interface{}) (count int64, err error)

CountSA counts Users in the table that match a 'where' clause. Use a blank string for the 'where' argument if it is not needed.

func (AUserTable) CreateIndexes added in v0.8.0

func (tbl AUserTable) CreateIndexes(ifNotExist bool) (err error)

CreateIndexes executes queries that create the indexes needed by the User table.

func (AUserTable) CreateTable added in v0.8.0

func (tbl AUserTable) CreateTable(ifNotExists bool) (int64, error)

CreateTable creates the table.

func (AUserTable) CreateTableWithIndexes added in v0.8.0

func (tbl AUserTable) CreateTableWithIndexes(ifNotExist bool) (err error)

CreateTableWithIndexes invokes CreateTable then CreateIndexes.

func (AUserTable) CreateUserEmailIndex added in v0.8.0

func (tbl AUserTable) CreateUserEmailIndex(ifNotExist bool) error

CreateUserEmailIndex creates the user_email index.

func (AUserTable) CreateUserLoginIndex added in v0.8.0

func (tbl AUserTable) CreateUserLoginIndex(ifNotExist bool) error

CreateUserLoginIndex creates the user_login index.

func (AUserTable) Ctx added in v0.8.0

func (tbl AUserTable) Ctx() context.Context

Ctx gets the current request context.

func (AUserTable) DB added in v0.8.0

func (tbl AUserTable) DB() *sql.DB

DB gets the wrapped database handle, provided this is not within a transaction. Panics if it is in the wrong state - use IsTx() if necessary.

func (AUserTable) Delete added in v0.8.0

func (tbl AUserTable) Delete(wh where.Expression) (int64, error)

Delete deletes one or more rows from the table, given a 'where' clause. Use a nil value for the 'wh' argument if it is not needed (very risky!).

func (AUserTable) DeleteUsers added in v0.8.0

func (tbl AUserTable) DeleteUsers(id ...int64) (int64, error)

DeleteUsers deletes rows from the table, given some primary keys. The list of ids can be arbitrarily long.

func (AUserTable) Dialect added in v0.8.0

func (tbl AUserTable) Dialect() schema.Dialect

Dialect gets the database dialect.

func (AUserTable) DropIndexes added in v0.8.0

func (tbl AUserTable) DropIndexes(ifExist bool) (err error)

DropIndexes executes queries that drop the indexes on by the User table.

func (AUserTable) DropTable added in v0.8.0

func (tbl AUserTable) DropTable(ifExists bool) (int64, error)

DropTable drops the table, destroying all its data.

func (AUserTable) DropUserEmailIndex added in v0.8.0

func (tbl AUserTable) DropUserEmailIndex(ifExists bool) error

DropUserEmailIndex drops the user_email index.

func (AUserTable) DropUserLoginIndex added in v0.8.0

func (tbl AUserTable) DropUserLoginIndex(ifExists bool) error

DropUserLoginIndex drops the user_login index.

func (AUserTable) Exec added in v0.8.0

func (tbl AUserTable) Exec(query string, args ...interface{}) (int64, error)

Exec executes a query without returning any rows. The args are for any placeholder parameters in the query. It returns the number of rows affected (of the database drive supports this).

func (AUserTable) GetUser added in v0.8.0

func (tbl AUserTable) GetUser(id int64) (*User, error)

GetUser gets the record with a given primary key value. If not found, *User will be nil.

func (AUserTable) GetUsers added in v0.8.0

func (tbl AUserTable) GetUsers(id ...int64) (list []*User, err error)

GetUsers gets records from the table according to a list of primary keys. Although the list of ids can be arbitrarily long, there are practical limits; note that Oracle DB has a limit of 1000.

func (AUserTable) Insert added in v0.8.0

func (tbl AUserTable) Insert(vv ...*User) error

Insert adds new records for the Users. The Users have their primary key fields set to the new record identifiers. The User.PreInsert(Execer) method will be called, if it exists.

func (AUserTable) IsTx added in v0.8.0

func (tbl AUserTable) IsTx() bool

IsTx tests whether this is within a transaction.

func (AUserTable) Logger added in v0.8.0

func (tbl AUserTable) Logger() *log.Logger

Logger gets the trace logger.

func (AUserTable) Name added in v0.8.0

func (tbl AUserTable) Name() sqlgen2.TableName

Name gets the table name.

func (AUserTable) Query added in v0.8.0

func (tbl AUserTable) Query(query string, args ...interface{}) ([]*User, error)

Query is the low-level access function for Users.

func (AUserTable) QueryOne added in v0.8.0

func (tbl AUserTable) QueryOne(query string, args ...interface{}) (*User, error)

QueryOne is the low-level access function for one User. If the query selected many rows, only the first is returned; the rest are discarded. If not found, *User will be nil.

func (AUserTable) Select added in v0.8.0

func (tbl AUserTable) Select(wh where.Expression, qc where.QueryConstraint) ([]*User, error)

Select allows Users to be obtained from the table that match a 'where' clause. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (AUserTable) SelectOne added in v0.8.0

func (tbl AUserTable) SelectOne(wh where.Expression, qc where.QueryConstraint) (*User, error)

SelectOne allows a single User to be obtained from the sqlgen2. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed. If not found, *Example will be nil.

func (AUserTable) SelectOneSA added in v0.8.0

func (tbl AUserTable) SelectOneSA(where, orderBy string, args ...interface{}) (*User, error)

SelectOneSA allows a single Example to be obtained from the table that match a 'where' clause and some limit. Any order, limit or offset clauses can be supplied in 'orderBy'. Use blank strings for the 'where' and/or 'orderBy' arguments if they are not needed. If not found, *Example will be nil.

func (AUserTable) SelectSA added in v0.8.0

func (tbl AUserTable) SelectSA(where, orderBy string, args ...interface{}) ([]*User, error)

SelectSA allows Users to be obtained from the table that match a 'where' clause. Any order, limit or offset clauses can be supplied in 'orderBy'. Use blank strings for the 'where' and/or 'orderBy' arguments if they are not needed.

func (AUserTable) SetLogger added in v0.8.0

func (tbl AUserTable) SetLogger(logger *log.Logger) sqlgen2.Table

SetLogger sets the logger for subsequent queries, returning the interface.

func (AUserTable) SetWrapper added in v0.8.0

func (tbl AUserTable) SetWrapper(wrapper interface{}) sqlgen2.Table

SetWrapper sets the user-defined wrapper.

func (AUserTable) SliceActive added in v0.8.0

func (tbl AUserTable) SliceActive(wh where.Expression, qc where.QueryConstraint) ([]bool, error)

SliceActive gets the Active column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (AUserTable) SliceAdmin added in v0.8.0

func (tbl AUserTable) SliceAdmin(wh where.Expression, qc where.QueryConstraint) ([]bool, error)

SliceAdmin gets the Admin column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (AUserTable) SliceAvatar added in v0.8.0

func (tbl AUserTable) SliceAvatar(wh where.Expression, qc where.QueryConstraint) ([]string, error)

SliceAvatar gets the Avatar column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (AUserTable) SliceEmailaddress added in v0.8.0

func (tbl AUserTable) SliceEmailaddress(wh where.Expression, qc where.QueryConstraint) ([]string, error)

SliceEmailAddress gets the EmailAddress column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (AUserTable) SliceLastupdated added in v0.8.0

func (tbl AUserTable) SliceLastupdated(wh where.Expression, qc where.QueryConstraint) ([]int64, error)

SliceLastUpdated gets the LastUpdated column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (AUserTable) SliceLogin added in v0.8.0

func (tbl AUserTable) SliceLogin(wh where.Expression, qc where.QueryConstraint) ([]string, error)

SliceLogin gets the Login column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (AUserTable) SliceUid added in v0.8.0

func (tbl AUserTable) SliceUid(wh where.Expression, qc where.QueryConstraint) ([]int64, error)

SliceUid gets the Uid column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (AUserTable) Truncate added in v0.8.0

func (tbl AUserTable) Truncate(force bool) (err error)

Truncate drops every record from the table, if possible. It might fail if constraints exist that prevent some or all rows from being deleted; use the force option to override this.

When 'force' is set true, be aware of the following consequences. When using Mysql, foreign keys in other tables can be left dangling. When using Postgres, a cascade happens, so all 'adjacent' tables (i.e. linked by foreign keys) are also truncated.

func (AUserTable) Tx added in v0.8.0

func (tbl AUserTable) Tx() *sql.Tx

Tx gets the wrapped transaction handle, provided this is within a transaction. Panics if it is in the wrong state - use IsTx() if necessary.

func (AUserTable) Update added in v0.8.0

func (tbl AUserTable) Update(vv ...*User) (int64, error)

Update updates records, matching them by primary key. It returns the number of rows affected. The User.PreUpdate(Execer) method will be called, if it exists.

func (AUserTable) UpdateFields added in v0.8.0

func (tbl AUserTable) UpdateFields(wh where.Expression, fields ...sql.NamedArg) (int64, error)

UpdateFields updates one or more columns, given a 'where' clause. Use a nil value for the 'wh' argument if it is not needed (very risky!).

func (AUserTable) WithContext added in v0.8.0

func (tbl AUserTable) WithContext(ctx context.Context) AUserTable

WithContext sets the context for subsequent queries.

func (AUserTable) WithLogger added in v0.8.0

func (tbl AUserTable) WithLogger(logger *log.Logger) AUserTable

WithLogger sets the logger for subsequent queries.

func (AUserTable) WithPrefix added in v0.8.0

func (tbl AUserTable) WithPrefix(pfx string) AUserTable

WithPrefix sets the table name prefix for subsequent queries.

func (AUserTable) Wrapper added in v0.8.0

func (tbl AUserTable) Wrapper() interface{}

Wrapper gets the user-defined wrapper.

type Association

type Association struct {
	Id       int64 `sql:"pk: true, auto: true"`
	Name     *string
	Quality  *string
	Ref1     *int64
	Ref2     *int64
	Category *Category
}

type AssociationTable

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

AssociationTable holds a given table name with the database reference, providing access methods below. The Prefix field is often blank but can be used to hold a table name prefix (e.g. ending in '_'). Or it can specify the name of the schema, in which case it should have a trailing '.'.

func CopyTableAsAssociationTable added in v0.8.0

func CopyTableAsAssociationTable(origin sqlgen2.Table) AssociationTable

CopyTableAsAssociationTable copies a table instance, retaining the name etc but providing methods appropriate for 'Association'.

func NewAssociationTable

func NewAssociationTable(name sqlgen2.TableName, d sqlgen2.Execer, dialect schema.Dialect) AssociationTable

NewAssociationTable returns a new table instance. If a blank table name is supplied, the default name "associations" will be used instead. The request context is initialised with the background.

func (AssociationTable) BeginTx

func (tbl AssociationTable) BeginTx(opts *sql.TxOptions) (AssociationTable, error)

Begin starts a transaction. The default isolation level is dependent on the driver.

func (AssociationTable) Count

func (tbl AssociationTable) Count(wh where.Expression) (count int64, err error)

Count counts the Associations in the table that match a 'where' clause. Use a nil value for the 'wh' argument if it is not needed.

func (AssociationTable) CountSA

func (tbl AssociationTable) CountSA(where string, args ...interface{}) (count int64, err error)

CountSA counts Associations in the table that match a 'where' clause. Use a blank string for the 'where' argument if it is not needed.

func (AssociationTable) CreateTable

func (tbl AssociationTable) CreateTable(ifNotExists bool) (int64, error)

CreateTable creates the table.

func (AssociationTable) Ctx

func (tbl AssociationTable) Ctx() context.Context

Ctx gets the current request context.

func (AssociationTable) DB

func (tbl AssociationTable) DB() *sql.DB

DB gets the wrapped database handle, provided this is not within a transaction. Panics if it is in the wrong state - use IsTx() if necessary.

func (AssociationTable) Delete

func (tbl AssociationTable) Delete(wh where.Expression) (int64, error)

Delete deletes one or more rows from the table, given a 'where' clause. Use a nil value for the 'wh' argument if it is not needed (very risky!).

func (AssociationTable) DeleteAssociations added in v0.8.0

func (tbl AssociationTable) DeleteAssociations(id ...int64) (int64, error)

DeleteAssociations deletes rows from the table, given some primary keys. The list of ids can be arbitrarily long.

func (AssociationTable) Dialect

func (tbl AssociationTable) Dialect() schema.Dialect

Dialect gets the database dialect.

func (AssociationTable) DropTable

func (tbl AssociationTable) DropTable(ifExists bool) (int64, error)

DropTable drops the table, destroying all its data.

func (AssociationTable) Exec

func (tbl AssociationTable) Exec(query string, args ...interface{}) (int64, error)

Exec executes a query without returning any rows. The args are for any placeholder parameters in the query. It returns the number of rows affected (of the database drive supports this).

func (AssociationTable) GetAssociation

func (tbl AssociationTable) GetAssociation(id int64) (*Association, error)

GetAssociation gets the record with a given primary key value. If not found, *Association will be nil.

func (AssociationTable) GetAssociations added in v0.8.0

func (tbl AssociationTable) GetAssociations(id ...int64) (list []*Association, err error)

GetAssociations gets records from the table according to a list of primary keys. Although the list of ids can be arbitrarily long, there are practical limits; note that Oracle DB has a limit of 1000.

func (AssociationTable) Insert

func (tbl AssociationTable) Insert(vv ...*Association) error

Insert adds new records for the Associations. The Associations have their primary key fields set to the new record identifiers. The Association.PreInsert(Execer) method will be called, if it exists.

func (AssociationTable) IsTx

func (tbl AssociationTable) IsTx() bool

IsTx tests whether this is within a transaction.

func (AssociationTable) Logger

func (tbl AssociationTable) Logger() *log.Logger

Logger gets the trace logger.

func (AssociationTable) Name

func (tbl AssociationTable) Name() sqlgen2.TableName

Name gets the table name.

func (AssociationTable) Query

func (tbl AssociationTable) Query(query string, args ...interface{}) ([]*Association, error)

Query is the low-level access function for Associations.

func (AssociationTable) QueryOne

func (tbl AssociationTable) QueryOne(query string, args ...interface{}) (*Association, error)

QueryOne is the low-level access function for one Association. If the query selected many rows, only the first is returned; the rest are discarded. If not found, *Association will be nil.

func (AssociationTable) Select

Select allows Associations to be obtained from the table that match a 'where' clause. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (AssociationTable) SelectOne

SelectOne allows a single Association to be obtained from the sqlgen2. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed. If not found, *Example will be nil.

func (AssociationTable) SelectOneSA

func (tbl AssociationTable) SelectOneSA(where, orderBy string, args ...interface{}) (*Association, error)

SelectOneSA allows a single Example to be obtained from the table that match a 'where' clause and some limit. Any order, limit or offset clauses can be supplied in 'orderBy'. Use blank strings for the 'where' and/or 'orderBy' arguments if they are not needed. If not found, *Example will be nil.

func (AssociationTable) SelectSA

func (tbl AssociationTable) SelectSA(where, orderBy string, args ...interface{}) ([]*Association, error)

SelectSA allows Associations to be obtained from the table that match a 'where' clause. Any order, limit or offset clauses can be supplied in 'orderBy'. Use blank strings for the 'where' and/or 'orderBy' arguments if they are not needed.

func (AssociationTable) SetLogger

func (tbl AssociationTable) SetLogger(logger *log.Logger) sqlgen2.Table

SetLogger sets the logger for subsequent queries, returning the interface.

func (AssociationTable) SetWrapper added in v0.8.0

func (tbl AssociationTable) SetWrapper(wrapper interface{}) sqlgen2.Table

SetWrapper sets the user-defined wrapper.

func (AssociationTable) SliceCategory

func (tbl AssociationTable) SliceCategory(wh where.Expression, qc where.QueryConstraint) ([]Category, error)

SliceCategory gets the Category column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (AssociationTable) SliceId

SliceId gets the Id column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (AssociationTable) SliceName

func (tbl AssociationTable) SliceName(wh where.Expression, qc where.QueryConstraint) ([]string, error)

SliceName gets the Name column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (AssociationTable) SliceQuality

func (tbl AssociationTable) SliceQuality(wh where.Expression, qc where.QueryConstraint) ([]string, error)

SliceQuality gets the Quality column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (AssociationTable) SliceRef1

func (tbl AssociationTable) SliceRef1(wh where.Expression, qc where.QueryConstraint) ([]int64, error)

SliceRef1 gets the Ref1 column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (AssociationTable) SliceRef2

func (tbl AssociationTable) SliceRef2(wh where.Expression, qc where.QueryConstraint) ([]int64, error)

SliceRef2 gets the Ref2 column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (AssociationTable) Truncate

func (tbl AssociationTable) Truncate(force bool) (err error)

Truncate drops every record from the table, if possible. It might fail if constraints exist that prevent some or all rows from being deleted; use the force option to override this.

When 'force' is set true, be aware of the following consequences. When using Mysql, foreign keys in other tables can be left dangling. When using Postgres, a cascade happens, so all 'adjacent' tables (i.e. linked by foreign keys) are also truncated.

func (AssociationTable) Tx

func (tbl AssociationTable) Tx() *sql.Tx

Tx gets the wrapped transaction handle, provided this is within a transaction. Panics if it is in the wrong state - use IsTx() if necessary.

func (AssociationTable) Update

func (tbl AssociationTable) Update(vv ...*Association) (int64, error)

Update updates records, matching them by primary key. It returns the number of rows affected. The Association.PreUpdate(Execer) method will be called, if it exists.

func (AssociationTable) UpdateFields

func (tbl AssociationTable) UpdateFields(wh where.Expression, fields ...sql.NamedArg) (int64, error)

UpdateFields updates one or more columns, given a 'where' clause. Use a nil value for the 'wh' argument if it is not needed (very risky!).

func (AssociationTable) WithContext

func (tbl AssociationTable) WithContext(ctx context.Context) AssociationTable

WithContext sets the context for subsequent queries.

func (AssociationTable) WithLogger

func (tbl AssociationTable) WithLogger(logger *log.Logger) AssociationTable

WithLogger sets the logger for subsequent queries.

func (AssociationTable) WithPrefix

func (tbl AssociationTable) WithPrefix(pfx string) AssociationTable

WithPrefix sets the table name prefix for subsequent queries.

func (AssociationTable) Wrapper added in v0.8.0

func (tbl AssociationTable) Wrapper() interface{}

Wrapper gets the user-defined wrapper.

type Author

type Author struct {
	Name     string `sql:"prefixed: true"`
	Email    Email  `sql:"prefixed: true"`
	Username string `sql:"prefixed: true"`
}

type CUserTable added in v0.8.0

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

CUserTable holds a given table name with the database reference, providing access methods below. The Prefix field is often blank but can be used to hold a table name prefix (e.g. ending in '_'). Or it can specify the name of the schema, in which case it should have a trailing '.'.

func CopyTableAsCUserTable added in v0.8.0

func CopyTableAsCUserTable(origin sqlgen2.Table) CUserTable

CopyTableAsCUserTable copies a table instance, retaining the name etc but providing methods appropriate for 'User'.

func NewCUserTable added in v0.8.0

func NewCUserTable(name sqlgen2.TableName, d sqlgen2.Execer, dialect schema.Dialect) CUserTable

NewCUserTable returns a new table instance. If a blank table name is supplied, the default name "users" will be used instead. The request context is initialised with the background.

func (CUserTable) BeginTx added in v0.8.0

func (tbl CUserTable) BeginTx(opts *sql.TxOptions) (CUserTable, error)

Begin starts a transaction. The default isolation level is dependent on the driver.

func (CUserTable) Ctx added in v0.8.0

func (tbl CUserTable) Ctx() context.Context

Ctx gets the current request context.

func (CUserTable) DB added in v0.8.0

func (tbl CUserTable) DB() *sql.DB

DB gets the wrapped database handle, provided this is not within a transaction. Panics if it is in the wrong state - use IsTx() if necessary.

func (CUserTable) Dialect added in v0.8.0

func (tbl CUserTable) Dialect() schema.Dialect

Dialect gets the database dialect.

func (CUserTable) Exec added in v0.8.0

func (tbl CUserTable) Exec(query string, args ...interface{}) (int64, error)

Exec executes a query without returning any rows. The args are for any placeholder parameters in the query. It returns the number of rows affected (of the database drive supports this).

func (CUserTable) Insert added in v0.8.0

func (tbl CUserTable) Insert(vv ...*User) error

Insert adds new records for the Users. The Users have their primary key fields set to the new record identifiers. The User.PreInsert(Execer) method will be called, if it exists.

func (CUserTable) IsTx added in v0.8.0

func (tbl CUserTable) IsTx() bool

IsTx tests whether this is within a transaction.

func (CUserTable) Logger added in v0.8.0

func (tbl CUserTable) Logger() *log.Logger

Logger gets the trace logger.

func (CUserTable) Name added in v0.8.0

func (tbl CUserTable) Name() sqlgen2.TableName

Name gets the table name.

func (CUserTable) Query added in v0.8.0

func (tbl CUserTable) Query(query string, args ...interface{}) ([]*User, error)

Query is the low-level access function for Users.

func (CUserTable) QueryOne added in v0.8.0

func (tbl CUserTable) QueryOne(query string, args ...interface{}) (*User, error)

QueryOne is the low-level access function for one User. If the query selected many rows, only the first is returned; the rest are discarded. If not found, *User will be nil.

func (CUserTable) SetLogger added in v0.8.0

func (tbl CUserTable) SetLogger(logger *log.Logger) sqlgen2.Table

SetLogger sets the logger for subsequent queries, returning the interface.

func (CUserTable) SetWrapper added in v0.8.0

func (tbl CUserTable) SetWrapper(wrapper interface{}) sqlgen2.Table

SetWrapper sets the user-defined wrapper.

func (CUserTable) Tx added in v0.8.0

func (tbl CUserTable) Tx() *sql.Tx

Tx gets the wrapped transaction handle, provided this is within a transaction. Panics if it is in the wrong state - use IsTx() if necessary.

func (CUserTable) WithContext added in v0.8.0

func (tbl CUserTable) WithContext(ctx context.Context) CUserTable

WithContext sets the context for subsequent queries.

func (CUserTable) WithLogger added in v0.8.0

func (tbl CUserTable) WithLogger(logger *log.Logger) CUserTable

WithLogger sets the logger for subsequent queries.

func (CUserTable) WithPrefix added in v0.8.0

func (tbl CUserTable) WithPrefix(pfx string) CUserTable

WithPrefix sets the table name prefix for subsequent queries.

func (CUserTable) Wrapper added in v0.8.0

func (tbl CUserTable) Wrapper() interface{}

Wrapper gets the user-defined wrapper.

type Category

type Category uint8
const (
	Alpha Category = iota
	Beta
	Gamma
	Delta
)

type Commit

type Commit struct {
	ID        string `sql:"name: commit_id"`
	Message   string
	Timestamp string
	Author    *Author
	Committer *Author
}

type Compound

type Compound struct {
	Alpha    string `sql:"unique: alpha_beta"`
	Beta     string `sql:"unique: alpha_beta"`
	Category Category
}

type DUserTable added in v0.8.0

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

DUserTable holds a given table name with the database reference, providing access methods below. The Prefix field is often blank but can be used to hold a table name prefix (e.g. ending in '_'). Or it can specify the name of the schema, in which case it should have a trailing '.'.

func CopyTableAsDUserTable added in v0.8.0

func CopyTableAsDUserTable(origin sqlgen2.Table) DUserTable

CopyTableAsDUserTable copies a table instance, retaining the name etc but providing methods appropriate for 'User'.

func NewDUserTable added in v0.8.0

func NewDUserTable(name sqlgen2.TableName, d sqlgen2.Execer, dialect schema.Dialect) DUserTable

NewDUserTable returns a new table instance. If a blank table name is supplied, the default name "users" will be used instead. The request context is initialised with the background.

func (DUserTable) BeginTx added in v0.8.0

func (tbl DUserTable) BeginTx(opts *sql.TxOptions) (DUserTable, error)

Begin starts a transaction. The default isolation level is dependent on the driver.

func (DUserTable) Ctx added in v0.8.0

func (tbl DUserTable) Ctx() context.Context

Ctx gets the current request context.

func (DUserTable) DB added in v0.8.0

func (tbl DUserTable) DB() *sql.DB

DB gets the wrapped database handle, provided this is not within a transaction. Panics if it is in the wrong state - use IsTx() if necessary.

func (DUserTable) Delete added in v0.8.0

func (tbl DUserTable) Delete(wh where.Expression) (int64, error)

Delete deletes one or more rows from the table, given a 'where' clause. Use a nil value for the 'wh' argument if it is not needed (very risky!).

func (DUserTable) DeleteUsers added in v0.8.0

func (tbl DUserTable) DeleteUsers(id ...int64) (int64, error)

DeleteUsers deletes rows from the table, given some primary keys. The list of ids can be arbitrarily long.

func (DUserTable) Dialect added in v0.8.0

func (tbl DUserTable) Dialect() schema.Dialect

Dialect gets the database dialect.

func (DUserTable) Exec added in v0.8.0

func (tbl DUserTable) Exec(query string, args ...interface{}) (int64, error)

Exec executes a query without returning any rows. The args are for any placeholder parameters in the query. It returns the number of rows affected (of the database drive supports this).

func (DUserTable) IsTx added in v0.8.0

func (tbl DUserTable) IsTx() bool

IsTx tests whether this is within a transaction.

func (DUserTable) Logger added in v0.8.0

func (tbl DUserTable) Logger() *log.Logger

Logger gets the trace logger.

func (DUserTable) Name added in v0.8.0

func (tbl DUserTable) Name() sqlgen2.TableName

Name gets the table name.

func (DUserTable) Query added in v0.8.0

func (tbl DUserTable) Query(query string, args ...interface{}) ([]*User, error)

Query is the low-level access function for Users.

func (DUserTable) QueryOne added in v0.8.0

func (tbl DUserTable) QueryOne(query string, args ...interface{}) (*User, error)

QueryOne is the low-level access function for one User. If the query selected many rows, only the first is returned; the rest are discarded. If not found, *User will be nil.

func (DUserTable) SetLogger added in v0.8.0

func (tbl DUserTable) SetLogger(logger *log.Logger) sqlgen2.Table

SetLogger sets the logger for subsequent queries, returning the interface.

func (DUserTable) SetWrapper added in v0.8.0

func (tbl DUserTable) SetWrapper(wrapper interface{}) sqlgen2.Table

SetWrapper sets the user-defined wrapper.

func (DUserTable) Tx added in v0.8.0

func (tbl DUserTable) Tx() *sql.Tx

Tx gets the wrapped transaction handle, provided this is within a transaction. Panics if it is in the wrong state - use IsTx() if necessary.

func (DUserTable) WithContext added in v0.8.0

func (tbl DUserTable) WithContext(ctx context.Context) DUserTable

WithContext sets the context for subsequent queries.

func (DUserTable) WithLogger added in v0.8.0

func (tbl DUserTable) WithLogger(logger *log.Logger) DUserTable

WithLogger sets the logger for subsequent queries.

func (DUserTable) WithPrefix added in v0.8.0

func (tbl DUserTable) WithPrefix(pfx string) DUserTable

WithPrefix sets the table name prefix for subsequent queries.

func (DUserTable) Wrapper added in v0.8.0

func (tbl DUserTable) Wrapper() interface{}

Wrapper gets the user-defined wrapper.

type Date

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

type Dates

type Dates struct {
	After  string `sql:"size: 20"`
	Before string `sql:"size: 20"`
}

type DbCompoundTable

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

DbCompoundTable holds a given table name with the database reference, providing access methods below. The Prefix field is often blank but can be used to hold a table name prefix (e.g. ending in '_'). Or it can specify the name of the schema, in which case it should have a trailing '.'.

func CopyTableAsDbCompoundTable added in v0.8.0

func CopyTableAsDbCompoundTable(origin sqlgen2.Table) DbCompoundTable

CopyTableAsDbCompoundTable copies a table instance, retaining the name etc but providing methods appropriate for 'Compound'.

func NewDbCompoundTable

func NewDbCompoundTable(name sqlgen2.TableName, d sqlgen2.Execer, dialect schema.Dialect) DbCompoundTable

NewDbCompoundTable returns a new table instance. If a blank table name is supplied, the default name "compounds" will be used instead. The request context is initialised with the background.

func (DbCompoundTable) BeginTx

func (tbl DbCompoundTable) BeginTx(opts *sql.TxOptions) (DbCompoundTable, error)

Begin starts a transaction. The default isolation level is dependent on the driver.

func (DbCompoundTable) Count

func (tbl DbCompoundTable) Count(wh where.Expression) (count int64, err error)

Count counts the Compounds in the table that match a 'where' clause. Use a nil value for the 'wh' argument if it is not needed.

func (DbCompoundTable) CountSA

func (tbl DbCompoundTable) CountSA(where string, args ...interface{}) (count int64, err error)

CountSA counts Compounds in the table that match a 'where' clause. Use a blank string for the 'where' argument if it is not needed.

func (DbCompoundTable) CreateAlphaBetaIndex

func (tbl DbCompoundTable) CreateAlphaBetaIndex(ifNotExist bool) error

CreateAlphaBetaIndex creates the alpha_beta index.

func (DbCompoundTable) CreateIndexes

func (tbl DbCompoundTable) CreateIndexes(ifNotExist bool) (err error)

CreateIndexes executes queries that create the indexes needed by the Compound table.

func (DbCompoundTable) CreateTable

func (tbl DbCompoundTable) CreateTable(ifNotExists bool) (int64, error)

CreateTable creates the table.

func (DbCompoundTable) CreateTableWithIndexes

func (tbl DbCompoundTable) CreateTableWithIndexes(ifNotExist bool) (err error)

CreateTableWithIndexes invokes CreateTable then CreateIndexes.

func (DbCompoundTable) Ctx

func (tbl DbCompoundTable) Ctx() context.Context

Ctx gets the current request context.

func (DbCompoundTable) DB

func (tbl DbCompoundTable) DB() *sql.DB

DB gets the wrapped database handle, provided this is not within a transaction. Panics if it is in the wrong state - use IsTx() if necessary.

func (DbCompoundTable) Delete

func (tbl DbCompoundTable) Delete(wh where.Expression) (int64, error)

Delete deletes one or more rows from the table, given a 'where' clause. Use a nil value for the 'wh' argument if it is not needed (very risky!).

func (DbCompoundTable) Dialect

func (tbl DbCompoundTable) Dialect() schema.Dialect

Dialect gets the database dialect.

func (DbCompoundTable) DropAlphaBetaIndex

func (tbl DbCompoundTable) DropAlphaBetaIndex(ifExists bool) error

DropAlphaBetaIndex drops the alpha_beta index.

func (DbCompoundTable) DropIndexes

func (tbl DbCompoundTable) DropIndexes(ifExist bool) (err error)

DropIndexes executes queries that drop the indexes on by the Compound table.

func (DbCompoundTable) DropTable

func (tbl DbCompoundTable) DropTable(ifExists bool) (int64, error)

DropTable drops the table, destroying all its data.

func (DbCompoundTable) Exec

func (tbl DbCompoundTable) Exec(query string, args ...interface{}) (int64, error)

Exec executes a query without returning any rows. The args are for any placeholder parameters in the query. It returns the number of rows affected (of the database drive supports this).

func (DbCompoundTable) Insert

func (tbl DbCompoundTable) Insert(vv ...*Compound) error

Insert adds new records for the Compounds. The Compound.PreInsert(Execer) method will be called, if it exists.

func (DbCompoundTable) IsTx

func (tbl DbCompoundTable) IsTx() bool

IsTx tests whether this is within a transaction.

func (DbCompoundTable) Logger

func (tbl DbCompoundTable) Logger() *log.Logger

Logger gets the trace logger.

func (DbCompoundTable) Name

func (tbl DbCompoundTable) Name() sqlgen2.TableName

Name gets the table name.

func (DbCompoundTable) Query

func (tbl DbCompoundTable) Query(query string, args ...interface{}) ([]*Compound, error)

Query is the low-level access function for Compounds.

func (DbCompoundTable) QueryOne

func (tbl DbCompoundTable) QueryOne(query string, args ...interface{}) (*Compound, error)

QueryOne is the low-level access function for one Compound. If the query selected many rows, only the first is returned; the rest are discarded. If not found, *Compound will be nil.

func (DbCompoundTable) Select

Select allows Compounds to be obtained from the table that match a 'where' clause. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (DbCompoundTable) SelectOne

SelectOne allows a single Compound to be obtained from the sqlgen2. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed. If not found, *Example will be nil.

func (DbCompoundTable) SelectOneSA

func (tbl DbCompoundTable) SelectOneSA(where, orderBy string, args ...interface{}) (*Compound, error)

SelectOneSA allows a single Example to be obtained from the table that match a 'where' clause and some limit. Any order, limit or offset clauses can be supplied in 'orderBy'. Use blank strings for the 'where' and/or 'orderBy' arguments if they are not needed. If not found, *Example will be nil.

func (DbCompoundTable) SelectSA

func (tbl DbCompoundTable) SelectSA(where, orderBy string, args ...interface{}) ([]*Compound, error)

SelectSA allows Compounds to be obtained from the table that match a 'where' clause. Any order, limit or offset clauses can be supplied in 'orderBy'. Use blank strings for the 'where' and/or 'orderBy' arguments if they are not needed.

func (DbCompoundTable) SetLogger

func (tbl DbCompoundTable) SetLogger(logger *log.Logger) sqlgen2.Table

SetLogger sets the logger for subsequent queries, returning the interface.

func (DbCompoundTable) SetWrapper added in v0.8.0

func (tbl DbCompoundTable) SetWrapper(wrapper interface{}) sqlgen2.Table

SetWrapper sets the user-defined wrapper.

func (DbCompoundTable) SliceAlpha

func (tbl DbCompoundTable) SliceAlpha(wh where.Expression, qc where.QueryConstraint) ([]string, error)

SliceAlpha gets the Alpha column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (DbCompoundTable) SliceBeta

func (tbl DbCompoundTable) SliceBeta(wh where.Expression, qc where.QueryConstraint) ([]string, error)

SliceBeta gets the Beta column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (DbCompoundTable) SliceCategory

func (tbl DbCompoundTable) SliceCategory(wh where.Expression, qc where.QueryConstraint) ([]Category, error)

SliceCategory gets the Category column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (DbCompoundTable) Truncate

func (tbl DbCompoundTable) Truncate(force bool) (err error)

Truncate drops every record from the table, if possible. It might fail if constraints exist that prevent some or all rows from being deleted; use the force option to override this.

When 'force' is set true, be aware of the following consequences. When using Mysql, foreign keys in other tables can be left dangling. When using Postgres, a cascade happens, so all 'adjacent' tables (i.e. linked by foreign keys) are also truncated.

func (DbCompoundTable) Tx

func (tbl DbCompoundTable) Tx() *sql.Tx

Tx gets the wrapped transaction handle, provided this is within a transaction. Panics if it is in the wrong state - use IsTx() if necessary.

func (DbCompoundTable) UpdateFields

func (tbl DbCompoundTable) UpdateFields(wh where.Expression, fields ...sql.NamedArg) (int64, error)

UpdateFields updates one or more columns, given a 'where' clause. Use a nil value for the 'wh' argument if it is not needed (very risky!).

func (DbCompoundTable) WithContext

func (tbl DbCompoundTable) WithContext(ctx context.Context) DbCompoundTable

WithContext sets the context for subsequent queries.

func (DbCompoundTable) WithLogger

func (tbl DbCompoundTable) WithLogger(logger *log.Logger) DbCompoundTable

WithLogger sets the logger for subsequent queries.

func (DbCompoundTable) WithPrefix

func (tbl DbCompoundTable) WithPrefix(pfx string) DbCompoundTable

WithPrefix sets the table name prefix for subsequent queries.

func (DbCompoundTable) Wrapper added in v0.8.0

func (tbl DbCompoundTable) Wrapper() interface{}

Wrapper gets the user-defined wrapper.

type DbUserTable

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

DbUserTable holds a given table name with the database reference, providing access methods below. The Prefix field is often blank but can be used to hold a table name prefix (e.g. ending in '_'). Or it can specify the name of the schema, in which case it should have a trailing '.'.

func CopyTableAsDbUserTable added in v0.8.0

func CopyTableAsDbUserTable(origin sqlgen2.Table) DbUserTable

CopyTableAsDbUserTable copies a table instance, retaining the name etc but providing methods appropriate for 'User'.

func NewDbUserTable

func NewDbUserTable(name sqlgen2.TableName, d sqlgen2.Execer, dialect schema.Dialect) DbUserTable

NewDbUserTable returns a new table instance. If a blank table name is supplied, the default name "users" will be used instead. The request context is initialised with the background.

func (DbUserTable) BeginTx

func (tbl DbUserTable) BeginTx(opts *sql.TxOptions) (DbUserTable, error)

Begin starts a transaction. The default isolation level is dependent on the driver.

func (DbUserTable) Count

func (tbl DbUserTable) Count(wh where.Expression) (count int64, err error)

Count counts the Users in the table that match a 'where' clause. Use a nil value for the 'wh' argument if it is not needed.

func (DbUserTable) CountSA

func (tbl DbUserTable) CountSA(where string, args ...interface{}) (count int64, err error)

CountSA counts Users in the table that match a 'where' clause. Use a blank string for the 'where' argument if it is not needed.

func (DbUserTable) CreateIndexes

func (tbl DbUserTable) CreateIndexes(ifNotExist bool) (err error)

CreateIndexes executes queries that create the indexes needed by the User table.

func (DbUserTable) CreateTable

func (tbl DbUserTable) CreateTable(ifNotExists bool) (int64, error)

CreateTable creates the table.

func (DbUserTable) CreateTableWithIndexes

func (tbl DbUserTable) CreateTableWithIndexes(ifNotExist bool) (err error)

CreateTableWithIndexes invokes CreateTable then CreateIndexes.

func (DbUserTable) CreateUserEmailIndex

func (tbl DbUserTable) CreateUserEmailIndex(ifNotExist bool) error

CreateUserEmailIndex creates the user_email index.

func (DbUserTable) CreateUserLoginIndex

func (tbl DbUserTable) CreateUserLoginIndex(ifNotExist bool) error

CreateUserLoginIndex creates the user_login index.

func (DbUserTable) Ctx

func (tbl DbUserTable) Ctx() context.Context

Ctx gets the current request context.

func (DbUserTable) DB

func (tbl DbUserTable) DB() *sql.DB

DB gets the wrapped database handle, provided this is not within a transaction. Panics if it is in the wrong state - use IsTx() if necessary.

func (DbUserTable) Delete

func (tbl DbUserTable) Delete(wh where.Expression) (int64, error)

Delete deletes one or more rows from the table, given a 'where' clause. Use a nil value for the 'wh' argument if it is not needed (very risky!).

func (DbUserTable) DeleteUsers added in v0.8.0

func (tbl DbUserTable) DeleteUsers(id ...int64) (int64, error)

DeleteUsers deletes rows from the table, given some primary keys. The list of ids can be arbitrarily long.

func (DbUserTable) Dialect

func (tbl DbUserTable) Dialect() schema.Dialect

Dialect gets the database dialect.

func (DbUserTable) DropIndexes

func (tbl DbUserTable) DropIndexes(ifExist bool) (err error)

DropIndexes executes queries that drop the indexes on by the User table.

func (DbUserTable) DropTable

func (tbl DbUserTable) DropTable(ifExists bool) (int64, error)

DropTable drops the table, destroying all its data.

func (DbUserTable) DropUserEmailIndex

func (tbl DbUserTable) DropUserEmailIndex(ifExists bool) error

DropUserEmailIndex drops the user_email index.

func (DbUserTable) DropUserLoginIndex

func (tbl DbUserTable) DropUserLoginIndex(ifExists bool) error

DropUserLoginIndex drops the user_login index.

func (DbUserTable) Exec

func (tbl DbUserTable) Exec(query string, args ...interface{}) (int64, error)

Exec executes a query without returning any rows. The args are for any placeholder parameters in the query. It returns the number of rows affected (of the database drive supports this).

func (DbUserTable) GetUser

func (tbl DbUserTable) GetUser(id int64) (*User, error)

GetUser gets the record with a given primary key value. If not found, *User will be nil.

func (DbUserTable) GetUsers added in v0.8.0

func (tbl DbUserTable) GetUsers(id ...int64) (list []*User, err error)

GetUsers gets records from the table according to a list of primary keys. Although the list of ids can be arbitrarily long, there are practical limits; note that Oracle DB has a limit of 1000.

func (DbUserTable) Insert

func (tbl DbUserTable) Insert(vv ...*User) error

Insert adds new records for the Users. The Users have their primary key fields set to the new record identifiers. The User.PreInsert(Execer) method will be called, if it exists.

func (DbUserTable) IsTx

func (tbl DbUserTable) IsTx() bool

IsTx tests whether this is within a transaction.

func (DbUserTable) Logger

func (tbl DbUserTable) Logger() *log.Logger

Logger gets the trace logger.

func (DbUserTable) Name

func (tbl DbUserTable) Name() sqlgen2.TableName

Name gets the table name.

func (DbUserTable) Query

func (tbl DbUserTable) Query(query string, args ...interface{}) ([]*User, error)

Query is the low-level access function for Users.

func (DbUserTable) QueryOne

func (tbl DbUserTable) QueryOne(query string, args ...interface{}) (*User, error)

QueryOne is the low-level access function for one User. If the query selected many rows, only the first is returned; the rest are discarded. If not found, *User will be nil.

func (DbUserTable) Select

func (tbl DbUserTable) Select(wh where.Expression, qc where.QueryConstraint) ([]*User, error)

Select allows Users to be obtained from the table that match a 'where' clause. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (DbUserTable) SelectOne

func (tbl DbUserTable) SelectOne(wh where.Expression, qc where.QueryConstraint) (*User, error)

SelectOne allows a single User to be obtained from the sqlgen2. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed. If not found, *Example will be nil.

func (DbUserTable) SelectOneSA

func (tbl DbUserTable) SelectOneSA(where, orderBy string, args ...interface{}) (*User, error)

SelectOneSA allows a single Example to be obtained from the table that match a 'where' clause and some limit. Any order, limit or offset clauses can be supplied in 'orderBy'. Use blank strings for the 'where' and/or 'orderBy' arguments if they are not needed. If not found, *Example will be nil.

func (DbUserTable) SelectSA

func (tbl DbUserTable) SelectSA(where, orderBy string, args ...interface{}) ([]*User, error)

SelectSA allows Users to be obtained from the table that match a 'where' clause. Any order, limit or offset clauses can be supplied in 'orderBy'. Use blank strings for the 'where' and/or 'orderBy' arguments if they are not needed.

func (DbUserTable) SetLogger

func (tbl DbUserTable) SetLogger(logger *log.Logger) sqlgen2.Table

SetLogger sets the logger for subsequent queries, returning the interface.

func (DbUserTable) SetWrapper added in v0.8.0

func (tbl DbUserTable) SetWrapper(wrapper interface{}) sqlgen2.Table

SetWrapper sets the user-defined wrapper.

func (DbUserTable) SliceActive

func (tbl DbUserTable) SliceActive(wh where.Expression, qc where.QueryConstraint) ([]bool, error)

SliceActive gets the Active column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (DbUserTable) SliceAdmin

func (tbl DbUserTable) SliceAdmin(wh where.Expression, qc where.QueryConstraint) ([]bool, error)

SliceAdmin gets the Admin column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (DbUserTable) SliceAvatar

func (tbl DbUserTable) SliceAvatar(wh where.Expression, qc where.QueryConstraint) ([]string, error)

SliceAvatar gets the Avatar column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (DbUserTable) SliceEmailaddress added in v0.8.0

func (tbl DbUserTable) SliceEmailaddress(wh where.Expression, qc where.QueryConstraint) ([]string, error)

SliceEmailAddress gets the EmailAddress column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (DbUserTable) SliceLastupdated added in v0.8.0

func (tbl DbUserTable) SliceLastupdated(wh where.Expression, qc where.QueryConstraint) ([]int64, error)

SliceLastUpdated gets the LastUpdated column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (DbUserTable) SliceLogin

func (tbl DbUserTable) SliceLogin(wh where.Expression, qc where.QueryConstraint) ([]string, error)

SliceLogin gets the Login column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (DbUserTable) SliceUid

func (tbl DbUserTable) SliceUid(wh where.Expression, qc where.QueryConstraint) ([]int64, error)

SliceUid gets the Uid column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (DbUserTable) Truncate

func (tbl DbUserTable) Truncate(force bool) (err error)

Truncate drops every record from the table, if possible. It might fail if constraints exist that prevent some or all rows from being deleted; use the force option to override this.

When 'force' is set true, be aware of the following consequences. When using Mysql, foreign keys in other tables can be left dangling. When using Postgres, a cascade happens, so all 'adjacent' tables (i.e. linked by foreign keys) are also truncated.

func (DbUserTable) Tx

func (tbl DbUserTable) Tx() *sql.Tx

Tx gets the wrapped transaction handle, provided this is within a transaction. Panics if it is in the wrong state - use IsTx() if necessary.

func (DbUserTable) Update

func (tbl DbUserTable) Update(vv ...*User) (int64, error)

Update updates records, matching them by primary key. It returns the number of rows affected. The User.PreUpdate(Execer) method will be called, if it exists.

func (DbUserTable) UpdateFields

func (tbl DbUserTable) UpdateFields(wh where.Expression, fields ...sql.NamedArg) (int64, error)

UpdateFields updates one or more columns, given a 'where' clause. Use a nil value for the 'wh' argument if it is not needed (very risky!).

func (DbUserTable) WithContext

func (tbl DbUserTable) WithContext(ctx context.Context) DbUserTable

WithContext sets the context for subsequent queries.

func (DbUserTable) WithLogger

func (tbl DbUserTable) WithLogger(logger *log.Logger) DbUserTable

WithLogger sets the logger for subsequent queries.

func (DbUserTable) WithPrefix

func (tbl DbUserTable) WithPrefix(pfx string) DbUserTable

WithPrefix sets the table name prefix for subsequent queries.

func (DbUserTable) Wrapper added in v0.8.0

func (tbl DbUserTable) Wrapper() interface{}

Wrapper gets the user-defined wrapper.

type Email

type Email string

type Hook

type Hook struct {
	Id  int64 `sql:"pk: true, auto: true"`
	Sha string
	Dates
	Category   Category
	Created    bool
	Deleted    bool
	Forced     bool
	HeadCommit *Commit `sql:"name: head"`
}

type HookList

type HookList []*Hook

type HookTable

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

HookTable holds a given table name with the database reference, providing access methods below. The Prefix field is often blank but can be used to hold a table name prefix (e.g. ending in '_'). Or it can specify the name of the schema, in which case it should have a trailing '.'.

func CopyTableAsHookTable added in v0.8.0

func CopyTableAsHookTable(origin sqlgen2.Table) HookTable

CopyTableAsHookTable copies a table instance, retaining the name etc but providing methods appropriate for 'Hook'.

func NewHookTable

func NewHookTable(name sqlgen2.TableName, d sqlgen2.Execer, dialect schema.Dialect) HookTable

NewHookTable returns a new table instance. If a blank table name is supplied, the default name "hooks" will be used instead. The request context is initialised with the background.

func (HookTable) BeginTx

func (tbl HookTable) BeginTx(opts *sql.TxOptions) (HookTable, error)

Begin starts a transaction. The default isolation level is dependent on the driver.

func (HookTable) Count

func (tbl HookTable) Count(wh where.Expression) (count int64, err error)

Count counts the Hooks in the table that match a 'where' clause. Use a nil value for the 'wh' argument if it is not needed.

func (HookTable) CountSA

func (tbl HookTable) CountSA(where string, args ...interface{}) (count int64, err error)

CountSA counts Hooks in the table that match a 'where' clause. Use a blank string for the 'where' argument if it is not needed.

func (HookTable) CreateTable

func (tbl HookTable) CreateTable(ifNotExists bool) (int64, error)

CreateTable creates the table.

func (HookTable) Ctx

func (tbl HookTable) Ctx() context.Context

Ctx gets the current request context.

func (HookTable) DB

func (tbl HookTable) DB() *sql.DB

DB gets the wrapped database handle, provided this is not within a transaction. Panics if it is in the wrong state - use IsTx() if necessary.

func (HookTable) Delete

func (tbl HookTable) Delete(wh where.Expression) (int64, error)

Delete deletes one or more rows from the table, given a 'where' clause. Use a nil value for the 'wh' argument if it is not needed (very risky!).

func (HookTable) DeleteHooks added in v0.8.0

func (tbl HookTable) DeleteHooks(id ...int64) (int64, error)

DeleteHooks deletes rows from the table, given some primary keys. The list of ids can be arbitrarily long.

func (HookTable) Dialect

func (tbl HookTable) Dialect() schema.Dialect

Dialect gets the database dialect.

func (HookTable) DropTable

func (tbl HookTable) DropTable(ifExists bool) (int64, error)

DropTable drops the table, destroying all its data.

func (HookTable) Exec

func (tbl HookTable) Exec(query string, args ...interface{}) (int64, error)

Exec executes a query without returning any rows. The args are for any placeholder parameters in the query. It returns the number of rows affected (of the database drive supports this).

func (HookTable) GetHook

func (tbl HookTable) GetHook(id int64) (*Hook, error)

GetHook gets the record with a given primary key value. If not found, *Hook will be nil.

func (HookTable) GetHooks added in v0.8.0

func (tbl HookTable) GetHooks(id ...int64) (list HookList, err error)

GetHooks gets records from the table according to a list of primary keys. Although the list of ids can be arbitrarily long, there are practical limits; note that Oracle DB has a limit of 1000.

func (HookTable) Insert

func (tbl HookTable) Insert(vv ...*Hook) error

Insert adds new records for the Hooks. The Hooks have their primary key fields set to the new record identifiers. The Hook.PreInsert(Execer) method will be called, if it exists.

func (HookTable) IsTx

func (tbl HookTable) IsTx() bool

IsTx tests whether this is within a transaction.

func (HookTable) Logger

func (tbl HookTable) Logger() *log.Logger

Logger gets the trace logger.

func (HookTable) Name

func (tbl HookTable) Name() sqlgen2.TableName

Name gets the table name.

func (HookTable) Query

func (tbl HookTable) Query(query string, args ...interface{}) (HookList, error)

Query is the low-level access function for Hooks.

func (HookTable) QueryOne

func (tbl HookTable) QueryOne(query string, args ...interface{}) (*Hook, error)

QueryOne is the low-level access function for one Hook. If the query selected many rows, only the first is returned; the rest are discarded. If not found, *Hook will be nil.

func (HookTable) Select

Select allows Hooks to be obtained from the table that match a 'where' clause. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (HookTable) SelectOne

func (tbl HookTable) SelectOne(wh where.Expression, qc where.QueryConstraint) (*Hook, error)

SelectOne allows a single Hook to be obtained from the sqlgen2. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed. If not found, *Example will be nil.

func (HookTable) SelectOneSA

func (tbl HookTable) SelectOneSA(where, orderBy string, args ...interface{}) (*Hook, error)

SelectOneSA allows a single Example to be obtained from the table that match a 'where' clause and some limit. Any order, limit or offset clauses can be supplied in 'orderBy'. Use blank strings for the 'where' and/or 'orderBy' arguments if they are not needed. If not found, *Example will be nil.

func (HookTable) SelectSA

func (tbl HookTable) SelectSA(where, orderBy string, args ...interface{}) (HookList, error)

SelectSA allows Hooks to be obtained from the table that match a 'where' clause. Any order, limit or offset clauses can be supplied in 'orderBy'. Use blank strings for the 'where' and/or 'orderBy' arguments if they are not needed.

func (HookTable) SetLogger

func (tbl HookTable) SetLogger(logger *log.Logger) sqlgen2.Table

SetLogger sets the logger for subsequent queries, returning the interface.

func (HookTable) SetWrapper added in v0.8.0

func (tbl HookTable) SetWrapper(wrapper interface{}) sqlgen2.Table

SetWrapper sets the user-defined wrapper.

func (HookTable) SliceAfter added in v0.8.0

func (tbl HookTable) SliceAfter(wh where.Expression, qc where.QueryConstraint) ([]string, error)

SliceAfter gets the After column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (HookTable) SliceBefore added in v0.8.0

func (tbl HookTable) SliceBefore(wh where.Expression, qc where.QueryConstraint) ([]string, error)

SliceBefore gets the Before column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (HookTable) SliceCategory

func (tbl HookTable) SliceCategory(wh where.Expression, qc where.QueryConstraint) ([]Category, error)

SliceCategory gets the Category column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (HookTable) SliceCommitId added in v0.8.0

func (tbl HookTable) SliceCommitId(wh where.Expression, qc where.QueryConstraint) ([]string, error)

SliceID gets the ID column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (HookTable) SliceCreated

func (tbl HookTable) SliceCreated(wh where.Expression, qc where.QueryConstraint) ([]bool, error)

SliceCreated gets the Created column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (HookTable) SliceDeleted

func (tbl HookTable) SliceDeleted(wh where.Expression, qc where.QueryConstraint) ([]bool, error)

SliceDeleted gets the Deleted column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (HookTable) SliceForced

func (tbl HookTable) SliceForced(wh where.Expression, qc where.QueryConstraint) ([]bool, error)

SliceForced gets the Forced column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (HookTable) SliceHeadCommitAuthorEmail added in v0.8.0

func (tbl HookTable) SliceHeadCommitAuthorEmail(wh where.Expression, qc where.QueryConstraint) ([]Email, error)

SliceEmail gets the Email column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (HookTable) SliceHeadCommitAuthorName added in v0.8.0

func (tbl HookTable) SliceHeadCommitAuthorName(wh where.Expression, qc where.QueryConstraint) ([]string, error)

SliceName gets the Name column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (HookTable) SliceHeadCommitAuthorUsername added in v0.8.0

func (tbl HookTable) SliceHeadCommitAuthorUsername(wh where.Expression, qc where.QueryConstraint) ([]string, error)

SliceUsername gets the Username column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (HookTable) SliceHeadCommitCommitterEmail added in v0.8.0

func (tbl HookTable) SliceHeadCommitCommitterEmail(wh where.Expression, qc where.QueryConstraint) ([]Email, error)

SliceEmail gets the Email column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (HookTable) SliceHeadCommitCommitterName added in v0.8.0

func (tbl HookTable) SliceHeadCommitCommitterName(wh where.Expression, qc where.QueryConstraint) ([]string, error)

SliceName gets the Name column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (HookTable) SliceHeadCommitCommitterUsername added in v0.8.0

func (tbl HookTable) SliceHeadCommitCommitterUsername(wh where.Expression, qc where.QueryConstraint) ([]string, error)

SliceUsername gets the Username column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (HookTable) SliceId

func (tbl HookTable) SliceId(wh where.Expression, qc where.QueryConstraint) ([]int64, error)

SliceId gets the Id column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (HookTable) SliceMessage added in v0.8.0

func (tbl HookTable) SliceMessage(wh where.Expression, qc where.QueryConstraint) ([]string, error)

SliceMessage gets the Message column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (HookTable) SliceSha

func (tbl HookTable) SliceSha(wh where.Expression, qc where.QueryConstraint) ([]string, error)

SliceSha gets the Sha column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (HookTable) SliceTimestamp added in v0.8.0

func (tbl HookTable) SliceTimestamp(wh where.Expression, qc where.QueryConstraint) ([]string, error)

SliceTimestamp gets the Timestamp column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (HookTable) Truncate

func (tbl HookTable) Truncate(force bool) (err error)

Truncate drops every record from the table, if possible. It might fail if constraints exist that prevent some or all rows from being deleted; use the force option to override this.

When 'force' is set true, be aware of the following consequences. When using Mysql, foreign keys in other tables can be left dangling. When using Postgres, a cascade happens, so all 'adjacent' tables (i.e. linked by foreign keys) are also truncated.

func (HookTable) Tx

func (tbl HookTable) Tx() *sql.Tx

Tx gets the wrapped transaction handle, provided this is within a transaction. Panics if it is in the wrong state - use IsTx() if necessary.

func (HookTable) Update

func (tbl HookTable) Update(vv ...*Hook) (int64, error)

Update updates records, matching them by primary key. It returns the number of rows affected. The Hook.PreUpdate(Execer) method will be called, if it exists.

func (HookTable) UpdateFields

func (tbl HookTable) UpdateFields(wh where.Expression, fields ...sql.NamedArg) (int64, error)

UpdateFields updates one or more columns, given a 'where' clause. Use a nil value for the 'wh' argument if it is not needed (very risky!).

func (HookTable) WithContext

func (tbl HookTable) WithContext(ctx context.Context) HookTable

WithContext sets the context for subsequent queries.

func (HookTable) WithLogger

func (tbl HookTable) WithLogger(logger *log.Logger) HookTable

WithLogger sets the logger for subsequent queries.

func (HookTable) WithPrefix

func (tbl HookTable) WithPrefix(pfx string) HookTable

WithPrefix sets the table name prefix for subsequent queries.

func (HookTable) Wrapper added in v0.8.0

func (tbl HookTable) Wrapper() interface{}

Wrapper gets the user-defined wrapper.

type Issue

type Issue struct {
	Id       int64 `sql:"pk: true, auto: true"`
	Number   int
	Date     Date
	Title    string   `sql:"size: 512"`
	Body     string   `sql:"size: 2048, name: bigbody"`
	Assignee string   `sql:"index: issue_assignee"`
	State    string   `sql:"size: 50"`
	Labels   []string `sql:"encode: json"`
	// contains filtered or unexported fields
}

func (*Issue) SetAssignee added in v0.8.0

func (v *Issue) SetAssignee(x string) *Issue

SetAssignee sets the Assignee field and returns the modified Issue.

func (*Issue) SetBody added in v0.8.0

func (v *Issue) SetBody(x string) *Issue

SetBody sets the Body field and returns the modified Issue.

func (*Issue) SetDate added in v0.8.0

func (v *Issue) SetDate(x Date) *Issue

SetDate sets the Date field and returns the modified Issue.

func (*Issue) SetId added in v0.8.0

func (v *Issue) SetId(x int64) *Issue

SetId sets the Id field and returns the modified Issue.

func (*Issue) SetLabels added in v0.8.0

func (v *Issue) SetLabels(x []string) *Issue

SetLabels sets the Labels field and returns the modified Issue.

func (*Issue) SetNumber added in v0.8.0

func (v *Issue) SetNumber(x int) *Issue

SetNumber sets the Number field and returns the modified Issue.

func (*Issue) SetState added in v0.8.0

func (v *Issue) SetState(x string) *Issue

SetState sets the State field and returns the modified Issue.

func (*Issue) SetTitle added in v0.8.0

func (v *Issue) SetTitle(x string) *Issue

SetTitle sets the Title field and returns the modified Issue.

type IssueTable

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

IssueTable holds a given table name with the database reference, providing access methods below. The Prefix field is often blank but can be used to hold a table name prefix (e.g. ending in '_'). Or it can specify the name of the schema, in which case it should have a trailing '.'.

func CopyTableAsIssueTable added in v0.8.0

func CopyTableAsIssueTable(origin sqlgen2.Table) IssueTable

CopyTableAsIssueTable copies a table instance, retaining the name etc but providing methods appropriate for 'Issue'.

func NewIssueTable

func NewIssueTable(name sqlgen2.TableName, d sqlgen2.Execer, dialect schema.Dialect) IssueTable

NewIssueTable returns a new table instance. If a blank table name is supplied, the default name "issues" will be used instead. The request context is initialised with the background.

func (IssueTable) BeginTx

func (tbl IssueTable) BeginTx(opts *sql.TxOptions) (IssueTable, error)

Begin starts a transaction. The default isolation level is dependent on the driver.

func (IssueTable) Count

func (tbl IssueTable) Count(wh where.Expression) (count int64, err error)

Count counts the Issues in the table that match a 'where' clause. Use a nil value for the 'wh' argument if it is not needed.

func (IssueTable) CountSA

func (tbl IssueTable) CountSA(where string, args ...interface{}) (count int64, err error)

CountSA counts Issues in the table that match a 'where' clause. Use a blank string for the 'where' argument if it is not needed.

func (IssueTable) CreateIndexes

func (tbl IssueTable) CreateIndexes(ifNotExist bool) (err error)

CreateIndexes executes queries that create the indexes needed by the Issue table.

func (IssueTable) CreateIssueAssigneeIndex

func (tbl IssueTable) CreateIssueAssigneeIndex(ifNotExist bool) error

CreateIssueAssigneeIndex creates the issue_assignee index.

func (IssueTable) CreateTable

func (tbl IssueTable) CreateTable(ifNotExists bool) (int64, error)

CreateTable creates the table.

func (IssueTable) CreateTableWithIndexes

func (tbl IssueTable) CreateTableWithIndexes(ifNotExist bool) (err error)

CreateTableWithIndexes invokes CreateTable then CreateIndexes.

func (IssueTable) Ctx

func (tbl IssueTable) Ctx() context.Context

Ctx gets the current request context.

func (IssueTable) DB

func (tbl IssueTable) DB() *sql.DB

DB gets the wrapped database handle, provided this is not within a transaction. Panics if it is in the wrong state - use IsTx() if necessary.

func (IssueTable) Delete

func (tbl IssueTable) Delete(wh where.Expression) (int64, error)

Delete deletes one or more rows from the table, given a 'where' clause. Use a nil value for the 'wh' argument if it is not needed (very risky!).

func (IssueTable) DeleteIssues added in v0.8.0

func (tbl IssueTable) DeleteIssues(id ...int64) (int64, error)

DeleteIssues deletes rows from the table, given some primary keys. The list of ids can be arbitrarily long.

func (IssueTable) Dialect

func (tbl IssueTable) Dialect() schema.Dialect

Dialect gets the database dialect.

func (IssueTable) DropIndexes

func (tbl IssueTable) DropIndexes(ifExist bool) (err error)

DropIndexes executes queries that drop the indexes on by the Issue table.

func (IssueTable) DropIssueAssigneeIndex

func (tbl IssueTable) DropIssueAssigneeIndex(ifExists bool) error

DropIssueAssigneeIndex drops the issue_assignee index.

func (IssueTable) DropTable

func (tbl IssueTable) DropTable(ifExists bool) (int64, error)

DropTable drops the table, destroying all its data.

func (IssueTable) Exec

func (tbl IssueTable) Exec(query string, args ...interface{}) (int64, error)

Exec executes a query without returning any rows. The args are for any placeholder parameters in the query. It returns the number of rows affected (of the database drive supports this).

func (IssueTable) GetIssue

func (tbl IssueTable) GetIssue(id int64) (*Issue, error)

GetIssue gets the record with a given primary key value. If not found, *Issue will be nil.

func (IssueTable) GetIssues added in v0.8.0

func (tbl IssueTable) GetIssues(id ...int64) (list []*Issue, err error)

GetIssues gets records from the table according to a list of primary keys. Although the list of ids can be arbitrarily long, there are practical limits; note that Oracle DB has a limit of 1000.

func (IssueTable) Insert

func (tbl IssueTable) Insert(vv ...*Issue) error

Insert adds new records for the Issues. The Issues have their primary key fields set to the new record identifiers. The Issue.PreInsert(Execer) method will be called, if it exists.

func (IssueTable) IsTx

func (tbl IssueTable) IsTx() bool

IsTx tests whether this is within a transaction.

func (IssueTable) Logger

func (tbl IssueTable) Logger() *log.Logger

Logger gets the trace logger.

func (IssueTable) Name

func (tbl IssueTable) Name() sqlgen2.TableName

Name gets the table name.

func (IssueTable) Query

func (tbl IssueTable) Query(query string, args ...interface{}) ([]*Issue, error)

Query is the low-level access function for Issues.

func (IssueTable) QueryOne

func (tbl IssueTable) QueryOne(query string, args ...interface{}) (*Issue, error)

QueryOne is the low-level access function for one Issue. If the query selected many rows, only the first is returned; the rest are discarded. If not found, *Issue will be nil.

func (IssueTable) Select

func (tbl IssueTable) Select(wh where.Expression, qc where.QueryConstraint) ([]*Issue, error)

Select allows Issues to be obtained from the table that match a 'where' clause. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (IssueTable) SelectOne

func (tbl IssueTable) SelectOne(wh where.Expression, qc where.QueryConstraint) (*Issue, error)

SelectOne allows a single Issue to be obtained from the sqlgen2. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed. If not found, *Example will be nil.

func (IssueTable) SelectOneSA

func (tbl IssueTable) SelectOneSA(where, orderBy string, args ...interface{}) (*Issue, error)

SelectOneSA allows a single Example to be obtained from the table that match a 'where' clause and some limit. Any order, limit or offset clauses can be supplied in 'orderBy'. Use blank strings for the 'where' and/or 'orderBy' arguments if they are not needed. If not found, *Example will be nil.

func (IssueTable) SelectSA

func (tbl IssueTable) SelectSA(where, orderBy string, args ...interface{}) ([]*Issue, error)

SelectSA allows Issues to be obtained from the table that match a 'where' clause. Any order, limit or offset clauses can be supplied in 'orderBy'. Use blank strings for the 'where' and/or 'orderBy' arguments if they are not needed.

func (IssueTable) SetLogger

func (tbl IssueTable) SetLogger(logger *log.Logger) sqlgen2.Table

SetLogger sets the logger for subsequent queries, returning the interface.

func (IssueTable) SetWrapper added in v0.8.0

func (tbl IssueTable) SetWrapper(wrapper interface{}) sqlgen2.Table

SetWrapper sets the user-defined wrapper.

func (IssueTable) SliceAssignee

func (tbl IssueTable) SliceAssignee(wh where.Expression, qc where.QueryConstraint) ([]string, error)

SliceAssignee gets the Assignee column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (IssueTable) SliceBigbody added in v0.8.0

func (tbl IssueTable) SliceBigbody(wh where.Expression, qc where.QueryConstraint) ([]string, error)

SliceBody gets the Body column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (IssueTable) SliceDate

func (tbl IssueTable) SliceDate(wh where.Expression, qc where.QueryConstraint) ([]Date, error)

SliceDate gets the Date column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (IssueTable) SliceId

func (tbl IssueTable) SliceId(wh where.Expression, qc where.QueryConstraint) ([]int64, error)

SliceId gets the Id column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (IssueTable) SliceNumber

func (tbl IssueTable) SliceNumber(wh where.Expression, qc where.QueryConstraint) ([]int, error)

SliceNumber gets the Number column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (IssueTable) SliceState

func (tbl IssueTable) SliceState(wh where.Expression, qc where.QueryConstraint) ([]string, error)

SliceState gets the State column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (IssueTable) SliceTitle

func (tbl IssueTable) SliceTitle(wh where.Expression, qc where.QueryConstraint) ([]string, error)

SliceTitle gets the Title column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (IssueTable) Truncate

func (tbl IssueTable) Truncate(force bool) (err error)

Truncate drops every record from the table, if possible. It might fail if constraints exist that prevent some or all rows from being deleted; use the force option to override this.

When 'force' is set true, be aware of the following consequences. When using Mysql, foreign keys in other tables can be left dangling. When using Postgres, a cascade happens, so all 'adjacent' tables (i.e. linked by foreign keys) are also truncated.

func (IssueTable) Tx

func (tbl IssueTable) Tx() *sql.Tx

Tx gets the wrapped transaction handle, provided this is within a transaction. Panics if it is in the wrong state - use IsTx() if necessary.

func (IssueTable) Update

func (tbl IssueTable) Update(vv ...*Issue) (int64, error)

Update updates records, matching them by primary key. It returns the number of rows affected. The Issue.PreUpdate(Execer) method will be called, if it exists.

func (IssueTable) UpdateFields

func (tbl IssueTable) UpdateFields(wh where.Expression, fields ...sql.NamedArg) (int64, error)

UpdateFields updates one or more columns, given a 'where' clause. Use a nil value for the 'wh' argument if it is not needed (very risky!).

func (IssueTable) WithContext

func (tbl IssueTable) WithContext(ctx context.Context) IssueTable

WithContext sets the context for subsequent queries.

func (IssueTable) WithLogger

func (tbl IssueTable) WithLogger(logger *log.Logger) IssueTable

WithLogger sets the logger for subsequent queries.

func (IssueTable) WithPrefix

func (tbl IssueTable) WithPrefix(pfx string) IssueTable

WithPrefix sets the table name prefix for subsequent queries.

func (IssueTable) Wrapper added in v0.8.0

func (tbl IssueTable) Wrapper() interface{}

Wrapper gets the user-defined wrapper.

type RUserTable added in v0.8.0

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

RUserTable holds a given table name with the database reference, providing access methods below. The Prefix field is often blank but can be used to hold a table name prefix (e.g. ending in '_'). Or it can specify the name of the schema, in which case it should have a trailing '.'.

func CopyTableAsRUserTable added in v0.8.0

func CopyTableAsRUserTable(origin sqlgen2.Table) RUserTable

CopyTableAsRUserTable copies a table instance, retaining the name etc but providing methods appropriate for 'User'.

func NewRUserTable added in v0.8.0

func NewRUserTable(name sqlgen2.TableName, d sqlgen2.Execer, dialect schema.Dialect) RUserTable

NewRUserTable returns a new table instance. If a blank table name is supplied, the default name "users" will be used instead. The request context is initialised with the background.

func (RUserTable) BeginTx added in v0.8.0

func (tbl RUserTable) BeginTx(opts *sql.TxOptions) (RUserTable, error)

Begin starts a transaction. The default isolation level is dependent on the driver.

func (RUserTable) Count added in v0.8.0

func (tbl RUserTable) Count(wh where.Expression) (count int64, err error)

Count counts the Users in the table that match a 'where' clause. Use a nil value for the 'wh' argument if it is not needed.

func (RUserTable) CountSA added in v0.8.0

func (tbl RUserTable) CountSA(where string, args ...interface{}) (count int64, err error)

CountSA counts Users in the table that match a 'where' clause. Use a blank string for the 'where' argument if it is not needed.

func (RUserTable) Ctx added in v0.8.0

func (tbl RUserTable) Ctx() context.Context

Ctx gets the current request context.

func (RUserTable) DB added in v0.8.0

func (tbl RUserTable) DB() *sql.DB

DB gets the wrapped database handle, provided this is not within a transaction. Panics if it is in the wrong state - use IsTx() if necessary.

func (RUserTable) Dialect added in v0.8.0

func (tbl RUserTable) Dialect() schema.Dialect

Dialect gets the database dialect.

func (RUserTable) Exec added in v0.8.0

func (tbl RUserTable) Exec(query string, args ...interface{}) (int64, error)

Exec executes a query without returning any rows. The args are for any placeholder parameters in the query. It returns the number of rows affected (of the database drive supports this).

func (RUserTable) GetUser added in v0.8.0

func (tbl RUserTable) GetUser(id int64) (*User, error)

GetUser gets the record with a given primary key value. If not found, *User will be nil.

func (RUserTable) GetUsers added in v0.8.0

func (tbl RUserTable) GetUsers(id ...int64) (list []*User, err error)

GetUsers gets records from the table according to a list of primary keys. Although the list of ids can be arbitrarily long, there are practical limits; note that Oracle DB has a limit of 1000.

func (RUserTable) IsTx added in v0.8.0

func (tbl RUserTable) IsTx() bool

IsTx tests whether this is within a transaction.

func (RUserTable) Logger added in v0.8.0

func (tbl RUserTable) Logger() *log.Logger

Logger gets the trace logger.

func (RUserTable) Name added in v0.8.0

func (tbl RUserTable) Name() sqlgen2.TableName

Name gets the table name.

func (RUserTable) Query added in v0.8.0

func (tbl RUserTable) Query(query string, args ...interface{}) ([]*User, error)

Query is the low-level access function for Users.

func (RUserTable) QueryOne added in v0.8.0

func (tbl RUserTable) QueryOne(query string, args ...interface{}) (*User, error)

QueryOne is the low-level access function for one User. If the query selected many rows, only the first is returned; the rest are discarded. If not found, *User will be nil.

func (RUserTable) Select added in v0.8.0

func (tbl RUserTable) Select(wh where.Expression, qc where.QueryConstraint) ([]*User, error)

Select allows Users to be obtained from the table that match a 'where' clause. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (RUserTable) SelectOne added in v0.8.0

func (tbl RUserTable) SelectOne(wh where.Expression, qc where.QueryConstraint) (*User, error)

SelectOne allows a single User to be obtained from the sqlgen2. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed. If not found, *Example will be nil.

func (RUserTable) SelectOneSA added in v0.8.0

func (tbl RUserTable) SelectOneSA(where, orderBy string, args ...interface{}) (*User, error)

SelectOneSA allows a single Example to be obtained from the table that match a 'where' clause and some limit. Any order, limit or offset clauses can be supplied in 'orderBy'. Use blank strings for the 'where' and/or 'orderBy' arguments if they are not needed. If not found, *Example will be nil.

func (RUserTable) SelectSA added in v0.8.0

func (tbl RUserTable) SelectSA(where, orderBy string, args ...interface{}) ([]*User, error)

SelectSA allows Users to be obtained from the table that match a 'where' clause. Any order, limit or offset clauses can be supplied in 'orderBy'. Use blank strings for the 'where' and/or 'orderBy' arguments if they are not needed.

func (RUserTable) SetLogger added in v0.8.0

func (tbl RUserTable) SetLogger(logger *log.Logger) sqlgen2.Table

SetLogger sets the logger for subsequent queries, returning the interface.

func (RUserTable) SetWrapper added in v0.8.0

func (tbl RUserTable) SetWrapper(wrapper interface{}) sqlgen2.Table

SetWrapper sets the user-defined wrapper.

func (RUserTable) Tx added in v0.8.0

func (tbl RUserTable) Tx() *sql.Tx

Tx gets the wrapped transaction handle, provided this is within a transaction. Panics if it is in the wrong state - use IsTx() if necessary.

func (RUserTable) WithContext added in v0.8.0

func (tbl RUserTable) WithContext(ctx context.Context) RUserTable

WithContext sets the context for subsequent queries.

func (RUserTable) WithLogger added in v0.8.0

func (tbl RUserTable) WithLogger(logger *log.Logger) RUserTable

WithLogger sets the logger for subsequent queries.

func (RUserTable) WithPrefix added in v0.8.0

func (tbl RUserTable) WithPrefix(pfx string) RUserTable

WithPrefix sets the table name prefix for subsequent queries.

func (RUserTable) Wrapper added in v0.8.0

func (tbl RUserTable) Wrapper() interface{}

Wrapper gets the user-defined wrapper.

type SUserTable added in v0.8.0

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

SUserTable holds a given table name with the database reference, providing access methods below. The Prefix field is often blank but can be used to hold a table name prefix (e.g. ending in '_'). Or it can specify the name of the schema, in which case it should have a trailing '.'.

func CopyTableAsSUserTable added in v0.8.0

func CopyTableAsSUserTable(origin sqlgen2.Table) SUserTable

CopyTableAsSUserTable copies a table instance, retaining the name etc but providing methods appropriate for 'User'.

func NewSUserTable added in v0.8.0

func NewSUserTable(name sqlgen2.TableName, d sqlgen2.Execer, dialect schema.Dialect) SUserTable

NewSUserTable returns a new table instance. If a blank table name is supplied, the default name "users" will be used instead. The request context is initialised with the background.

func (SUserTable) BeginTx added in v0.8.0

func (tbl SUserTable) BeginTx(opts *sql.TxOptions) (SUserTable, error)

Begin starts a transaction. The default isolation level is dependent on the driver.

func (SUserTable) Ctx added in v0.8.0

func (tbl SUserTable) Ctx() context.Context

Ctx gets the current request context.

func (SUserTable) DB added in v0.8.0

func (tbl SUserTable) DB() *sql.DB

DB gets the wrapped database handle, provided this is not within a transaction. Panics if it is in the wrong state - use IsTx() if necessary.

func (SUserTable) Dialect added in v0.8.0

func (tbl SUserTable) Dialect() schema.Dialect

Dialect gets the database dialect.

func (SUserTable) Exec added in v0.8.0

func (tbl SUserTable) Exec(query string, args ...interface{}) (int64, error)

Exec executes a query without returning any rows. The args are for any placeholder parameters in the query. It returns the number of rows affected (of the database drive supports this).

func (SUserTable) IsTx added in v0.8.0

func (tbl SUserTable) IsTx() bool

IsTx tests whether this is within a transaction.

func (SUserTable) Logger added in v0.8.0

func (tbl SUserTable) Logger() *log.Logger

Logger gets the trace logger.

func (SUserTable) Name added in v0.8.0

func (tbl SUserTable) Name() sqlgen2.TableName

Name gets the table name.

func (SUserTable) Query added in v0.8.0

func (tbl SUserTable) Query(query string, args ...interface{}) ([]*User, error)

Query is the low-level access function for Users.

func (SUserTable) QueryOne added in v0.8.0

func (tbl SUserTable) QueryOne(query string, args ...interface{}) (*User, error)

QueryOne is the low-level access function for one User. If the query selected many rows, only the first is returned; the rest are discarded. If not found, *User will be nil.

func (SUserTable) SetLogger added in v0.8.0

func (tbl SUserTable) SetLogger(logger *log.Logger) sqlgen2.Table

SetLogger sets the logger for subsequent queries, returning the interface.

func (SUserTable) SetWrapper added in v0.8.0

func (tbl SUserTable) SetWrapper(wrapper interface{}) sqlgen2.Table

SetWrapper sets the user-defined wrapper.

func (SUserTable) SliceActive added in v0.8.0

func (tbl SUserTable) SliceActive(wh where.Expression, qc where.QueryConstraint) ([]bool, error)

SliceActive gets the Active column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (SUserTable) SliceAdmin added in v0.8.0

func (tbl SUserTable) SliceAdmin(wh where.Expression, qc where.QueryConstraint) ([]bool, error)

SliceAdmin gets the Admin column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (SUserTable) SliceAvatar added in v0.8.0

func (tbl SUserTable) SliceAvatar(wh where.Expression, qc where.QueryConstraint) ([]string, error)

SliceAvatar gets the Avatar column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (SUserTable) SliceEmailaddress added in v0.8.0

func (tbl SUserTable) SliceEmailaddress(wh where.Expression, qc where.QueryConstraint) ([]string, error)

SliceEmailAddress gets the EmailAddress column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (SUserTable) SliceLastupdated added in v0.8.0

func (tbl SUserTable) SliceLastupdated(wh where.Expression, qc where.QueryConstraint) ([]int64, error)

SliceLastUpdated gets the LastUpdated column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (SUserTable) SliceLogin added in v0.8.0

func (tbl SUserTable) SliceLogin(wh where.Expression, qc where.QueryConstraint) ([]string, error)

SliceLogin gets the Login column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (SUserTable) SliceUid added in v0.8.0

func (tbl SUserTable) SliceUid(wh where.Expression, qc where.QueryConstraint) ([]int64, error)

SliceUid gets the Uid column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.

func (SUserTable) Tx added in v0.8.0

func (tbl SUserTable) Tx() *sql.Tx

Tx gets the wrapped transaction handle, provided this is within a transaction. Panics if it is in the wrong state - use IsTx() if necessary.

func (SUserTable) WithContext added in v0.8.0

func (tbl SUserTable) WithContext(ctx context.Context) SUserTable

WithContext sets the context for subsequent queries.

func (SUserTable) WithLogger added in v0.8.0

func (tbl SUserTable) WithLogger(logger *log.Logger) SUserTable

WithLogger sets the logger for subsequent queries.

func (SUserTable) WithPrefix added in v0.8.0

func (tbl SUserTable) WithPrefix(pfx string) SUserTable

WithPrefix sets the table name prefix for subsequent queries.

func (SUserTable) Wrapper added in v0.8.0

func (tbl SUserTable) Wrapper() interface{}

Wrapper gets the user-defined wrapper.

type UUserTable added in v0.8.0

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

UUserTable holds a given table name with the database reference, providing access methods below. The Prefix field is often blank but can be used to hold a table name prefix (e.g. ending in '_'). Or it can specify the name of the schema, in which case it should have a trailing '.'.

func CopyTableAsUUserTable added in v0.8.0

func CopyTableAsUUserTable(origin sqlgen2.Table) UUserTable

CopyTableAsUUserTable copies a table instance, retaining the name etc but providing methods appropriate for 'User'.

func NewUUserTable added in v0.8.0

func NewUUserTable(name sqlgen2.TableName, d sqlgen2.Execer, dialect schema.Dialect) UUserTable

NewUUserTable returns a new table instance. If a blank table name is supplied, the default name "users" will be used instead. The request context is initialised with the background.

func (UUserTable) BeginTx added in v0.8.0

func (tbl UUserTable) BeginTx(opts *sql.TxOptions) (UUserTable, error)

Begin starts a transaction. The default isolation level is dependent on the driver.

func (UUserTable) Ctx added in v0.8.0

func (tbl UUserTable) Ctx() context.Context

Ctx gets the current request context.

func (UUserTable) DB added in v0.8.0

func (tbl UUserTable) DB() *sql.DB

DB gets the wrapped database handle, provided this is not within a transaction. Panics if it is in the wrong state - use IsTx() if necessary.

func (UUserTable) Dialect added in v0.8.0

func (tbl UUserTable) Dialect() schema.Dialect

Dialect gets the database dialect.

func (UUserTable) Exec added in v0.8.0

func (tbl UUserTable) Exec(query string, args ...interface{}) (int64, error)

Exec executes a query without returning any rows. The args are for any placeholder parameters in the query. It returns the number of rows affected (of the database drive supports this).

func (UUserTable) IsTx added in v0.8.0

func (tbl UUserTable) IsTx() bool

IsTx tests whether this is within a transaction.

func (UUserTable) Logger added in v0.8.0

func (tbl UUserTable) Logger() *log.Logger

Logger gets the trace logger.

func (UUserTable) Name added in v0.8.0

func (tbl UUserTable) Name() sqlgen2.TableName

Name gets the table name.

func (UUserTable) Query added in v0.8.0

func (tbl UUserTable) Query(query string, args ...interface{}) ([]*User, error)

Query is the low-level access function for Users.

func (UUserTable) QueryOne added in v0.8.0

func (tbl UUserTable) QueryOne(query string, args ...interface{}) (*User, error)

QueryOne is the low-level access function for one User. If the query selected many rows, only the first is returned; the rest are discarded. If not found, *User will be nil.

func (UUserTable) SetLogger added in v0.8.0

func (tbl UUserTable) SetLogger(logger *log.Logger) sqlgen2.Table

SetLogger sets the logger for subsequent queries, returning the interface.

func (UUserTable) SetWrapper added in v0.8.0

func (tbl UUserTable) SetWrapper(wrapper interface{}) sqlgen2.Table

SetWrapper sets the user-defined wrapper.

func (UUserTable) Tx added in v0.8.0

func (tbl UUserTable) Tx() *sql.Tx

Tx gets the wrapped transaction handle, provided this is within a transaction. Panics if it is in the wrong state - use IsTx() if necessary.

func (UUserTable) Update added in v0.8.0

func (tbl UUserTable) Update(vv ...*User) (int64, error)

Update updates records, matching them by primary key. It returns the number of rows affected. The User.PreUpdate(Execer) method will be called, if it exists.

func (UUserTable) UpdateFields added in v0.8.0

func (tbl UUserTable) UpdateFields(wh where.Expression, fields ...sql.NamedArg) (int64, error)

UpdateFields updates one or more columns, given a 'where' clause. Use a nil value for the 'wh' argument if it is not needed (very risky!).

func (UUserTable) WithContext added in v0.8.0

func (tbl UUserTable) WithContext(ctx context.Context) UUserTable

WithContext sets the context for subsequent queries.

func (UUserTable) WithLogger added in v0.8.0

func (tbl UUserTable) WithLogger(logger *log.Logger) UUserTable

WithLogger sets the logger for subsequent queries.

func (UUserTable) WithPrefix added in v0.8.0

func (tbl UUserTable) WithPrefix(pfx string) UUserTable

WithPrefix sets the table name prefix for subsequent queries.

func (UUserTable) Wrapper added in v0.8.0

func (tbl UUserTable) Wrapper() interface{}

Wrapper gets the user-defined wrapper.

type User

type User struct {
	Uid          int64  `sql:"pk: true, auto: true"`
	Login        string `sql:"unique: user_login"`
	EmailAddress string `sql:"unique: user_email"`
	Avatar       *string
	Active       bool
	Admin        bool
	Fave         *big.Int `sql:"encode: json"`
	LastUpdated  int64
	// contains filtered or unexported fields
}

func (*User) PostGet added in v0.8.0

func (u *User) PostGet() error

func (*User) PreInsert

func (u *User) PreInsert() error

These hooks are just used here for testing, but you could put whatever you like in them.

func (*User) PreUpdate

func (u *User) PreUpdate() error

func (*User) SetActive added in v0.8.0

func (v *User) SetActive(x bool) *User

SetActive sets the Active field and returns the modified User.

func (*User) SetAdmin added in v0.8.0

func (v *User) SetAdmin(x bool) *User

SetAdmin sets the Admin field and returns the modified User.

func (*User) SetAvatar added in v0.8.0

func (v *User) SetAvatar(x string) *User

SetAvatar sets the Avatar field and returns the modified User.

func (*User) SetEmailAddress added in v0.8.0

func (v *User) SetEmailAddress(x string) *User

SetEmailAddress sets the EmailAddress field and returns the modified User.

func (*User) SetFave added in v0.8.0

func (v *User) SetFave(x big.Int) *User

SetFave sets the Fave field and returns the modified User.

func (*User) SetLastUpdated added in v0.8.0

func (v *User) SetLastUpdated(x int64) *User

SetLastUpdated sets the LastUpdated field and returns the modified User.

func (*User) SetLogin added in v0.8.0

func (v *User) SetLogin(x string) *User

SetLogin sets the Login field and returns the modified User.

func (*User) SetUid added in v0.8.0

func (v *User) SetUid(x int64) *User

SetUid sets the Uid field and returns the modified User.

func (*User) Setsecret added in v0.8.0

func (v *User) Setsecret(x string) *User

Setsecret sets the secret field and returns the modified User.

func (*User) Settoken added in v0.8.0

func (v *User) Settoken(x string) *User

Settoken sets the token field and returns the modified User.

type XUserTable added in v0.8.0

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

XUserTable holds a given table name with the database reference, providing access methods below. The Prefix field is often blank but can be used to hold a table name prefix (e.g. ending in '_'). Or it can specify the name of the schema, in which case it should have a trailing '.'.

func CopyTableAsXUserTable added in v0.8.0

func CopyTableAsXUserTable(origin sqlgen2.Table) XUserTable

CopyTableAsXUserTable copies a table instance, retaining the name etc but providing methods appropriate for 'User'.

func NewXUserTable added in v0.8.0

func NewXUserTable(name sqlgen2.TableName, d sqlgen2.Execer, dialect schema.Dialect) XUserTable

NewXUserTable returns a new table instance. If a blank table name is supplied, the default name "users" will be used instead. The request context is initialised with the background.

func (XUserTable) BeginTx added in v0.8.0

func (tbl XUserTable) BeginTx(opts *sql.TxOptions) (XUserTable, error)

Begin starts a transaction. The default isolation level is dependent on the driver.

func (XUserTable) Ctx added in v0.8.0

func (tbl XUserTable) Ctx() context.Context

Ctx gets the current request context.

func (XUserTable) DB added in v0.8.0

func (tbl XUserTable) DB() *sql.DB

DB gets the wrapped database handle, provided this is not within a transaction. Panics if it is in the wrong state - use IsTx() if necessary.

func (XUserTable) Dialect added in v0.8.0

func (tbl XUserTable) Dialect() schema.Dialect

Dialect gets the database dialect.

func (XUserTable) Exec added in v0.8.0

func (tbl XUserTable) Exec(query string, args ...interface{}) (int64, error)

Exec executes a query without returning any rows. The args are for any placeholder parameters in the query. It returns the number of rows affected (of the database drive supports this).

func (XUserTable) IsTx added in v0.8.0

func (tbl XUserTable) IsTx() bool

IsTx tests whether this is within a transaction.

func (XUserTable) Logger added in v0.8.0

func (tbl XUserTable) Logger() *log.Logger

Logger gets the trace logger.

func (XUserTable) Name added in v0.8.0

func (tbl XUserTable) Name() sqlgen2.TableName

Name gets the table name.

func (XUserTable) Query added in v0.8.0

func (tbl XUserTable) Query(query string, args ...interface{}) ([]*User, error)

Query is the low-level access function for Users.

func (XUserTable) QueryOne added in v0.8.0

func (tbl XUserTable) QueryOne(query string, args ...interface{}) (*User, error)

QueryOne is the low-level access function for one User. If the query selected many rows, only the first is returned; the rest are discarded. If not found, *User will be nil.

func (XUserTable) SetLogger added in v0.8.0

func (tbl XUserTable) SetLogger(logger *log.Logger) sqlgen2.Table

SetLogger sets the logger for subsequent queries, returning the interface.

func (XUserTable) SetWrapper added in v0.8.0

func (tbl XUserTable) SetWrapper(wrapper interface{}) sqlgen2.Table

SetWrapper sets the user-defined wrapper.

func (XUserTable) Tx added in v0.8.0

func (tbl XUserTable) Tx() *sql.Tx

Tx gets the wrapped transaction handle, provided this is within a transaction. Panics if it is in the wrong state - use IsTx() if necessary.

func (XUserTable) WithContext added in v0.8.0

func (tbl XUserTable) WithContext(ctx context.Context) XUserTable

WithContext sets the context for subsequent queries.

func (XUserTable) WithLogger added in v0.8.0

func (tbl XUserTable) WithLogger(logger *log.Logger) XUserTable

WithLogger sets the logger for subsequent queries.

func (XUserTable) WithPrefix added in v0.8.0

func (tbl XUserTable) WithPrefix(pfx string) XUserTable

WithPrefix sets the table name prefix for subsequent queries.

func (XUserTable) Wrapper added in v0.8.0

func (tbl XUserTable) Wrapper() interface{}

Wrapper gets the user-defined wrapper.

Jump to

Keyboard shortcuts

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