Documentation
¶
Index ¶
- func RegisterFactory()
- type Factory
- func (f *Factory) BuildBatchInsert(table string, values []map[string]interface{}) (string, []interface{})
- func (f *Factory) BuildCreateTable(table string, modelType reflect.Type) string
- func (f *Factory) BuildDelete(table string, conditions []*define.Condition) (string, []interface{})
- func (f *Factory) BuildInsert(table string, fields map[string]interface{}, fieldOrder []string) (string, []interface{})
- func (f *Factory) BuildOrderBy(orders []define.OrderBy) string
- func (f *Factory) BuildSelect(table string, fields []string, conditions []*define.Condition, orderBy string, ...) (string, []interface{})
- func (f *Factory) BuildUpdate(table string, fields map[string]interface{}, fieldOrder []string, ...) (string, []interface{})
- func (f *Factory) Connect(dsn string) (*sql.DB, error)
- func (m Factory) GetColumns(tableName string, db *sql.DB) ([]define.Column, error)
- func (f *Factory) GetTableInfo(db *sql.DB, tableName string) (*define.TableInfo, error)
- func (f *Factory) GetTables(db *sql.DB, pattern string) ([]string, error)
- func (f *Factory) GetType() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterFactory ¶
func RegisterFactory()
Types ¶
type Factory ¶
type Factory struct{}
Factory represents a MySQL query builder
func (*Factory) BuildBatchInsert ¶
func (f *Factory) BuildBatchInsert(table string, values []map[string]interface{}) (string, []interface{})
BuildBatchInsert builds a batch INSERT query for MySQL
func (*Factory) BuildCreateTable ¶
BuildCreateTable builds a CREATE TABLE query for MySQL
func (*Factory) BuildDelete ¶
BuildDelete builds a DELETE query for MySQL
func (*Factory) BuildInsert ¶
func (f *Factory) BuildInsert(table string, fields map[string]interface{}, fieldOrder []string) (string, []interface{})
BuildInsert builds an INSERT query for MySQL
func (*Factory) BuildOrderBy ¶ added in v4.1.3
BuildOrderBy builds the ORDER BY clause for MySQL
func (*Factory) BuildSelect ¶
func (f *Factory) BuildSelect(table string, fields []string, conditions []*define.Condition, orderBy string, limit, offset int) (string, []interface{})
BuildSelect builds a SELECT query for MySQL
func (*Factory) BuildUpdate ¶
func (f *Factory) BuildUpdate(table string, fields map[string]interface{}, fieldOrder []string, conditions []*define.Condition) (string, []interface{})
BuildUpdate builds an UPDATE query for MySQL
func (Factory) GetColumns ¶ added in v4.2.8
func (*Factory) GetTableInfo ¶
GetTableInfo retrieves table information from MySQL
Click to show internal directories.
Click to hide internal directories.