Documentation
¶
Index ¶
- Variables
- func Run(from, ext string)
- func WriteCode(w io.Writer, table *Table) error
- type Column
- func (c Column) AltTypeName() string
- func (c Column) BaseTypeName() string
- func (c Column) ExprMultiTypeName() string
- func (c Column) ExprTypeName() string
- func (c Column) ExprValueIdentifier() string
- func (c Column) FieldName() string
- func (c Column) HasUnderlyingType() bool
- func (c Column) IsNullT() bool
- func (c Column) String() string
- func (c Column) TypeName() string
- func (c Column) TypeParameter() string
- type Columns
- type DB
- type Expr
- type ExprBool
- type ExprBytes
- type ExprFloat64
- type ExprInt32
- type ExprInt64
- type ExprInt8
- type ExprMultiBool
- type ExprMultiBytes
- type ExprMultiFloat64
- type ExprMultiInt32
- type ExprMultiInt64
- type ExprMultiInt8
- type ExprMultiMysqlNullTime
- type ExprMultiNullBool
- type ExprMultiNullFloat64
- type ExprMultiNullInt64
- type ExprMultiNullString
- type ExprMultiNullTime
- type ExprMultiString
- type ExprMultiTime
- type ExprMultiUint32
- type ExprMultiUint64
- type ExprMultiUint8
- type ExprMultiValue
- type ExprMysqlNullTime
- type ExprNull
- type ExprNullBool
- type ExprNullFloat64
- type ExprNullInt64
- type ExprNullString
- type ExprNullTime
- type ExprOr
- type ExprString
- type ExprTime
- type ExprUint32
- type ExprUint64
- type ExprUint8
- type ExprValue
- type Operator
- type Order
- type RowAffected
- type Scanner
- type SetMap
- type SetMapIterator
- type SetMapRawValue
- type SetMaps
- type Table
- type Where
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ToPackages = toPackages DeclToTable = declToTable ErrNotTargetDecl = errNotTargetDecl )
Functions ¶
Types ¶
type Column ¶
type Column struct { Field *ast.Field Name string MethodName string PkgName string TableName string IsPk bool // contains filtered or unexported fields }
func (Column) AltTypeName ¶ added in v2.6.0
func (Column) BaseTypeName ¶
func (Column) ExprMultiTypeName ¶ added in v2.14.0
func (Column) ExprTypeName ¶ added in v2.14.0
func (Column) ExprValueIdentifier ¶ added in v2.14.0
func (Column) HasUnderlyingType ¶ added in v2.14.0
func (Column) TypeParameter ¶ added in v2.14.0
type DB ¶
type DB interface { QueryRow(string, ...interface{}) *sql.Row QueryRowContext(context.Context, string, ...interface{}) *sql.Row Query(string, ...interface{}) (*sql.Rows, error) QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error) Exec(string, ...interface{}) (sql.Result, error) ExecContext(context.Context, string, ...interface{}) (sql.Result, error) }
DB is interface like *database/sql.DB
type ExprFloat64 ¶
func (ExprFloat64) ToSql ¶
func (e ExprFloat64) ToSql() (string, []interface{}, error)
type ExprMultiBool ¶
func (ExprMultiBool) ToSql ¶
func (e ExprMultiBool) ToSql() (string, []interface{}, error)
type ExprMultiBytes ¶ added in v2.6.0
func (ExprMultiBytes) ToSql ¶ added in v2.6.0
func (e ExprMultiBytes) ToSql() (string, []interface{}, error)
type ExprMultiFloat64 ¶
func (ExprMultiFloat64) ToSql ¶
func (e ExprMultiFloat64) ToSql() (string, []interface{}, error)
type ExprMultiInt32 ¶
func (ExprMultiInt32) ToSql ¶
func (e ExprMultiInt32) ToSql() (string, []interface{}, error)
type ExprMultiInt64 ¶
func (ExprMultiInt64) ToSql ¶
func (e ExprMultiInt64) ToSql() (string, []interface{}, error)
type ExprMultiInt8 ¶
func (ExprMultiInt8) ToSql ¶
func (e ExprMultiInt8) ToSql() (string, []interface{}, error)
type ExprMultiMysqlNullTime ¶ added in v2.9.0
func (ExprMultiMysqlNullTime) ToSql ¶ added in v2.9.0
func (e ExprMultiMysqlNullTime) ToSql() (string, []interface{}, error)
type ExprMultiNullBool ¶
func (ExprMultiNullBool) ToSql ¶
func (e ExprMultiNullBool) ToSql() (string, []interface{}, error)
type ExprMultiNullFloat64 ¶
type ExprMultiNullFloat64 struct { Column string Values []sql.NullFloat64 Op Operator }
func (ExprMultiNullFloat64) ToSql ¶
func (e ExprMultiNullFloat64) ToSql() (string, []interface{}, error)
type ExprMultiNullInt64 ¶
func (ExprMultiNullInt64) ToSql ¶
func (e ExprMultiNullInt64) ToSql() (string, []interface{}, error)
type ExprMultiNullString ¶
type ExprMultiNullString struct { Column string Values []sql.NullString Op Operator }
func (ExprMultiNullString) ToSql ¶
func (e ExprMultiNullString) ToSql() (string, []interface{}, error)
type ExprMultiNullTime ¶
func (ExprMultiNullTime) ToSql ¶
func (e ExprMultiNullTime) ToSql() (string, []interface{}, error)
type ExprMultiString ¶
func (ExprMultiString) ToSql ¶
func (e ExprMultiString) ToSql() (string, []interface{}, error)
type ExprMultiTime ¶
func (ExprMultiTime) ToSql ¶
func (e ExprMultiTime) ToSql() (string, []interface{}, error)
type ExprMultiUint32 ¶
func (ExprMultiUint32) ToSql ¶
func (e ExprMultiUint32) ToSql() (string, []interface{}, error)
type ExprMultiUint64 ¶
func (ExprMultiUint64) ToSql ¶
func (e ExprMultiUint64) ToSql() (string, []interface{}, error)
type ExprMultiUint8 ¶
func (ExprMultiUint8) ToSql ¶
func (e ExprMultiUint8) ToSql() (string, []interface{}, error)
type ExprMultiValue ¶ added in v2.14.0
func (ExprMultiValue[T]) ToSql ¶ added in v2.14.0
func (e ExprMultiValue[T]) ToSql() (string, []interface{}, error)
type ExprMysqlNullTime ¶ added in v2.9.0
func (ExprMysqlNullTime) ToSql ¶ added in v2.9.0
func (e ExprMysqlNullTime) ToSql() (string, []interface{}, error)
type ExprNullBool ¶
func (ExprNullBool) ToSql ¶
func (e ExprNullBool) ToSql() (string, []interface{}, error)
type ExprNullFloat64 ¶
type ExprNullFloat64 struct { Column string Value sql.NullFloat64 Op Operator }
func (ExprNullFloat64) ToSql ¶
func (e ExprNullFloat64) ToSql() (string, []interface{}, error)
type ExprNullInt64 ¶
func (ExprNullInt64) ToSql ¶
func (e ExprNullInt64) ToSql() (string, []interface{}, error)
type ExprNullString ¶
type ExprNullString struct { Column string Value sql.NullString Op Operator }
func (ExprNullString) ToSql ¶
func (e ExprNullString) ToSql() (string, []interface{}, error)
type ExprNullTime ¶
func (ExprNullTime) ToSql ¶
func (e ExprNullTime) ToSql() (string, []interface{}, error)
type ExprString ¶
func (ExprString) ToSql ¶
func (e ExprString) ToSql() (string, []interface{}, error)
type ExprUint32 ¶
func (ExprUint32) ToSql ¶
func (e ExprUint32) ToSql() (string, []interface{}, error)
type ExprUint64 ¶
func (ExprUint64) ToSql ¶
func (e ExprUint64) ToSql() (string, []interface{}, error)
type Operator ¶
type Operator string
var ( OpEqual Operator = "=" // Operator for equal. Column(value, sqlla.OpEqual) same as Column = value OpGreater Operator = ">" // Operator for greater. Column(value, sqlla.OpGreater) same as Column > value OpGreaterEqual Operator = ">=" // Operator for greater equal. Column(value, sqlla.OpGreaterEqual) same as Column >= value OpLess Operator = "<" // Operator for less. Column(value, sqlla.OpLess) same as Column < value OpLessEqual Operator = "<=" // Operator for less equal. Column(value, sqlla.OpLessEqual) same as Column <= value OpNot Operator = "<>" // Operator for not equal. Column(value, sqlla.OpNot) same as Column <> value OpIs Operator = "IS" // Operator for is. Column(value, sqlla.OpIs) same as Column IS value OpLike Operator = "LIKE" // Operator for like. Column(value, sqlla.OpLike) same as Column LIKE value )
func MakeInOperator ¶
type RowAffected ¶
type RowAffected int64
RowAffected is result of upsert
const ( RowAffectedNoupdated RowAffected = iota RowAffectedInserted RowAffectedUpdated )
RowAffected results
type Scanner ¶
type Scanner interface {
Scan(...interface{}) error
}
Scanner is interface like *database/sql.Row
type SetMap ¶
type SetMap map[string]interface{}
func (SetMap) NewIterator ¶ added in v2.7.0
func (sm SetMap) NewIterator() *SetMapIterator
func (SetMap) ToInsertColumnsAndValues ¶ added in v2.7.0
func (SetMap) ToInsertSql ¶
func (SetMap) ToUpdateSql ¶
type SetMapIterator ¶ added in v2.7.0
type SetMapIterator struct {
// contains filtered or unexported fields
}
func (*SetMapIterator) Iterate ¶ added in v2.7.0
func (s *SetMapIterator) Iterate() bool
func (*SetMapIterator) Key ¶ added in v2.7.0
func (s *SetMapIterator) Key() string
func (*SetMapIterator) Value ¶ added in v2.7.0
func (s *SetMapIterator) Value() interface{}
type SetMapRawValue ¶ added in v2.7.0
type SetMapRawValue string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.