Documentation
¶
Index ¶
- Constants
- type Association
- type AssociationTable
- func (tbl AssociationTable) BeginTx(opts *sql.TxOptions) (AssociationTable, error)
- func (tbl AssociationTable) Count(where where.Expression) (count int64, err error)
- func (tbl AssociationTable) CountSA(where string, args ...interface{}) (count int64, err error)
- func (tbl AssociationTable) CreateTable(ifNotExists bool) (int64, error)
- func (tbl AssociationTable) DB() *sql.DB
- func (tbl AssociationTable) Delete(where where.Expression) (int64, error)
- func (tbl AssociationTable) DropTable(ifExists bool) (int64, error)
- func (tbl AssociationTable) Exec(query string, args ...interface{}) (int64, error)
- func (tbl AssociationTable) FullName() string
- func (tbl AssociationTable) GetAssociation(id int64) (*Association, error)
- func (tbl AssociationTable) Insert(vv ...*Association) error
- func (tbl AssociationTable) IsTx() bool
- func (tbl AssociationTable) Query(query string, args ...interface{}) ([]*Association, error)
- func (tbl AssociationTable) QueryOne(query string, args ...interface{}) (*Association, error)
- func (tbl AssociationTable) Select(where where.Expression, orderBy string) ([]*Association, error)
- func (tbl AssociationTable) SelectOne(where where.Expression, orderBy string) (*Association, error)
- func (tbl AssociationTable) SelectOneSA(where, orderBy string, args ...interface{}) (*Association, error)
- func (tbl AssociationTable) SelectSA(where, orderBy string, args ...interface{}) ([]*Association, error)
- func (tbl AssociationTable) SetLogger(logger *log.Logger) sqlgen2.Table
- func (tbl AssociationTable) SliceCategory(where where.Expression, orderBy string) ([]Category, error)
- func (tbl AssociationTable) SliceId(where where.Expression, orderBy string) ([]int64, error)
- func (tbl AssociationTable) SliceName(where where.Expression, orderBy string) ([]string, error)
- func (tbl AssociationTable) SliceQuality(where where.Expression, orderBy string) ([]string, error)
- func (tbl AssociationTable) SliceRef1(where where.Expression, orderBy string) ([]int64, error)
- func (tbl AssociationTable) SliceRef2(where where.Expression, orderBy string) ([]int64, error)
- func (tbl AssociationTable) Truncate(force bool) (err error)
- func (tbl AssociationTable) Tx() *sql.Tx
- func (tbl AssociationTable) Update(vv ...*Association) (int64, error)
- func (tbl AssociationTable) UpdateFields(where where.Expression, fields ...sql.NamedArg) (int64, error)
- func (tbl AssociationTable) WithContext(ctx context.Context) AssociationTable
- func (tbl AssociationTable) WithLogger(logger *log.Logger) AssociationTable
- func (tbl AssociationTable) WithPrefix(pfx string) AssociationTable
- type Author
- type Category
- type Commit
- type Compound
- type Date
- type Dates
- type DbCompoundTable
- func (tbl DbCompoundTable) BeginTx(opts *sql.TxOptions) (DbCompoundTable, error)
- func (tbl DbCompoundTable) Count(where where.Expression) (count int64, err error)
- func (tbl DbCompoundTable) CountSA(where string, args ...interface{}) (count int64, err error)
- func (tbl DbCompoundTable) CreateAlphaBetaIndex(ifNotExist bool) error
- func (tbl DbCompoundTable) CreateIndexes(ifNotExist bool) (err error)
- func (tbl DbCompoundTable) CreateTable(ifNotExists bool) (int64, error)
- func (tbl DbCompoundTable) CreateTableWithIndexes(ifNotExist bool) (err error)
- func (tbl DbCompoundTable) DB() *sql.DB
- func (tbl DbCompoundTable) Delete(where where.Expression) (int64, error)
- func (tbl DbCompoundTable) DropAlphaBetaIndex(ifExists bool) error
- func (tbl DbCompoundTable) DropIndexes(ifExist bool) (err error)
- func (tbl DbCompoundTable) DropTable(ifExists bool) (int64, error)
- func (tbl DbCompoundTable) Exec(query string, args ...interface{}) (int64, error)
- func (tbl DbCompoundTable) FullName() string
- func (tbl DbCompoundTable) Insert(vv ...*Compound) error
- func (tbl DbCompoundTable) IsTx() bool
- func (tbl DbCompoundTable) Query(query string, args ...interface{}) ([]*Compound, error)
- func (tbl DbCompoundTable) QueryOne(query string, args ...interface{}) (*Compound, error)
- func (tbl DbCompoundTable) Select(where where.Expression, orderBy string) ([]*Compound, error)
- func (tbl DbCompoundTable) SelectOne(where where.Expression, orderBy string) (*Compound, error)
- func (tbl DbCompoundTable) SelectOneSA(where, orderBy string, args ...interface{}) (*Compound, error)
- func (tbl DbCompoundTable) SelectSA(where, orderBy string, args ...interface{}) ([]*Compound, error)
- func (tbl DbCompoundTable) SetLogger(logger *log.Logger) sqlgen2.Table
- func (tbl DbCompoundTable) SliceAlpha(where where.Expression, orderBy string) ([]string, error)
- func (tbl DbCompoundTable) SliceBeta(where where.Expression, orderBy string) ([]string, error)
- func (tbl DbCompoundTable) SliceCategory(where where.Expression, orderBy string) ([]Category, error)
- func (tbl DbCompoundTable) Truncate(force bool) (err error)
- func (tbl DbCompoundTable) Tx() *sql.Tx
- func (tbl DbCompoundTable) UpdateFields(where where.Expression, fields ...sql.NamedArg) (int64, error)
- func (tbl DbCompoundTable) WithContext(ctx context.Context) DbCompoundTable
- func (tbl DbCompoundTable) WithLogger(logger *log.Logger) DbCompoundTable
- func (tbl DbCompoundTable) WithPrefix(pfx string) DbCompoundTable
- type DbUserTable
- func (tbl DbUserTable) BeginTx(opts *sql.TxOptions) (DbUserTable, error)
- func (tbl DbUserTable) Count(where where.Expression) (count int64, err error)
- func (tbl DbUserTable) CountSA(where string, args ...interface{}) (count int64, err error)
- func (tbl DbUserTable) CreateIndexes(ifNotExist bool) (err error)
- func (tbl DbUserTable) CreateTable(ifNotExists bool) (int64, error)
- func (tbl DbUserTable) CreateTableWithIndexes(ifNotExist bool) (err error)
- func (tbl DbUserTable) CreateUserEmailIndex(ifNotExist bool) error
- func (tbl DbUserTable) CreateUserLoginIndex(ifNotExist bool) error
- func (tbl DbUserTable) DB() *sql.DB
- func (tbl DbUserTable) Delete(where where.Expression) (int64, error)
- func (tbl DbUserTable) DropIndexes(ifExist bool) (err error)
- func (tbl DbUserTable) DropTable(ifExists bool) (int64, error)
- func (tbl DbUserTable) DropUserEmailIndex(ifExists bool) error
- func (tbl DbUserTable) DropUserLoginIndex(ifExists bool) error
- func (tbl DbUserTable) Exec(query string, args ...interface{}) (int64, error)
- func (tbl DbUserTable) FullName() string
- func (tbl DbUserTable) GetUser(id int64) (*User, error)
- func (tbl DbUserTable) Insert(vv ...*User) error
- func (tbl DbUserTable) IsTx() bool
- func (tbl DbUserTable) Query(query string, args ...interface{}) ([]*User, error)
- func (tbl DbUserTable) QueryOne(query string, args ...interface{}) (*User, error)
- func (tbl DbUserTable) Select(where where.Expression, orderBy string) ([]*User, error)
- func (tbl DbUserTable) SelectOne(where where.Expression, orderBy string) (*User, error)
- func (tbl DbUserTable) SelectOneSA(where, orderBy string, args ...interface{}) (*User, error)
- func (tbl DbUserTable) SelectSA(where, orderBy string, args ...interface{}) ([]*User, error)
- func (tbl DbUserTable) SetLogger(logger *log.Logger) sqlgen2.Table
- func (tbl DbUserTable) SliceActive(where where.Expression, orderBy string) ([]bool, error)
- func (tbl DbUserTable) SliceAdmin(where where.Expression, orderBy string) ([]bool, error)
- func (tbl DbUserTable) SliceAvatar(where where.Expression, orderBy string) ([]string, error)
- func (tbl DbUserTable) SliceEmailAddress(where where.Expression, orderBy string) ([]string, error)
- func (tbl DbUserTable) SliceLastUpdated(where where.Expression, orderBy string) ([]int64, error)
- func (tbl DbUserTable) SliceLogin(where where.Expression, orderBy string) ([]string, error)
- func (tbl DbUserTable) SliceUid(where where.Expression, orderBy string) ([]int64, error)
- func (tbl DbUserTable) Truncate(force bool) (err error)
- func (tbl DbUserTable) Tx() *sql.Tx
- func (tbl DbUserTable) Update(vv ...*User) (int64, error)
- func (tbl DbUserTable) UpdateFields(where where.Expression, fields ...sql.NamedArg) (int64, error)
- func (tbl DbUserTable) WithContext(ctx context.Context) DbUserTable
- func (tbl DbUserTable) WithLogger(logger *log.Logger) DbUserTable
- func (tbl DbUserTable) WithPrefix(pfx string) DbUserTable
- type Email
- type Hook
- type HookList
- type HookTable
- func (tbl HookTable) BeginTx(opts *sql.TxOptions) (HookTable, error)
- func (tbl HookTable) Count(where where.Expression) (count int64, err error)
- func (tbl HookTable) CountSA(where string, args ...interface{}) (count int64, err error)
- func (tbl HookTable) CreateTable(ifNotExists bool) (int64, error)
- func (tbl HookTable) DB() *sql.DB
- func (tbl HookTable) Delete(where where.Expression) (int64, error)
- func (tbl HookTable) DropTable(ifExists bool) (int64, error)
- func (tbl HookTable) Exec(query string, args ...interface{}) (int64, error)
- func (tbl HookTable) FullName() string
- func (tbl HookTable) GetHook(id int64) (*Hook, error)
- func (tbl HookTable) Insert(vv ...*Hook) error
- func (tbl HookTable) IsTx() bool
- func (tbl HookTable) Query(query string, args ...interface{}) (HookList, error)
- func (tbl HookTable) QueryOne(query string, args ...interface{}) (*Hook, error)
- func (tbl HookTable) Select(where where.Expression, orderBy string) (HookList, error)
- func (tbl HookTable) SelectOne(where where.Expression, orderBy string) (*Hook, error)
- func (tbl HookTable) SelectOneSA(where, orderBy string, args ...interface{}) (*Hook, error)
- func (tbl HookTable) SelectSA(where, orderBy string, args ...interface{}) (HookList, error)
- func (tbl HookTable) SetLogger(logger *log.Logger) sqlgen2.Table
- func (tbl HookTable) SliceCategory(where where.Expression, orderBy string) ([]Category, error)
- func (tbl HookTable) SliceCreated(where where.Expression, orderBy string) ([]bool, error)
- func (tbl HookTable) SliceDeleted(where where.Expression, orderBy string) ([]bool, error)
- func (tbl HookTable) SliceForced(where where.Expression, orderBy string) ([]bool, error)
- func (tbl HookTable) SliceId(where where.Expression, orderBy string) ([]int64, error)
- func (tbl HookTable) SliceSha(where where.Expression, orderBy string) ([]string, error)
- func (tbl HookTable) Truncate(force bool) (err error)
- func (tbl HookTable) Tx() *sql.Tx
- func (tbl HookTable) Update(vv ...*Hook) (int64, error)
- func (tbl HookTable) UpdateFields(where where.Expression, fields ...sql.NamedArg) (int64, error)
- func (tbl HookTable) WithContext(ctx context.Context) HookTable
- func (tbl HookTable) WithLogger(logger *log.Logger) HookTable
- func (tbl HookTable) WithPrefix(pfx string) HookTable
- type Issue
- type IssueTable
- func (tbl IssueTable) BeginTx(opts *sql.TxOptions) (IssueTable, error)
- func (tbl IssueTable) Count(where where.Expression) (count int64, err error)
- func (tbl IssueTable) CountSA(where string, args ...interface{}) (count int64, err error)
- func (tbl IssueTable) CreateIndexes(ifNotExist bool) (err error)
- func (tbl IssueTable) CreateIssueAssigneeIndex(ifNotExist bool) error
- func (tbl IssueTable) CreateTable(ifNotExists bool) (int64, error)
- func (tbl IssueTable) CreateTableWithIndexes(ifNotExist bool) (err error)
- func (tbl IssueTable) DB() *sql.DB
- func (tbl IssueTable) Delete(where where.Expression) (int64, error)
- func (tbl IssueTable) DropIndexes(ifExist bool) (err error)
- func (tbl IssueTable) DropIssueAssigneeIndex(ifExists bool) error
- func (tbl IssueTable) DropTable(ifExists bool) (int64, error)
- func (tbl IssueTable) Exec(query string, args ...interface{}) (int64, error)
- func (tbl IssueTable) FullName() string
- func (tbl IssueTable) GetIssue(id int64) (*Issue, error)
- func (tbl IssueTable) Insert(vv ...*Issue) error
- func (tbl IssueTable) IsTx() bool
- func (tbl IssueTable) Query(query string, args ...interface{}) ([]*Issue, error)
- func (tbl IssueTable) QueryOne(query string, args ...interface{}) (*Issue, error)
- func (tbl IssueTable) Select(where where.Expression, orderBy string) ([]*Issue, error)
- func (tbl IssueTable) SelectOne(where where.Expression, orderBy string) (*Issue, error)
- func (tbl IssueTable) SelectOneSA(where, orderBy string, args ...interface{}) (*Issue, error)
- func (tbl IssueTable) SelectSA(where, orderBy string, args ...interface{}) ([]*Issue, error)
- func (tbl IssueTable) SetLogger(logger *log.Logger) sqlgen2.Table
- func (tbl IssueTable) SliceAssignee(where where.Expression, orderBy string) ([]string, error)
- func (tbl IssueTable) SliceBody(where where.Expression, orderBy string) ([]string, error)
- func (tbl IssueTable) SliceDate(where where.Expression, orderBy string) ([]Date, error)
- func (tbl IssueTable) SliceId(where where.Expression, orderBy string) ([]int64, error)
- func (tbl IssueTable) SliceNumber(where where.Expression, orderBy string) ([]int, error)
- func (tbl IssueTable) SliceState(where where.Expression, orderBy string) ([]string, error)
- func (tbl IssueTable) SliceTitle(where where.Expression, orderBy string) ([]string, error)
- func (tbl IssueTable) Truncate(force bool) (err error)
- func (tbl IssueTable) Tx() *sql.Tx
- func (tbl IssueTable) Update(vv ...*Issue) (int64, error)
- func (tbl IssueTable) UpdateFields(where where.Expression, fields ...sql.NamedArg) (int64, error)
- func (tbl IssueTable) WithContext(ctx context.Context) IssueTable
- func (tbl IssueTable) WithLogger(logger *log.Logger) IssueTable
- func (tbl IssueTable) WithPrefix(pfx string) IssueTable
- type User
- type V2UserTable
- func (tbl V2UserTable) BeginTx(opts *sql.TxOptions) (V2UserTable, error)
- func (tbl V2UserTable) Count(where where.Expression) (count int64, err error)
- func (tbl V2UserTable) CountSA(where string, args ...interface{}) (count int64, err error)
- func (tbl V2UserTable) DB() *sql.DB
- func (tbl V2UserTable) Delete(where where.Expression) (int64, error)
- func (tbl V2UserTable) Exec(query string, args ...interface{}) (int64, error)
- func (tbl V2UserTable) FullName() string
- func (tbl V2UserTable) GetUser(id int64) (*User, error)
- func (tbl V2UserTable) Insert(vv ...*User) error
- func (tbl V2UserTable) IsTx() bool
- func (tbl V2UserTable) Query(query string, args ...interface{}) ([]*User, error)
- func (tbl V2UserTable) QueryOne(query string, args ...interface{}) (*User, error)
- func (tbl V2UserTable) Select(where where.Expression, orderBy string) ([]*User, error)
- func (tbl V2UserTable) SelectOne(where where.Expression, orderBy string) (*User, error)
- func (tbl V2UserTable) SelectOneSA(where, orderBy string, args ...interface{}) (*User, error)
- func (tbl V2UserTable) SelectSA(where, orderBy string, args ...interface{}) ([]*User, error)
- func (tbl V2UserTable) SetLogger(logger *log.Logger) sqlgen2.Table
- func (tbl V2UserTable) SliceActive(where where.Expression, orderBy string) ([]bool, error)
- func (tbl V2UserTable) SliceAdmin(where where.Expression, orderBy string) ([]bool, error)
- func (tbl V2UserTable) SliceAvatar(where where.Expression, orderBy string) ([]string, error)
- func (tbl V2UserTable) SliceEmailAddress(where where.Expression, orderBy string) ([]string, error)
- func (tbl V2UserTable) SliceLastUpdated(where where.Expression, orderBy string) ([]int64, error)
- func (tbl V2UserTable) SliceLogin(where where.Expression, orderBy string) ([]string, error)
- func (tbl V2UserTable) SliceUid(where where.Expression, orderBy string) ([]int64, error)
- func (tbl V2UserTable) Truncate(force bool) (err error)
- func (tbl V2UserTable) Tx() *sql.Tx
- func (tbl V2UserTable) Update(vv ...*User) (int64, error)
- func (tbl V2UserTable) UpdateFields(where where.Expression, fields ...sql.NamedArg) (int64, error)
- func (tbl V2UserTable) WithContext(ctx context.Context) V2UserTable
- func (tbl V2UserTable) WithLogger(logger *log.Logger) V2UserTable
- func (tbl V2UserTable) WithPrefix(pfx string) V2UserTable
- type V3UserTable
- func (tbl V3UserTable) BeginTx(opts *sql.TxOptions) (V3UserTable, error)
- func (tbl V3UserTable) CreateIndexes(ifNotExist bool) (err error)
- func (tbl V3UserTable) CreateTable(ifNotExists bool) (int64, error)
- func (tbl V3UserTable) CreateTableWithIndexes(ifNotExist bool) (err error)
- func (tbl V3UserTable) CreateUserEmailIndex(ifNotExist bool) error
- func (tbl V3UserTable) CreateUserLoginIndex(ifNotExist bool) error
- func (tbl V3UserTable) DB() *sql.DB
- func (tbl V3UserTable) DropIndexes(ifExist bool) (err error)
- func (tbl V3UserTable) DropTable(ifExists bool) (int64, error)
- func (tbl V3UserTable) DropUserEmailIndex(ifExists bool) error
- func (tbl V3UserTable) DropUserLoginIndex(ifExists bool) error
- func (tbl V3UserTable) Exec(query string, args ...interface{}) (int64, error)
- func (tbl V3UserTable) FullName() string
- func (tbl V3UserTable) IsTx() bool
- func (tbl V3UserTable) Query(query string, args ...interface{}) ([]*User, error)
- func (tbl V3UserTable) QueryOne(query string, args ...interface{}) (*User, error)
- func (tbl V3UserTable) SetLogger(logger *log.Logger) sqlgen2.Table
- func (tbl V3UserTable) Tx() *sql.Tx
- func (tbl V3UserTable) WithContext(ctx context.Context) V3UserTable
- func (tbl V3UserTable) WithLogger(logger *log.Logger) V3UserTable
- func (tbl V3UserTable) WithPrefix(pfx string) V3UserTable
- type V4UserTable
- func (tbl V4UserTable) BeginTx(opts *sql.TxOptions) (V4UserTable, error)
- func (tbl V4UserTable) DB() *sql.DB
- func (tbl V4UserTable) Exec(query string, args ...interface{}) (int64, error)
- func (tbl V4UserTable) FullName() string
- func (tbl V4UserTable) IsTx() bool
- func (tbl V4UserTable) Query(query string, args ...interface{}) ([]*User, error)
- func (tbl V4UserTable) QueryOne(query string, args ...interface{}) (*User, error)
- func (tbl V4UserTable) SetLogger(logger *log.Logger) sqlgen2.Table
- func (tbl V4UserTable) Tx() *sql.Tx
- func (tbl V4UserTable) WithContext(ctx context.Context) V4UserTable
- func (tbl V4UserTable) WithLogger(logger *log.Logger) V4UserTable
- func (tbl V4UserTable) WithPrefix(pfx string) V4UserTable
Constants ¶
const AssociationColumnNames = "id, name, quality, ref1, ref2, category"
const AssociationDataColumnNames = "name, quality, ref1, ref2, category"
const AssociationPk = "Id"
const AssociationTableName = "associations"
AssociationTableName is the default name for this table.
const DbCompoundColumnNames = "alpha, beta, category"
const DbCompoundDataColumnNames = "alpha, beta, category"
const DbCompoundTableName = "compounds"
DbCompoundTableName is the default name for this table.
const DbUserColumnNames = "uid, login, emailaddress, avatar, active, admin, fave, lastupdated, token, secret, hash"
const DbUserDataColumnNames = "login, emailaddress, avatar, active, admin, fave, lastupdated, token, secret, hash"
const DbUserPk = "Uid"
const DbUserTableName = "users"
DbUserTableName is the default name for this table.
const HookColumnNames = "" /* 258-byte string literal not displayed */
const HookDataColumnNames = "" /* 254-byte string literal not displayed */
const HookPk = "Id"
const HookTableName = "hooks"
HookTableName is the default name for this table.
const IssueColumnNames = "id, number, date, title, bigbody, assignee, state, labels"
const IssueDataColumnNames = "number, date, title, bigbody, assignee, state, labels"
const IssuePk = "Id"
const IssueTableName = "issues"
IssueTableName is the default name for this table.
const NumAssociationColumns = 6
const NumAssociationDataColumns = 5
const NumDbCompoundColumns = 3
const NumDbCompoundDataColumns = 3
const NumDbUserColumns = 11
const NumDbUserDataColumns = 10
const NumHookColumns = 17
const NumHookDataColumns = 16
const NumIssueColumns = 8
const NumIssueDataColumns = 7
const NumV3UserColumns = 11
const NumV3UserDataColumns = 10
const V2UserColumnNames = "uid, login, emailaddress, avatar, active, admin, fave, lastupdated, token, secret, hash"
const V2UserTableName = "users"
V2UserTableName is the default name for this table.
const V3UserDataColumnNames = "login, emailaddress, avatar, active, admin, fave, lastupdated, token, secret, hash"
const V3UserPk = "Uid"
const V3UserTableName = "users"
V3UserTableName is the default name for this table.
const V4UserTableName = "users"
V4UserTableName is the default name for this table.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Association ¶
type AssociationTable ¶
type AssociationTable struct {
Prefix, Name string
Db sqlgen2.Execer
Ctx context.Context
Dialect schema.Dialect
Logger *log.Logger
}
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 NewAssociationTable ¶
NewAssociationTable returns a new table instance. If a blank table name is supplied, the default name "associations" will be used instead. The table name prefix is initially blank and the request context is 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(where where.Expression) (count int64, err error)
Count counts the Associations in the table that match a 'where' clause.
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.
func (AssociationTable) CreateTable ¶
func (tbl AssociationTable) CreateTable(ifNotExists bool) (int64, error)
CreateTable creates the table.
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(where where.Expression) (int64, error)
Delete deletes one or more rows from the table, given a 'where' clause.
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) FullName ¶
func (tbl AssociationTable) FullName() string
FullName gets the concatenated prefix and table name.
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) 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) 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 ¶
func (tbl AssociationTable) Select(where where.Expression, orderBy string) ([]*Association, error)
Select allows Associations to be obtained from the table that match a 'where' clause. Any order, limit or offset clauses can be supplied in 'orderBy'; otherwise use a blank string.
func (AssociationTable) SelectOne ¶
func (tbl AssociationTable) SelectOne(where where.Expression, orderBy string) (*Association, error)
SelectOne allows a single Association to be obtained from the sqlgen2. Any order, limit or offset clauses can be supplied in 'orderBy'; otherwise use a blank string. 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 Association 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'; otherwise use a blank string. If not found, *Association 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'; otherwise use a blank string.
func (AssociationTable) SetLogger ¶
func (tbl AssociationTable) SetLogger(logger *log.Logger) sqlgen2.Table
SetLogger sets the logger for subsequent queries, returning the interface.
func (AssociationTable) SliceCategory ¶
func (tbl AssociationTable) SliceCategory(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
func (AssociationTable) SliceId ¶
func (tbl AssociationTable) SliceId(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
func (AssociationTable) SliceName ¶
func (tbl AssociationTable) SliceName(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
func (AssociationTable) SliceQuality ¶
func (tbl AssociationTable) SliceQuality(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
func (AssociationTable) SliceRef1 ¶
func (tbl AssociationTable) SliceRef1(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
func (AssociationTable) SliceRef2 ¶
func (tbl AssociationTable) SliceRef2(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
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(where where.Expression, fields ...sql.NamedArg) (int64, error)
UpdateFields updates one or more columns, given a 'where' clause.
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 prefix for subsequent queries.
type DbCompoundTable ¶
type DbCompoundTable struct {
Prefix, Name string
Db sqlgen2.Execer
Ctx context.Context
Dialect schema.Dialect
Logger *log.Logger
}
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 NewDbCompoundTable ¶
NewDbCompoundTable returns a new table instance. If a blank table name is supplied, the default name "compounds" will be used instead. The table name prefix is initially blank and the request context is 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(where where.Expression) (count int64, err error)
Count counts the Compounds in the table that match a 'where' clause.
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.
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) 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(where where.Expression) (int64, error)
Delete deletes one or more rows from the table, given a 'where' clause.
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) FullName ¶
func (tbl DbCompoundTable) FullName() string
FullName gets the concatenated prefix and table name.
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) 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 ¶
func (tbl DbCompoundTable) Select(where where.Expression, orderBy string) ([]*Compound, error)
Select allows Compounds to be obtained from the table that match a 'where' clause. Any order, limit or offset clauses can be supplied in 'orderBy'; otherwise use a blank string.
func (DbCompoundTable) SelectOne ¶
func (tbl DbCompoundTable) SelectOne(where where.Expression, orderBy string) (*Compound, error)
SelectOne allows a single Compound to be obtained from the sqlgen2. Any order, limit or offset clauses can be supplied in 'orderBy'; otherwise use a blank string. 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 Compound 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'; otherwise use a blank string. If not found, *Compound 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'; otherwise use a blank string.
func (DbCompoundTable) SetLogger ¶
func (tbl DbCompoundTable) SetLogger(logger *log.Logger) sqlgen2.Table
SetLogger sets the logger for subsequent queries, returning the interface.
func (DbCompoundTable) SliceAlpha ¶
func (tbl DbCompoundTable) SliceAlpha(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
func (DbCompoundTable) SliceBeta ¶
func (tbl DbCompoundTable) SliceBeta(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
func (DbCompoundTable) SliceCategory ¶
func (tbl DbCompoundTable) SliceCategory(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
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(where where.Expression, fields ...sql.NamedArg) (int64, error)
UpdateFields updates one or more columns, given a 'where' clause.
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 prefix for subsequent queries.
type DbUserTable ¶
type DbUserTable struct {
Prefix, Name string
Db sqlgen2.Execer
Ctx context.Context
Dialect schema.Dialect
Logger *log.Logger
}
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 NewDbUserTable ¶
NewDbUserTable returns a new table instance. If a blank table name is supplied, the default name "users" will be used instead. The table name prefix is initially blank and the request context is 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(where where.Expression) (count int64, err error)
Count counts the Users in the table that match a 'where' clause.
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.
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) 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(where where.Expression) (int64, error)
Delete deletes one or more rows from the table, given a 'where' clause.
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) FullName ¶
func (tbl DbUserTable) FullName() string
FullName gets the concatenated prefix and table name.
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) 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) 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(where where.Expression, orderBy string) ([]*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 'orderBy'; otherwise use a blank string.
func (DbUserTable) SelectOne ¶
func (tbl DbUserTable) SelectOne(where where.Expression, orderBy string) (*User, error)
SelectOne allows a single User to be obtained from the sqlgen2. Any order, limit or offset clauses can be supplied in 'orderBy'; otherwise use a blank string. 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 User 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'; otherwise use a blank string. If not found, *User 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'; otherwise use a blank string.
func (DbUserTable) SetLogger ¶
func (tbl DbUserTable) SetLogger(logger *log.Logger) sqlgen2.Table
SetLogger sets the logger for subsequent queries, returning the interface.
func (DbUserTable) SliceActive ¶
func (tbl DbUserTable) SliceActive(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
func (DbUserTable) SliceAdmin ¶
func (tbl DbUserTable) SliceAdmin(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
func (DbUserTable) SliceAvatar ¶
func (tbl DbUserTable) SliceAvatar(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
func (DbUserTable) SliceEmailAddress ¶
func (tbl DbUserTable) SliceEmailAddress(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
func (DbUserTable) SliceLastUpdated ¶
func (tbl DbUserTable) SliceLastUpdated(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
func (DbUserTable) SliceLogin ¶
func (tbl DbUserTable) SliceLogin(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
func (DbUserTable) SliceUid ¶
func (tbl DbUserTable) SliceUid(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
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(where where.Expression, fields ...sql.NamedArg) (int64, error)
UpdateFields updates one or more columns, given a 'where' clause.
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 prefix for subsequent queries.
type HookTable ¶
type HookTable struct {
Prefix, Name string
Db sqlgen2.Execer
Ctx context.Context
Dialect schema.Dialect
Logger *log.Logger
}
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 NewHookTable ¶
NewHookTable returns a new table instance. If a blank table name is supplied, the default name "hooks" will be used instead. The table name prefix is initially blank and the request context is the background.
func (HookTable) BeginTx ¶
Begin starts a transaction. The default isolation level is dependent on the driver.
func (HookTable) Count ¶
func (tbl HookTable) Count(where where.Expression) (count int64, err error)
Count counts the Hooks in the table that match a 'where' clause.
func (HookTable) CreateTable ¶
CreateTable creates the table.
func (HookTable) 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(where where.Expression) (int64, error)
Delete deletes one or more rows from the table, given a 'where' clause.
func (HookTable) Exec ¶
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 ¶
GetHook gets the record with a given primary key value. If not found, *Hook will be nil.
func (HookTable) Insert ¶
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) QueryOne ¶
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 'orderBy'; otherwise use a blank string.
func (HookTable) SelectOne ¶
SelectOne allows a single Hook to be obtained from the sqlgen2. Any order, limit or offset clauses can be supplied in 'orderBy'; otherwise use a blank string. If not found, *Example will be nil.
func (HookTable) SelectOneSA ¶
SelectOneSA allows a single Hook 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'; otherwise use a blank string. If not found, *Hook will be nil.
func (HookTable) SelectSA ¶
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'; otherwise use a blank string.
func (HookTable) SetLogger ¶
SetLogger sets the logger for subsequent queries, returning the interface.
func (HookTable) SliceCategory ¶
SliceCategory gets the Category column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in 'orderBy'; otherwise use a blank string.
func (HookTable) SliceCreated ¶
SliceCreated gets the Created column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in 'orderBy'; otherwise use a blank string.
func (HookTable) SliceDeleted ¶
SliceDeleted gets the Deleted column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in 'orderBy'; otherwise use a blank string.
func (HookTable) SliceForced ¶
SliceForced gets the Forced column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in 'orderBy'; otherwise use a blank string.
func (HookTable) SliceId ¶
SliceId gets the Id column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in 'orderBy'; otherwise use a blank string.
func (HookTable) SliceSha ¶
SliceSha gets the Sha column for all rows that match the 'where' condition. Any order, limit or offset clauses can be supplied in 'orderBy'; otherwise use a blank string.
func (HookTable) Truncate ¶
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 ¶
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 ¶
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 ¶
UpdateFields updates one or more columns, given a 'where' clause.
func (HookTable) WithContext ¶
WithContext sets the context for subsequent queries.
func (HookTable) WithLogger ¶
WithLogger sets the logger for subsequent queries.
func (HookTable) WithPrefix ¶
WithPrefix sets the prefix for subsequent queries.
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 }
type IssueTable ¶
type IssueTable struct {
Prefix, Name string
Db sqlgen2.Execer
Ctx context.Context
Dialect schema.Dialect
Logger *log.Logger
}
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 NewIssueTable ¶
NewIssueTable returns a new table instance. If a blank table name is supplied, the default name "issues" will be used instead. The table name prefix is initially blank and the request context is 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(where where.Expression) (count int64, err error)
Count counts the Issues in the table that match a 'where' clause.
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.
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) 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(where where.Expression) (int64, error)
Delete deletes one or more rows from the table, given a 'where' clause.
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) FullName ¶
func (tbl IssueTable) FullName() string
FullName gets the concatenated prefix and table name.
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) 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) 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(where where.Expression, orderBy string) ([]*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 'orderBy'; otherwise use a blank string.
func (IssueTable) SelectOne ¶
func (tbl IssueTable) SelectOne(where where.Expression, orderBy string) (*Issue, error)
SelectOne allows a single Issue to be obtained from the sqlgen2. Any order, limit or offset clauses can be supplied in 'orderBy'; otherwise use a blank string. 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 Issue 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'; otherwise use a blank string. If not found, *Issue 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'; otherwise use a blank string.
func (IssueTable) SetLogger ¶
func (tbl IssueTable) SetLogger(logger *log.Logger) sqlgen2.Table
SetLogger sets the logger for subsequent queries, returning the interface.
func (IssueTable) SliceAssignee ¶
func (tbl IssueTable) SliceAssignee(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
func (IssueTable) SliceBody ¶
func (tbl IssueTable) SliceBody(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
func (IssueTable) SliceDate ¶
func (tbl IssueTable) SliceDate(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
func (IssueTable) SliceId ¶
func (tbl IssueTable) SliceId(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
func (IssueTable) SliceNumber ¶
func (tbl IssueTable) SliceNumber(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
func (IssueTable) SliceState ¶
func (tbl IssueTable) SliceState(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
func (IssueTable) SliceTitle ¶
func (tbl IssueTable) SliceTitle(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
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(where where.Expression, fields ...sql.NamedArg) (int64, error)
UpdateFields updates one or more columns, given a 'where' clause.
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 prefix for subsequent queries.
type User ¶
type V2UserTable ¶
type V2UserTable struct {
Prefix, Name string
Db sqlgen2.Execer
Ctx context.Context
Dialect schema.Dialect
Logger *log.Logger
}
V2UserTable 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 NewV2UserTable ¶
NewV2UserTable returns a new table instance. If a blank table name is supplied, the default name "users" will be used instead. The table name prefix is initially blank and the request context is the background.
func (V2UserTable) BeginTx ¶
func (tbl V2UserTable) BeginTx(opts *sql.TxOptions) (V2UserTable, error)
Begin starts a transaction. The default isolation level is dependent on the driver.
func (V2UserTable) Count ¶
func (tbl V2UserTable) Count(where where.Expression) (count int64, err error)
Count counts the Users in the table that match a 'where' clause.
func (V2UserTable) CountSA ¶
func (tbl V2UserTable) CountSA(where string, args ...interface{}) (count int64, err error)
CountSA counts Users in the table that match a 'where' clause.
func (V2UserTable) DB ¶
func (tbl V2UserTable) 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 (V2UserTable) Delete ¶
func (tbl V2UserTable) Delete(where where.Expression) (int64, error)
Delete deletes one or more rows from the table, given a 'where' clause.
func (V2UserTable) Exec ¶
func (tbl V2UserTable) 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 (V2UserTable) FullName ¶
func (tbl V2UserTable) FullName() string
FullName gets the concatenated prefix and table name.
func (V2UserTable) GetUser ¶
func (tbl V2UserTable) GetUser(id int64) (*User, error)
GetUser gets the record with a given primary key value. If not found, *User will be nil.
func (V2UserTable) Insert ¶
func (tbl V2UserTable) 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 (V2UserTable) IsTx ¶
func (tbl V2UserTable) IsTx() bool
IsTx tests whether this is within a transaction.
func (V2UserTable) Query ¶
func (tbl V2UserTable) Query(query string, args ...interface{}) ([]*User, error)
Query is the low-level access function for Users.
func (V2UserTable) QueryOne ¶
func (tbl V2UserTable) 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 (V2UserTable) Select ¶
func (tbl V2UserTable) Select(where where.Expression, orderBy string) ([]*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 'orderBy'; otherwise use a blank string.
func (V2UserTable) SelectOne ¶
func (tbl V2UserTable) SelectOne(where where.Expression, orderBy string) (*User, error)
SelectOne allows a single User to be obtained from the sqlgen2. Any order, limit or offset clauses can be supplied in 'orderBy'; otherwise use a blank string. If not found, *Example will be nil.
func (V2UserTable) SelectOneSA ¶
func (tbl V2UserTable) SelectOneSA(where, orderBy string, args ...interface{}) (*User, error)
SelectOneSA allows a single User 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'; otherwise use a blank string. If not found, *User will be nil.
func (V2UserTable) SelectSA ¶
func (tbl V2UserTable) 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'; otherwise use a blank string.
func (V2UserTable) SetLogger ¶
func (tbl V2UserTable) SetLogger(logger *log.Logger) sqlgen2.Table
SetLogger sets the logger for subsequent queries, returning the interface.
func (V2UserTable) SliceActive ¶
func (tbl V2UserTable) SliceActive(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
func (V2UserTable) SliceAdmin ¶
func (tbl V2UserTable) SliceAdmin(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
func (V2UserTable) SliceAvatar ¶
func (tbl V2UserTable) SliceAvatar(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
func (V2UserTable) SliceEmailAddress ¶
func (tbl V2UserTable) SliceEmailAddress(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
func (V2UserTable) SliceLastUpdated ¶
func (tbl V2UserTable) SliceLastUpdated(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
func (V2UserTable) SliceLogin ¶
func (tbl V2UserTable) SliceLogin(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
func (V2UserTable) SliceUid ¶
func (tbl V2UserTable) SliceUid(where where.Expression, orderBy string) ([]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 'orderBy'; otherwise use a blank string.
func (V2UserTable) Truncate ¶
func (tbl V2UserTable) 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 (V2UserTable) Tx ¶
func (tbl V2UserTable) 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 (V2UserTable) Update ¶
func (tbl V2UserTable) 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 (V2UserTable) UpdateFields ¶
func (tbl V2UserTable) UpdateFields(where where.Expression, fields ...sql.NamedArg) (int64, error)
UpdateFields updates one or more columns, given a 'where' clause.
func (V2UserTable) WithContext ¶
func (tbl V2UserTable) WithContext(ctx context.Context) V2UserTable
WithContext sets the context for subsequent queries.
func (V2UserTable) WithLogger ¶
func (tbl V2UserTable) WithLogger(logger *log.Logger) V2UserTable
WithLogger sets the logger for subsequent queries.
func (V2UserTable) WithPrefix ¶
func (tbl V2UserTable) WithPrefix(pfx string) V2UserTable
WithPrefix sets the prefix for subsequent queries.
type V3UserTable ¶
type V3UserTable struct {
Prefix, Name string
Db sqlgen2.Execer
Ctx context.Context
Dialect schema.Dialect
Logger *log.Logger
}
V3UserTable 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 NewV3UserTable ¶
NewV3UserTable returns a new table instance. If a blank table name is supplied, the default name "users" will be used instead. The table name prefix is initially blank and the request context is the background.
func (V3UserTable) BeginTx ¶
func (tbl V3UserTable) BeginTx(opts *sql.TxOptions) (V3UserTable, error)
Begin starts a transaction. The default isolation level is dependent on the driver.
func (V3UserTable) CreateIndexes ¶
func (tbl V3UserTable) CreateIndexes(ifNotExist bool) (err error)
CreateIndexes executes queries that create the indexes needed by the User table.
func (V3UserTable) CreateTable ¶
func (tbl V3UserTable) CreateTable(ifNotExists bool) (int64, error)
CreateTable creates the table.
func (V3UserTable) CreateTableWithIndexes ¶
func (tbl V3UserTable) CreateTableWithIndexes(ifNotExist bool) (err error)
CreateTableWithIndexes invokes CreateTable then CreateIndexes.
func (V3UserTable) CreateUserEmailIndex ¶
func (tbl V3UserTable) CreateUserEmailIndex(ifNotExist bool) error
CreateUserEmailIndex creates the user_email index.
func (V3UserTable) CreateUserLoginIndex ¶
func (tbl V3UserTable) CreateUserLoginIndex(ifNotExist bool) error
CreateUserLoginIndex creates the user_login index.
func (V3UserTable) DB ¶
func (tbl V3UserTable) 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 (V3UserTable) DropIndexes ¶
func (tbl V3UserTable) DropIndexes(ifExist bool) (err error)
DropIndexes executes queries that drop the indexes on by the User table.
func (V3UserTable) DropTable ¶
func (tbl V3UserTable) DropTable(ifExists bool) (int64, error)
DropTable drops the table, destroying all its data.
func (V3UserTable) DropUserEmailIndex ¶
func (tbl V3UserTable) DropUserEmailIndex(ifExists bool) error
DropUserEmailIndex drops the user_email index.
func (V3UserTable) DropUserLoginIndex ¶
func (tbl V3UserTable) DropUserLoginIndex(ifExists bool) error
DropUserLoginIndex drops the user_login index.
func (V3UserTable) Exec ¶
func (tbl V3UserTable) 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 (V3UserTable) FullName ¶
func (tbl V3UserTable) FullName() string
FullName gets the concatenated prefix and table name.
func (V3UserTable) IsTx ¶
func (tbl V3UserTable) IsTx() bool
IsTx tests whether this is within a transaction.
func (V3UserTable) Query ¶
func (tbl V3UserTable) Query(query string, args ...interface{}) ([]*User, error)
Query is the low-level access function for Users.
func (V3UserTable) QueryOne ¶
func (tbl V3UserTable) 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 (V3UserTable) SetLogger ¶
func (tbl V3UserTable) SetLogger(logger *log.Logger) sqlgen2.Table
SetLogger sets the logger for subsequent queries, returning the interface.
func (V3UserTable) Tx ¶
func (tbl V3UserTable) 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 (V3UserTable) WithContext ¶
func (tbl V3UserTable) WithContext(ctx context.Context) V3UserTable
WithContext sets the context for subsequent queries.
func (V3UserTable) WithLogger ¶
func (tbl V3UserTable) WithLogger(logger *log.Logger) V3UserTable
WithLogger sets the logger for subsequent queries.
func (V3UserTable) WithPrefix ¶
func (tbl V3UserTable) WithPrefix(pfx string) V3UserTable
WithPrefix sets the prefix for subsequent queries.
type V4UserTable ¶
type V4UserTable struct {
Prefix, Name string
Db sqlgen2.Execer
Ctx context.Context
Dialect schema.Dialect
Logger *log.Logger
}
V4UserTable 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 NewV4UserTable ¶
NewV4UserTable returns a new table instance. If a blank table name is supplied, the default name "users" will be used instead. The table name prefix is initially blank and the request context is the background.
func (V4UserTable) BeginTx ¶
func (tbl V4UserTable) BeginTx(opts *sql.TxOptions) (V4UserTable, error)
Begin starts a transaction. The default isolation level is dependent on the driver.
func (V4UserTable) DB ¶
func (tbl V4UserTable) 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 (V4UserTable) Exec ¶
func (tbl V4UserTable) 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 (V4UserTable) FullName ¶
func (tbl V4UserTable) FullName() string
FullName gets the concatenated prefix and table name.
func (V4UserTable) IsTx ¶
func (tbl V4UserTable) IsTx() bool
IsTx tests whether this is within a transaction.
func (V4UserTable) Query ¶
func (tbl V4UserTable) Query(query string, args ...interface{}) ([]*User, error)
Query is the low-level access function for Users.
func (V4UserTable) QueryOne ¶
func (tbl V4UserTable) 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 (V4UserTable) SetLogger ¶
func (tbl V4UserTable) SetLogger(logger *log.Logger) sqlgen2.Table
SetLogger sets the logger for subsequent queries, returning the interface.
func (V4UserTable) Tx ¶
func (tbl V4UserTable) 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 (V4UserTable) WithContext ¶
func (tbl V4UserTable) WithContext(ctx context.Context) V4UserTable
WithContext sets the context for subsequent queries.
func (V4UserTable) WithLogger ¶
func (tbl V4UserTable) WithLogger(logger *log.Logger) V4UserTable
WithLogger sets the logger for subsequent queries.
func (V4UserTable) WithPrefix ¶
func (tbl V4UserTable) WithPrefix(pfx string) V4UserTable
WithPrefix sets the prefix for subsequent queries.