Documentation ¶
Overview ¶
Package dal GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE
Index ¶
- Variables
- func ConfigureAdapter(a adapter.Adapter, poolSize int, maxConnDur time.Duration)
- func HardDelete() func(m featureSettings)
- func InSelect[T any](col sqlbuilder.TypedColumn[T], q Querier) sqlbuilder.ColumnValueExpr[T]
- func IncludeAllRecord() func(m featureSettings)
- func InjectContext(ctx context.Context, repo Session) context.Context
- func NotInSelect[T any](col sqlbuilder.TypedColumn[T], q Querier) sqlbuilder.ColumnValueExpr[T]
- func Tx(ctx context.Context, m sqlbuilder.Model, ...) error
- func WhereStmtNotEmpty() func(m featureSettings)
- type Database
- func (d *Database) ApplyCatalog(name string, tables ...*sqlbuilder.Tables)
- func (d *Database) Init(ctx context.Context) error
- func (d *Database) InjectContext(ctx context.Context) context.Context
- func (d *Database) Run(ctx context.Context) error
- func (v Database) RuntimeDoc(names ...string) ([]string, bool)
- func (d *Database) SetDefaults()
- type DeleteFunc
- type ModelWithAutoIncrement
- type ModelWithCreationTime
- type ModelWithSoftDelete
- type ModelWithUpdationTime
- type Mutation
- type OptionFunc
- type Querier
- type QuerierPatcher
- type ScanIterator
- type Session
- type SoftDeleteValueGetter
- type TableWrapper
- type TemporaryTable
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSkipScan = errors.New("scan skip")
View Source
var Scan = scanner.Scan
Functions ¶
func ConfigureAdapter ¶
func HardDelete ¶
func HardDelete() func(m featureSettings)
func InSelect ¶
func InSelect[T any](col sqlbuilder.TypedColumn[T], q Querier) sqlbuilder.ColumnValueExpr[T]
func IncludeAllRecord ¶
func IncludeAllRecord() func(m featureSettings)
func NotInSelect ¶
func NotInSelect[T any](col sqlbuilder.TypedColumn[T], q Querier) sqlbuilder.ColumnValueExpr[T]
func WhereStmtNotEmpty ¶
func WhereStmtNotEmpty() func(m featureSettings)
Types ¶
type Database ¶
type Database struct { // Endpoint of database Endpoint string `flag:""` // auto migrate before run EnableMigrate bool `flag:",omitempty"` // contains filtered or unexported fields }
func (*Database) ApplyCatalog ¶
func (d *Database) ApplyCatalog(name string, tables ...*sqlbuilder.Tables)
func (*Database) InjectContext ¶
func (*Database) SetDefaults ¶
func (d *Database) SetDefaults()
type DeleteFunc ¶
type DeleteFunc func()
func (DeleteFunc) RuntimeDoc ¶
func (DeleteFunc) RuntimeDoc(names ...string) ([]string, bool)
type ModelWithAutoIncrement ¶
type ModelWithAutoIncrement interface {
SetAutoIncrementID(u int64)
}
type ModelWithCreationTime ¶
type ModelWithCreationTime interface {
MarkCreatedAt()
}
type ModelWithSoftDelete ¶
type ModelWithUpdationTime ¶
type ModelWithUpdationTime interface {
MarkUpdatedAt()
}
type Mutation ¶
type Mutation[T any] interface { IncludesZero(zeroFields ...sqlbuilder.Column) Mutation[T] ForDelete(opts ...OptionFunc) Mutation[T] ForUpdateSet(assignments ...sqlbuilder.Assignment) Mutation[T] Where(where sqlbuilder.SqlExpr) Mutation[T] OnConflict(cols sqlbuilder.ColumnCollection) Mutation[T] DoNothing() Mutation[T] DoUpdateSet(cols ...sqlbuilder.Column) Mutation[T] DoWith(func(onConflictAddition sqlbuilder.OnConflictAddition) sqlbuilder.Addition) Mutation[T] Returning(cols ...sqlbuilder.SqlExpr) Mutation[T] Scan(recv any) Mutation[T] Save(ctx context.Context) error }
type OptionFunc ¶
type OptionFunc func(m featureSettings)
func (OptionFunc) RuntimeDoc ¶
func (OptionFunc) RuntimeDoc(names ...string) ([]string, bool)
type Querier ¶
type Querier interface { sqlbuilder.SqlExpr ExistsTable(table sqlbuilder.Table) bool Apply(patchers ...QuerierPatcher) Querier With(t sqlbuilder.Table, build sqlbuilder.BuildSubQuery, modifiers ...string) Querier AsTemporaryTable(tableName string) TemporaryTable Join(t sqlbuilder.Table, on sqlbuilder.SqlExpr) Querier CrossJoin(t sqlbuilder.Table, on sqlbuilder.SqlExpr) Querier LeftJoin(t sqlbuilder.Table, on sqlbuilder.SqlExpr) Querier RightJoin(t sqlbuilder.Table, on sqlbuilder.SqlExpr) Querier FullJoin(t sqlbuilder.Table, on sqlbuilder.SqlExpr) Querier Where(where sqlbuilder.SqlExpr) Querier WhereAnd(where sqlbuilder.SqlExpr) Querier WhereOr(where sqlbuilder.SqlExpr) Querier OrderBy(orders ...*sqlbuilder.Order) Querier GroupBy(cols ...sqlbuilder.SqlExpr) Querier Having(where sqlbuilder.SqlExpr) Querier Limit(v int64) Querier Offset(v int64) Querier Distinct(extras ...sqlbuilder.SqlExpr) Querier Select(projects ...sqlbuilder.SqlExpr) Querier Scan(v any) Querier Find(ctx context.Context) error Count(ctx context.Context) (int, error) }
func From ¶
func From(from sqlbuilder.Table, fns ...OptionFunc) Querier
type QuerierPatcher ¶
type ScanIterator ¶
type ScanIterator = scanner.ScanIterator
func Recv ¶
func Recv[T any](next func(v *T) error) ScanIterator
type Session ¶
type SoftDeleteValueGetter ¶
type TableWrapper ¶
type TableWrapper interface {
Unwrap() sqlbuilder.Model
}
type TemporaryTable ¶
type TemporaryTable interface { sqlbuilder.Table TableWrapper QuerierPatcher }
Click to show internal directories.
Click to hide internal directories.