Documentation ¶
Index ¶
- func AddIndex(indexName, tableName string, unique bool, cols ...string) (sql string, args []any)
- func Delete(table string, condition condition.Condition) (sql string, args []any)
- func DropIndex(indexName string) (sql string, args []any)
- func Flag2Generator(f *basis.Flag) (basis.Generator, error)
- func Insert(table string, columns basis.Columns, rows []basis.Row, ignore bool) (sql string, args []any)
- func Pragma(key string, values ...any) (sql string, args []any)
- func Replace(table string, columns basis.Columns, rows []basis.Row) (sql string, args []any)
- func ShowIndexs(tableName string) (sql string, args []any)
- func Update(table, setters string, condition condition.Condition) (sql string, args []any)
- type Db
- func (db *Db) FetchColumns(table string) (columns []basis.Column, err error)
- func (db *Db) LoadTableSchema(table string) (t *basis.Table, err error)
- func (db *Db) Options() Options
- func (db *Db) ShowCreateTable(table string) (tableSql string, err error)
- func (db *Db) ShowTables(pattern string) (tables []string, err error)
- type Options
- type Query
- func (q *Query) Avg(field string) (sql string, args []any)
- func (q *Query) Close()
- func (q *Query) Count(field string) (sql string, args []any)
- func (q *Query) From(table string) basis.Query
- func (q *Query) Group(fields ...string) basis.Query
- func (q *Query) HasFrom() bool
- func (q *Query) Having(having string) basis.Query
- func (q *Query) IndexBy(indexName string) *Query
- func (q *Query) Limit(limit int64) basis.Query
- func (q *Query) Max(field string) (sql string, args []any)
- func (q *Query) Min(field string) (sql string, args []any)
- func (q *Query) Offset(offset int64) basis.Query
- func (q *Query) Order(orders ...string) basis.Query
- func (q *Query) Select(columns ...string) basis.Query
- func (q *Query) Sql() (sql string, args []any)
- func (q *Query) Sum(field string) (sql string, args []any)
- func (q *Query) Where(condition condition.Condition) basis.Query
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ShowIndexs ¶
Types ¶
type Options ¶
type Options struct { DbName string `json:"dbName" yaml:"dbName"` MaxIdleConns int `json:"maxIdleConns" yaml:"maxIdleConns"` MaxOpenConns int `json:"maxOpenConns" yaml:"maxOpenConns"` ConnMaxIdleTimeSecond int64 `json:"connMaxIdleTimeSecond" yaml:"connMaxIdleTimeSecond"` ConnMaxLifetimeSecond int64 `json:"connMaxLifetimeSecond" yaml:"connMaxLifetimeSecond"` }
func DefaultOption ¶
func DefaultOption() Options
func Flag2Options ¶
func OptionsWithJson ¶
func OptionsWithYaml ¶
func (*Options) ConnMaxIdleTime ¶
func (*Options) ConnMaxLifetime ¶
Click to show internal directories.
Click to hide internal directories.