Documentation
¶
Index ¶
- Constants
- type AUserTable
- func (tbl AUserTable) BeginTx(opts *sql.TxOptions) (AUserTable, error)
- func (tbl AUserTable) Count(wh where.Expression) (count int64, err error)
- func (tbl AUserTable) CountSA(where string, args ...interface{}) (count int64, err error)
- func (tbl AUserTable) CreateIndexes(ifNotExist bool) (err error)
- func (tbl AUserTable) CreateTable(ifNotExists bool) (int64, error)
- func (tbl AUserTable) CreateTableWithIndexes(ifNotExist bool) (err error)
- func (tbl AUserTable) CreateUserEmailIndex(ifNotExist bool) error
- func (tbl AUserTable) CreateUserLoginIndex(ifNotExist bool) error
- func (tbl AUserTable) Ctx() context.Context
- func (tbl AUserTable) DB() *sql.DB
- func (tbl AUserTable) Delete(wh where.Expression) (int64, error)
- func (tbl AUserTable) DeleteUsers(id ...int64) (int64, error)
- func (tbl AUserTable) Dialect() schema.Dialect
- func (tbl AUserTable) DropIndexes(ifExist bool) (err error)
- func (tbl AUserTable) DropTable(ifExists bool) (int64, error)
- func (tbl AUserTable) DropUserEmailIndex(ifExists bool) error
- func (tbl AUserTable) DropUserLoginIndex(ifExists bool) error
- func (tbl AUserTable) Exec(query string, args ...interface{}) (int64, error)
- func (tbl AUserTable) GetUser(id int64) (*User, error)
- func (tbl AUserTable) GetUsers(id ...int64) (list []*User, err error)
- func (tbl AUserTable) Insert(vv ...*User) error
- func (tbl AUserTable) IsTx() bool
- func (tbl AUserTable) Logger() *log.Logger
- func (tbl AUserTable) Name() sqlgen2.TableName
- func (tbl AUserTable) Query(query string, args ...interface{}) ([]*User, error)
- func (tbl AUserTable) QueryOne(query string, args ...interface{}) (*User, error)
- func (tbl AUserTable) Select(wh where.Expression, qc where.QueryConstraint) ([]*User, error)
- func (tbl AUserTable) SelectOne(wh where.Expression, qc where.QueryConstraint) (*User, error)
- func (tbl AUserTable) SelectOneSA(where, orderBy string, args ...interface{}) (*User, error)
- func (tbl AUserTable) SelectSA(where, orderBy string, args ...interface{}) ([]*User, error)
- func (tbl AUserTable) SetLogger(logger *log.Logger) sqlgen2.Table
- func (tbl AUserTable) SetWrapper(wrapper interface{}) sqlgen2.Table
- func (tbl AUserTable) SliceActive(wh where.Expression, qc where.QueryConstraint) ([]bool, error)
- func (tbl AUserTable) SliceAdmin(wh where.Expression, qc where.QueryConstraint) ([]bool, error)
- func (tbl AUserTable) SliceAvatar(wh where.Expression, qc where.QueryConstraint) ([]string, error)
- func (tbl AUserTable) SliceEmailaddress(wh where.Expression, qc where.QueryConstraint) ([]string, error)
- func (tbl AUserTable) SliceLastupdated(wh where.Expression, qc where.QueryConstraint) ([]int64, error)
- func (tbl AUserTable) SliceLogin(wh where.Expression, qc where.QueryConstraint) ([]string, error)
- func (tbl AUserTable) SliceUid(wh where.Expression, qc where.QueryConstraint) ([]int64, error)
- func (tbl AUserTable) Truncate(force bool) (err error)
- func (tbl AUserTable) Tx() *sql.Tx
- func (tbl AUserTable) Update(vv ...*User) (int64, error)
- func (tbl AUserTable) UpdateFields(wh where.Expression, fields ...sql.NamedArg) (int64, error)
- func (tbl AUserTable) WithContext(ctx context.Context) AUserTable
- func (tbl AUserTable) WithLogger(logger *log.Logger) AUserTable
- func (tbl AUserTable) WithPrefix(pfx string) AUserTable
- func (tbl AUserTable) Wrapper() interface{}
- type Association
- type AssociationTable
- func (tbl AssociationTable) BeginTx(opts *sql.TxOptions) (AssociationTable, error)
- func (tbl AssociationTable) Count(wh 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) Ctx() context.Context
- func (tbl AssociationTable) DB() *sql.DB
- func (tbl AssociationTable) Delete(wh where.Expression) (int64, error)
- func (tbl AssociationTable) DeleteAssociations(id ...int64) (int64, error)
- func (tbl AssociationTable) Dialect() schema.Dialect
- func (tbl AssociationTable) DropTable(ifExists bool) (int64, error)
- func (tbl AssociationTable) Exec(query string, args ...interface{}) (int64, error)
- func (tbl AssociationTable) GetAssociation(id int64) (*Association, error)
- func (tbl AssociationTable) GetAssociations(id ...int64) (list []*Association, err error)
- func (tbl AssociationTable) Insert(vv ...*Association) error
- func (tbl AssociationTable) IsTx() bool
- func (tbl AssociationTable) Logger() *log.Logger
- func (tbl AssociationTable) Name() sqlgen2.TableName
- func (tbl AssociationTable) Query(query string, args ...interface{}) ([]*Association, error)
- func (tbl AssociationTable) QueryOne(query string, args ...interface{}) (*Association, error)
- func (tbl AssociationTable) Select(wh where.Expression, qc where.QueryConstraint) ([]*Association, error)
- func (tbl AssociationTable) SelectOne(wh where.Expression, qc where.QueryConstraint) (*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) SetWrapper(wrapper interface{}) sqlgen2.Table
- func (tbl AssociationTable) SliceCategory(wh where.Expression, qc where.QueryConstraint) ([]Category, error)
- func (tbl AssociationTable) SliceId(wh where.Expression, qc where.QueryConstraint) ([]int64, error)
- func (tbl AssociationTable) SliceName(wh where.Expression, qc where.QueryConstraint) ([]string, error)
- func (tbl AssociationTable) SliceQuality(wh where.Expression, qc where.QueryConstraint) ([]string, error)
- func (tbl AssociationTable) SliceRef1(wh where.Expression, qc where.QueryConstraint) ([]int64, error)
- func (tbl AssociationTable) SliceRef2(wh where.Expression, qc where.QueryConstraint) ([]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(wh 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
- func (tbl AssociationTable) Wrapper() interface{}
- type Author
- type CUserTable
- func (tbl CUserTable) BeginTx(opts *sql.TxOptions) (CUserTable, error)
- func (tbl CUserTable) Ctx() context.Context
- func (tbl CUserTable) DB() *sql.DB
- func (tbl CUserTable) Dialect() schema.Dialect
- func (tbl CUserTable) Exec(query string, args ...interface{}) (int64, error)
- func (tbl CUserTable) Insert(vv ...*User) error
- func (tbl CUserTable) IsTx() bool
- func (tbl CUserTable) Logger() *log.Logger
- func (tbl CUserTable) Name() sqlgen2.TableName
- func (tbl CUserTable) Query(query string, args ...interface{}) ([]*User, error)
- func (tbl CUserTable) QueryOne(query string, args ...interface{}) (*User, error)
- func (tbl CUserTable) SetLogger(logger *log.Logger) sqlgen2.Table
- func (tbl CUserTable) SetWrapper(wrapper interface{}) sqlgen2.Table
- func (tbl CUserTable) Tx() *sql.Tx
- func (tbl CUserTable) WithContext(ctx context.Context) CUserTable
- func (tbl CUserTable) WithLogger(logger *log.Logger) CUserTable
- func (tbl CUserTable) WithPrefix(pfx string) CUserTable
- func (tbl CUserTable) Wrapper() interface{}
- type Category
- type Commit
- type Compound
- type DUserTable
- func (tbl DUserTable) BeginTx(opts *sql.TxOptions) (DUserTable, error)
- func (tbl DUserTable) Ctx() context.Context
- func (tbl DUserTable) DB() *sql.DB
- func (tbl DUserTable) Delete(wh where.Expression) (int64, error)
- func (tbl DUserTable) DeleteUsers(id ...int64) (int64, error)
- func (tbl DUserTable) Dialect() schema.Dialect
- func (tbl DUserTable) Exec(query string, args ...interface{}) (int64, error)
- func (tbl DUserTable) IsTx() bool
- func (tbl DUserTable) Logger() *log.Logger
- func (tbl DUserTable) Name() sqlgen2.TableName
- func (tbl DUserTable) Query(query string, args ...interface{}) ([]*User, error)
- func (tbl DUserTable) QueryOne(query string, args ...interface{}) (*User, error)
- func (tbl DUserTable) SetLogger(logger *log.Logger) sqlgen2.Table
- func (tbl DUserTable) SetWrapper(wrapper interface{}) sqlgen2.Table
- func (tbl DUserTable) Tx() *sql.Tx
- func (tbl DUserTable) WithContext(ctx context.Context) DUserTable
- func (tbl DUserTable) WithLogger(logger *log.Logger) DUserTable
- func (tbl DUserTable) WithPrefix(pfx string) DUserTable
- func (tbl DUserTable) Wrapper() interface{}
- type Date
- type Dates
- type DbCompoundTable
- func (tbl DbCompoundTable) BeginTx(opts *sql.TxOptions) (DbCompoundTable, error)
- func (tbl DbCompoundTable) Count(wh 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) Ctx() context.Context
- func (tbl DbCompoundTable) DB() *sql.DB
- func (tbl DbCompoundTable) Delete(wh where.Expression) (int64, error)
- func (tbl DbCompoundTable) Dialect() schema.Dialect
- 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) Insert(vv ...*Compound) error
- func (tbl DbCompoundTable) IsTx() bool
- func (tbl DbCompoundTable) Logger() *log.Logger
- func (tbl DbCompoundTable) Name() sqlgen2.TableName
- func (tbl DbCompoundTable) Query(query string, args ...interface{}) ([]*Compound, error)
- func (tbl DbCompoundTable) QueryOne(query string, args ...interface{}) (*Compound, error)
- func (tbl DbCompoundTable) Select(wh where.Expression, qc where.QueryConstraint) ([]*Compound, error)
- func (tbl DbCompoundTable) SelectOne(wh where.Expression, qc where.QueryConstraint) (*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) SetWrapper(wrapper interface{}) sqlgen2.Table
- func (tbl DbCompoundTable) SliceAlpha(wh where.Expression, qc where.QueryConstraint) ([]string, error)
- func (tbl DbCompoundTable) SliceBeta(wh where.Expression, qc where.QueryConstraint) ([]string, error)
- func (tbl DbCompoundTable) SliceCategory(wh where.Expression, qc where.QueryConstraint) ([]Category, error)
- func (tbl DbCompoundTable) Truncate(force bool) (err error)
- func (tbl DbCompoundTable) Tx() *sql.Tx
- func (tbl DbCompoundTable) UpdateFields(wh 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
- func (tbl DbCompoundTable) Wrapper() interface{}
- type DbUserTable
- func (tbl DbUserTable) BeginTx(opts *sql.TxOptions) (DbUserTable, error)
- func (tbl DbUserTable) Count(wh 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) Ctx() context.Context
- func (tbl DbUserTable) DB() *sql.DB
- func (tbl DbUserTable) Delete(wh where.Expression) (int64, error)
- func (tbl DbUserTable) DeleteUsers(id ...int64) (int64, error)
- func (tbl DbUserTable) Dialect() schema.Dialect
- 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) GetUser(id int64) (*User, error)
- func (tbl DbUserTable) GetUsers(id ...int64) (list []*User, err error)
- func (tbl DbUserTable) Insert(vv ...*User) error
- func (tbl DbUserTable) IsTx() bool
- func (tbl DbUserTable) Logger() *log.Logger
- func (tbl DbUserTable) Name() sqlgen2.TableName
- func (tbl DbUserTable) Query(query string, args ...interface{}) ([]*User, error)
- func (tbl DbUserTable) QueryOne(query string, args ...interface{}) (*User, error)
- func (tbl DbUserTable) Select(wh where.Expression, qc where.QueryConstraint) ([]*User, error)
- func (tbl DbUserTable) SelectOne(wh where.Expression, qc where.QueryConstraint) (*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) SetWrapper(wrapper interface{}) sqlgen2.Table
- func (tbl DbUserTable) SliceActive(wh where.Expression, qc where.QueryConstraint) ([]bool, error)
- func (tbl DbUserTable) SliceAdmin(wh where.Expression, qc where.QueryConstraint) ([]bool, error)
- func (tbl DbUserTable) SliceAvatar(wh where.Expression, qc where.QueryConstraint) ([]string, error)
- func (tbl DbUserTable) SliceEmailaddress(wh where.Expression, qc where.QueryConstraint) ([]string, error)
- func (tbl DbUserTable) SliceLastupdated(wh where.Expression, qc where.QueryConstraint) ([]int64, error)
- func (tbl DbUserTable) SliceLogin(wh where.Expression, qc where.QueryConstraint) ([]string, error)
- func (tbl DbUserTable) SliceUid(wh where.Expression, qc where.QueryConstraint) ([]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(wh 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
- func (tbl DbUserTable) Wrapper() interface{}
- type Email
- type Hook
- type HookList
- type HookTable
- func (tbl HookTable) BeginTx(opts *sql.TxOptions) (HookTable, error)
- func (tbl HookTable) Count(wh 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) Ctx() context.Context
- func (tbl HookTable) DB() *sql.DB
- func (tbl HookTable) Delete(wh where.Expression) (int64, error)
- func (tbl HookTable) DeleteHooks(id ...int64) (int64, error)
- func (tbl HookTable) Dialect() schema.Dialect
- func (tbl HookTable) DropTable(ifExists bool) (int64, error)
- func (tbl HookTable) Exec(query string, args ...interface{}) (int64, error)
- func (tbl HookTable) GetHook(id int64) (*Hook, error)
- func (tbl HookTable) GetHooks(id ...int64) (list HookList, err error)
- func (tbl HookTable) Insert(vv ...*Hook) error
- func (tbl HookTable) IsTx() bool
- func (tbl HookTable) Logger() *log.Logger
- func (tbl HookTable) Name() sqlgen2.TableName
- func (tbl HookTable) Query(query string, args ...interface{}) (HookList, error)
- func (tbl HookTable) QueryOne(query string, args ...interface{}) (*Hook, error)
- func (tbl HookTable) Select(wh where.Expression, qc where.QueryConstraint) (HookList, error)
- func (tbl HookTable) SelectOne(wh where.Expression, qc where.QueryConstraint) (*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) SetWrapper(wrapper interface{}) sqlgen2.Table
- func (tbl HookTable) SliceAfter(wh where.Expression, qc where.QueryConstraint) ([]string, error)
- func (tbl HookTable) SliceBefore(wh where.Expression, qc where.QueryConstraint) ([]string, error)
- func (tbl HookTable) SliceCategory(wh where.Expression, qc where.QueryConstraint) ([]Category, error)
- func (tbl HookTable) SliceCommitId(wh where.Expression, qc where.QueryConstraint) ([]string, error)
- func (tbl HookTable) SliceCreated(wh where.Expression, qc where.QueryConstraint) ([]bool, error)
- func (tbl HookTable) SliceDeleted(wh where.Expression, qc where.QueryConstraint) ([]bool, error)
- func (tbl HookTable) SliceForced(wh where.Expression, qc where.QueryConstraint) ([]bool, error)
- func (tbl HookTable) SliceHeadCommitAuthorEmail(wh where.Expression, qc where.QueryConstraint) ([]Email, error)
- func (tbl HookTable) SliceHeadCommitAuthorName(wh where.Expression, qc where.QueryConstraint) ([]string, error)
- func (tbl HookTable) SliceHeadCommitAuthorUsername(wh where.Expression, qc where.QueryConstraint) ([]string, error)
- func (tbl HookTable) SliceHeadCommitCommitterEmail(wh where.Expression, qc where.QueryConstraint) ([]Email, error)
- func (tbl HookTable) SliceHeadCommitCommitterName(wh where.Expression, qc where.QueryConstraint) ([]string, error)
- func (tbl HookTable) SliceHeadCommitCommitterUsername(wh where.Expression, qc where.QueryConstraint) ([]string, error)
- func (tbl HookTable) SliceId(wh where.Expression, qc where.QueryConstraint) ([]int64, error)
- func (tbl HookTable) SliceMessage(wh where.Expression, qc where.QueryConstraint) ([]string, error)
- func (tbl HookTable) SliceSha(wh where.Expression, qc where.QueryConstraint) ([]string, error)
- func (tbl HookTable) SliceTimestamp(wh where.Expression, qc where.QueryConstraint) ([]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(wh 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
- func (tbl HookTable) Wrapper() interface{}
- type Issue
- func (v *Issue) SetAssignee(x string) *Issue
- func (v *Issue) SetBody(x string) *Issue
- func (v *Issue) SetDate(x Date) *Issue
- func (v *Issue) SetId(x int64) *Issue
- func (v *Issue) SetLabels(x []string) *Issue
- func (v *Issue) SetNumber(x int) *Issue
- func (v *Issue) SetState(x string) *Issue
- func (v *Issue) SetTitle(x string) *Issue
- type IssueTable
- func (tbl IssueTable) BeginTx(opts *sql.TxOptions) (IssueTable, error)
- func (tbl IssueTable) Count(wh 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) Ctx() context.Context
- func (tbl IssueTable) DB() *sql.DB
- func (tbl IssueTable) Delete(wh where.Expression) (int64, error)
- func (tbl IssueTable) DeleteIssues(id ...int64) (int64, error)
- func (tbl IssueTable) Dialect() schema.Dialect
- 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) GetIssue(id int64) (*Issue, error)
- func (tbl IssueTable) GetIssues(id ...int64) (list []*Issue, err error)
- func (tbl IssueTable) Insert(vv ...*Issue) error
- func (tbl IssueTable) IsTx() bool
- func (tbl IssueTable) Logger() *log.Logger
- func (tbl IssueTable) Name() sqlgen2.TableName
- func (tbl IssueTable) Query(query string, args ...interface{}) ([]*Issue, error)
- func (tbl IssueTable) QueryOne(query string, args ...interface{}) (*Issue, error)
- func (tbl IssueTable) Select(wh where.Expression, qc where.QueryConstraint) ([]*Issue, error)
- func (tbl IssueTable) SelectOne(wh where.Expression, qc where.QueryConstraint) (*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) SetWrapper(wrapper interface{}) sqlgen2.Table
- func (tbl IssueTable) SliceAssignee(wh where.Expression, qc where.QueryConstraint) ([]string, error)
- func (tbl IssueTable) SliceBigbody(wh where.Expression, qc where.QueryConstraint) ([]string, error)
- func (tbl IssueTable) SliceDate(wh where.Expression, qc where.QueryConstraint) ([]Date, error)
- func (tbl IssueTable) SliceId(wh where.Expression, qc where.QueryConstraint) ([]int64, error)
- func (tbl IssueTable) SliceNumber(wh where.Expression, qc where.QueryConstraint) ([]int, error)
- func (tbl IssueTable) SliceState(wh where.Expression, qc where.QueryConstraint) ([]string, error)
- func (tbl IssueTable) SliceTitle(wh where.Expression, qc where.QueryConstraint) ([]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(wh 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
- func (tbl IssueTable) Wrapper() interface{}
- type RUserTable
- func (tbl RUserTable) BeginTx(opts *sql.TxOptions) (RUserTable, error)
- func (tbl RUserTable) Count(wh where.Expression) (count int64, err error)
- func (tbl RUserTable) CountSA(where string, args ...interface{}) (count int64, err error)
- func (tbl RUserTable) Ctx() context.Context
- func (tbl RUserTable) DB() *sql.DB
- func (tbl RUserTable) Dialect() schema.Dialect
- func (tbl RUserTable) Exec(query string, args ...interface{}) (int64, error)
- func (tbl RUserTable) GetUser(id int64) (*User, error)
- func (tbl RUserTable) GetUsers(id ...int64) (list []*User, err error)
- func (tbl RUserTable) IsTx() bool
- func (tbl RUserTable) Logger() *log.Logger
- func (tbl RUserTable) Name() sqlgen2.TableName
- func (tbl RUserTable) Query(query string, args ...interface{}) ([]*User, error)
- func (tbl RUserTable) QueryOne(query string, args ...interface{}) (*User, error)
- func (tbl RUserTable) Select(wh where.Expression, qc where.QueryConstraint) ([]*User, error)
- func (tbl RUserTable) SelectOne(wh where.Expression, qc where.QueryConstraint) (*User, error)
- func (tbl RUserTable) SelectOneSA(where, orderBy string, args ...interface{}) (*User, error)
- func (tbl RUserTable) SelectSA(where, orderBy string, args ...interface{}) ([]*User, error)
- func (tbl RUserTable) SetLogger(logger *log.Logger) sqlgen2.Table
- func (tbl RUserTable) SetWrapper(wrapper interface{}) sqlgen2.Table
- func (tbl RUserTable) Tx() *sql.Tx
- func (tbl RUserTable) WithContext(ctx context.Context) RUserTable
- func (tbl RUserTable) WithLogger(logger *log.Logger) RUserTable
- func (tbl RUserTable) WithPrefix(pfx string) RUserTable
- func (tbl RUserTable) Wrapper() interface{}
- type SUserTable
- func (tbl SUserTable) BeginTx(opts *sql.TxOptions) (SUserTable, error)
- func (tbl SUserTable) Ctx() context.Context
- func (tbl SUserTable) DB() *sql.DB
- func (tbl SUserTable) Dialect() schema.Dialect
- func (tbl SUserTable) Exec(query string, args ...interface{}) (int64, error)
- func (tbl SUserTable) IsTx() bool
- func (tbl SUserTable) Logger() *log.Logger
- func (tbl SUserTable) Name() sqlgen2.TableName
- func (tbl SUserTable) Query(query string, args ...interface{}) ([]*User, error)
- func (tbl SUserTable) QueryOne(query string, args ...interface{}) (*User, error)
- func (tbl SUserTable) SetLogger(logger *log.Logger) sqlgen2.Table
- func (tbl SUserTable) SetWrapper(wrapper interface{}) sqlgen2.Table
- func (tbl SUserTable) SliceActive(wh where.Expression, qc where.QueryConstraint) ([]bool, error)
- func (tbl SUserTable) SliceAdmin(wh where.Expression, qc where.QueryConstraint) ([]bool, error)
- func (tbl SUserTable) SliceAvatar(wh where.Expression, qc where.QueryConstraint) ([]string, error)
- func (tbl SUserTable) SliceEmailaddress(wh where.Expression, qc where.QueryConstraint) ([]string, error)
- func (tbl SUserTable) SliceLastupdated(wh where.Expression, qc where.QueryConstraint) ([]int64, error)
- func (tbl SUserTable) SliceLogin(wh where.Expression, qc where.QueryConstraint) ([]string, error)
- func (tbl SUserTable) SliceUid(wh where.Expression, qc where.QueryConstraint) ([]int64, error)
- func (tbl SUserTable) Tx() *sql.Tx
- func (tbl SUserTable) WithContext(ctx context.Context) SUserTable
- func (tbl SUserTable) WithLogger(logger *log.Logger) SUserTable
- func (tbl SUserTable) WithPrefix(pfx string) SUserTable
- func (tbl SUserTable) Wrapper() interface{}
- type UUserTable
- func (tbl UUserTable) BeginTx(opts *sql.TxOptions) (UUserTable, error)
- func (tbl UUserTable) Ctx() context.Context
- func (tbl UUserTable) DB() *sql.DB
- func (tbl UUserTable) Dialect() schema.Dialect
- func (tbl UUserTable) Exec(query string, args ...interface{}) (int64, error)
- func (tbl UUserTable) IsTx() bool
- func (tbl UUserTable) Logger() *log.Logger
- func (tbl UUserTable) Name() sqlgen2.TableName
- func (tbl UUserTable) Query(query string, args ...interface{}) ([]*User, error)
- func (tbl UUserTable) QueryOne(query string, args ...interface{}) (*User, error)
- func (tbl UUserTable) SetLogger(logger *log.Logger) sqlgen2.Table
- func (tbl UUserTable) SetWrapper(wrapper interface{}) sqlgen2.Table
- func (tbl UUserTable) Tx() *sql.Tx
- func (tbl UUserTable) Update(vv ...*User) (int64, error)
- func (tbl UUserTable) UpdateFields(wh where.Expression, fields ...sql.NamedArg) (int64, error)
- func (tbl UUserTable) WithContext(ctx context.Context) UUserTable
- func (tbl UUserTable) WithLogger(logger *log.Logger) UUserTable
- func (tbl UUserTable) WithPrefix(pfx string) UUserTable
- func (tbl UUserTable) Wrapper() interface{}
- type User
- func (u *User) PostGet() error
- func (u *User) PreInsert() error
- func (u *User) PreUpdate() error
- func (v *User) SetActive(x bool) *User
- func (v *User) SetAdmin(x bool) *User
- func (v *User) SetAvatar(x string) *User
- func (v *User) SetEmailAddress(x string) *User
- func (v *User) SetFave(x big.Int) *User
- func (v *User) SetLastUpdated(x int64) *User
- func (v *User) SetLogin(x string) *User
- func (v *User) SetUid(x int64) *User
- func (v *User) Setsecret(x string) *User
- func (v *User) Settoken(x string) *User
- type XUserTable
- func (tbl XUserTable) BeginTx(opts *sql.TxOptions) (XUserTable, error)
- func (tbl XUserTable) Ctx() context.Context
- func (tbl XUserTable) DB() *sql.DB
- func (tbl XUserTable) Dialect() schema.Dialect
- func (tbl XUserTable) Exec(query string, args ...interface{}) (int64, error)
- func (tbl XUserTable) IsTx() bool
- func (tbl XUserTable) Logger() *log.Logger
- func (tbl XUserTable) Name() sqlgen2.TableName
- func (tbl XUserTable) Query(query string, args ...interface{}) ([]*User, error)
- func (tbl XUserTable) QueryOne(query string, args ...interface{}) (*User, error)
- func (tbl XUserTable) SetLogger(logger *log.Logger) sqlgen2.Table
- func (tbl XUserTable) SetWrapper(wrapper interface{}) sqlgen2.Table
- func (tbl XUserTable) Tx() *sql.Tx
- func (tbl XUserTable) WithContext(ctx context.Context) XUserTable
- func (tbl XUserTable) WithLogger(logger *log.Logger) XUserTable
- func (tbl XUserTable) WithPrefix(pfx string) XUserTable
- func (tbl XUserTable) Wrapper() interface{}
Constants ¶
const AUserColumnNames = "uid, login, emailaddress, avatar, active, admin, fave, lastupdated, token, secret"
const AUserDataColumnNames = "login, emailaddress, avatar, active, admin, fave, lastupdated, token, secret"
const AUserPk = "Uid"
const AssociationColumnNames = "id, name, quality, ref1, ref2, category"
const AssociationDataColumnNames = "name, quality, ref1, ref2, category"
const AssociationPk = "Id"
const DbCompoundColumnNames = "alpha, beta, category"
const DbCompoundDataColumnNames = "alpha, beta, category"
const DbUserColumnNames = "uid, login, emailaddress, avatar, active, admin, fave, lastupdated, token, secret"
const DbUserDataColumnNames = "login, emailaddress, avatar, active, admin, fave, lastupdated, token, secret"
const DbUserPk = "Uid"
const HookColumnNames = "" /* 258-byte string literal not displayed */
const HookDataColumnNames = "" /* 254-byte string literal not displayed */
const HookPk = "Id"
const IssueColumnNames = "id, number, date, title, bigbody, assignee, state, labels"
const IssueDataColumnNames = "number, date, title, bigbody, assignee, state, labels"
const IssuePk = "Id"
const NumAUserColumns = 10
const NumAUserDataColumns = 9
const NumAssociationColumns = 6
const NumAssociationDataColumns = 5
const NumDbCompoundColumns = 3
const NumDbCompoundDataColumns = 3
const NumDbUserColumns = 10
const NumDbUserDataColumns = 9
const NumHookColumns = 17
const NumHookDataColumns = 16
const NumIssueColumns = 8
const NumIssueDataColumns = 7
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
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 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 ¶
func (tbl AssociationTable) Select(wh where.Expression, qc where.QueryConstraint) ([]*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 query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.
func (AssociationTable) SelectOne ¶
func (tbl AssociationTable) SelectOne(wh where.Expression, qc where.QueryConstraint) (*Association, error)
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 ¶
func (tbl AssociationTable) 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 (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 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
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 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
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 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 ¶
func (tbl DbCompoundTable) Select(wh where.Expression, qc where.QueryConstraint) ([]*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 query constraint 'qc'. Use nil values for the 'wh' and/or 'qc' arguments if they are not needed.
func (DbCompoundTable) SelectOne ¶
func (tbl DbCompoundTable) SelectOne(wh where.Expression, qc where.QueryConstraint) (*Compound, error)
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 ¶
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) 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 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
CopyTableAsHookTable copies a table instance, retaining the name etc but providing methods appropriate for 'Hook'.
func NewHookTable ¶
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 ¶
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 ¶
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 ¶
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(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
DeleteHooks deletes rows from the table, given some primary keys. The list of ids can be arbitrarily long.
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) GetHooks ¶ added in v0.8.0
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 ¶
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 ¶
func (tbl HookTable) Select(wh where.Expression, qc where.QueryConstraint) (HookList, error)
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 ¶
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 ¶
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 ¶
SetLogger sets the logger for subsequent queries, returning the interface.
func (HookTable) SetWrapper ¶ added in v0.8.0
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 ¶
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. Use a nil value for the 'wh' argument if it is not needed (very risky!).
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 table name 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 }
func (*Issue) SetAssignee ¶ added in v0.8.0
SetAssignee sets the Assignee field and returns the modified Issue.
func (*Issue) SetLabels ¶ added in v0.8.0
SetLabels sets the Labels field and returns the modified Issue.
func (*Issue) SetNumber ¶ added in v0.8.0
SetNumber sets the Number 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 ¶
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) 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
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
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
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) PreInsert ¶
These hooks are just used here for testing, but you could put whatever you like in them.
func (*User) SetActive ¶ added in v0.8.0
SetActive sets the Active field and returns the modified User.
func (*User) SetAdmin ¶ added in v0.8.0
SetAdmin sets the Admin field and returns the modified User.
func (*User) SetAvatar ¶ added in v0.8.0
SetAvatar sets the Avatar field and returns the modified User.
func (*User) SetEmailAddress ¶ added in v0.8.0
SetEmailAddress sets the EmailAddress field and returns the modified User.
func (*User) SetLastUpdated ¶ added in v0.8.0
SetLastUpdated sets the LastUpdated field and returns the modified User.
func (*User) SetLogin ¶ added in v0.8.0
SetLogin sets the Login 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
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.