Documentation ¶
Index ¶
- type BuildSqlOptions
- type Column
- type Connection
- type DB
- type ErrNotFoundColumn
- type ErrNotFoundTable
- type ErrWrongArgsLen
- type FncEachRow
- type Index
- type NumberColumn
- func (s *NumberColumn) BasicType() types.BasicKind
- func (s *NumberColumn) BasicTypeInfo() types.BasicInfo
- func (s *NumberColumn) CharacterMaximumLength() int
- func (s *NumberColumn) CheckAttr(fieldDefine string) string
- func (s *NumberColumn) Comment() string
- func (s *NumberColumn) Name() string
- func (s *NumberColumn) Required() bool
- func (c *NumberColumn) SetNullable(f bool)
- func (s *NumberColumn) Type() string
- type ParserTableDDL
- type Routine
- type RowScanner
- type SQLBuilder
- type StringColumn
- func (s *StringColumn) BasicType() types.BasicKind
- func (s *StringColumn) BasicTypeInfo() types.BasicInfo
- func (s *StringColumn) CharacterMaximumLength() int
- func (s *StringColumn) CheckAttr(fieldDefine string) string
- func (s *StringColumn) Comment() string
- func (s *StringColumn) Name() string
- func (s *StringColumn) Required() bool
- func (c *StringColumn) SetNullable(f bool)
- func (s *StringColumn) Type() string
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildSqlOptions ¶ added in v1.0.303
type BuildSqlOptions func(b *SQLBuilder) error
func ArgsForSelect ¶ added in v1.0.303
func ArgsForSelect(args ...interface{}) BuildSqlOptions
func ColumnsForSelect ¶ added in v1.0.303
func ColumnsForSelect(columns ...string) BuildSqlOptions
func WhereForSelect ¶ added in v1.0.303
func WhereForSelect(columns ...string) BuildSqlOptions
type Column ¶
type Column interface { BasicType() types.BasicKind BasicTypeInfo() types.BasicInfo CheckAttr(fieldDefine string) string CharacterMaximumLength() int Comment() string Name() string Type() string Required() bool SetNullable(bool) }
func SimpleColumns ¶ added in v1.0.296
type Connection ¶ added in v1.0.301
type DB ¶
type ErrNotFoundColumn ¶ added in v1.0.303
ErrNotFoundColumn if not found in table {Table} field by name {Column}
func NewErrNotFoundColumn ¶ added in v1.0.303
func NewErrNotFoundColumn(table string, column string) *ErrNotFoundColumn
func (ErrNotFoundColumn) Error ¶ added in v1.0.303
func (err ErrNotFoundColumn) Error() string
type ErrNotFoundTable ¶ added in v1.0.301
type ErrNotFoundTable struct {
Table string
}
ErrNotFoundTable if not found table by name {Table}
func (ErrNotFoundTable) Error ¶ added in v1.0.301
func (err ErrNotFoundTable) Error() string
type ErrWrongArgsLen ¶ added in v1.0.303
ErrNotFoundColumn if not found in table {Table} field by name {Column}
func NewErrWrongArgsLen ¶ added in v1.0.303
func NewErrWrongArgsLen(table string, column []string, args []interface{}) *ErrWrongArgsLen
func (ErrWrongArgsLen) Error ¶ added in v1.0.303
func (err ErrWrongArgsLen) Error() string
type FncEachRow ¶ added in v1.0.303
type NumberColumn ¶ added in v1.0.296
type NumberColumn struct { IsNullable bool // contains filtered or unexported fields }
func NewNumberColumn ¶ added in v1.0.296
func NewNumberColumn(name, comment string, req bool) *NumberColumn
func (*NumberColumn) BasicType ¶ added in v1.0.301
func (s *NumberColumn) BasicType() types.BasicKind
func (*NumberColumn) BasicTypeInfo ¶ added in v1.0.301
func (s *NumberColumn) BasicTypeInfo() types.BasicInfo
func (*NumberColumn) CharacterMaximumLength ¶ added in v1.0.296
func (s *NumberColumn) CharacterMaximumLength() int
func (*NumberColumn) CheckAttr ¶ added in v1.0.301
func (s *NumberColumn) CheckAttr(fieldDefine string) string
func (*NumberColumn) Comment ¶ added in v1.0.296
func (s *NumberColumn) Comment() string
func (*NumberColumn) Name ¶ added in v1.0.296
func (s *NumberColumn) Name() string
func (*NumberColumn) Required ¶ added in v1.0.296
func (s *NumberColumn) Required() bool
func (*NumberColumn) SetNullable ¶ added in v1.0.301
func (c *NumberColumn) SetNullable(f bool)
func (*NumberColumn) Type ¶ added in v1.0.296
func (s *NumberColumn) Type() string
type ParserTableDDL ¶ added in v1.0.301
func NewtableParser ¶ added in v1.0.301
func NewtableParser(table Table, db *DB) ParserTableDDL
func (ParserTableDDL) Parse ¶ added in v1.0.301
func (p ParserTableDDL) Parse(ddl string) error
type RowScanner ¶
type RowScanner interface {
GetFields([]Column) []interface{}
}
type SQLBuilder ¶ added in v1.0.303
type SQLBuilder struct { Args []interface{} Table Table SelectColumns []Column // contains filtered or unexported fields }
func (SQLBuilder) InsertSql ¶ added in v1.0.304
func (b SQLBuilder) InsertSql() (string, error)
func (SQLBuilder) Select ¶ added in v1.0.303
func (b SQLBuilder) Select() string
func (SQLBuilder) SelectSql ¶ added in v1.0.304
func (b SQLBuilder) SelectSql() (string, error)
func (SQLBuilder) Set ¶ added in v1.0.314
func (b SQLBuilder) Set() string
func (SQLBuilder) UpdateSql ¶ added in v1.0.314
func (b SQLBuilder) UpdateSql() (string, error)
func (SQLBuilder) Where ¶ added in v1.0.303
func (b SQLBuilder) Where() string
type StringColumn ¶
type StringColumn struct { IsNullable bool // contains filtered or unexported fields }
func NewStringColumn ¶
func NewStringColumn(name, comment string, req bool) *StringColumn
func (*StringColumn) BasicType ¶ added in v1.0.301
func (s *StringColumn) BasicType() types.BasicKind
func (*StringColumn) BasicTypeInfo ¶ added in v1.0.301
func (s *StringColumn) BasicTypeInfo() types.BasicInfo
func (*StringColumn) CharacterMaximumLength ¶
func (s *StringColumn) CharacterMaximumLength() int
func (*StringColumn) CheckAttr ¶ added in v1.0.301
func (s *StringColumn) CheckAttr(fieldDefine string) string
func (*StringColumn) Comment ¶ added in v1.0.296
func (s *StringColumn) Comment() string
func (*StringColumn) Name ¶
func (s *StringColumn) Name() string
func (*StringColumn) Required ¶ added in v1.0.296
func (s *StringColumn) Required() bool
func (*StringColumn) SetNullable ¶ added in v1.0.301
func (c *StringColumn) SetNullable(f bool)
func (*StringColumn) Type ¶ added in v1.0.296
func (s *StringColumn) Type() string
type Table ¶
type Table interface { Columns() []Column FindColumn(name string) Column FindIndex(name string) *Index GetColumns(ctx context.Context) error Insert(ctx context.Context, Options ...BuildSqlOptions) error Update(ctx context.Context, Options ...BuildSqlOptions) error Name() string RereadColumn(name string) Column Select(ctx context.Context, args ...interface{}) SelectAndScanEach(ctx context.Context, each func() error, rowValue RowScanner, Options ...BuildSqlOptions) error SelectAndRunEach(ctx context.Context, each FncEachRow, Options ...BuildSqlOptions) error }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.