mysql

package
v4.3.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2025 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

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

func (f *Factory) BuildCreateTable(table string, modelType reflect.Type) string

BuildCreateTable builds a CREATE TABLE query for MySQL

func (*Factory) BuildDelete

func (f *Factory) BuildDelete(table string, conditions []*define.Condition) (string, []interface{})

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

func (f *Factory) BuildOrderBy(orders []define.OrderBy) string

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) Connect

func (f *Factory) Connect(dsn string) (*sql.DB, error)

func (Factory) GetColumns added in v4.2.8

func (m Factory) GetColumns(tableName string, db *sql.DB) ([]define.Column, error)

func (*Factory) GetTableInfo

func (f *Factory) GetTableInfo(db *sql.DB, tableName string) (*define.TableInfo, error)

GetTableInfo retrieves table information from MySQL

func (*Factory) GetTables

func (f *Factory) GetTables(db *sql.DB, pattern string) ([]string, error)

GetTables 获取符合模式的所有表

func (*Factory) GetType added in v4.1.5

func (f *Factory) GetType() string

GetType returns the database type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL