go-admin: github.com/GoAdminGroup/go-admin/modules/db/dialect Index | Files

package dialect

import "github.com/GoAdminGroup/go-admin/modules/db/dialect"


Package Files

common.go dialect.go mssql.go mysql.go postgresql.go sqlite.go

type Dialect Uses

type Dialect interface {
    // GetName get dialect's name
    GetName() string

    // ShowColumns show columns of specified table
    ShowColumns(table string) string

    // ShowTables show tables of database
    ShowTables() string

    // Insert
    Insert(comp *SQLComponent) string

    // Delete
    Delete(comp *SQLComponent) string

    // Update
    Update(comp *SQLComponent) string

    // Select
    Select(comp *SQLComponent) string

    // GetDelimiter return the delimiter of Dialect.
    GetDelimiter() string

Dialect is methods set of different driver.

func GetDialect Uses

func GetDialect() Dialect

GetDialect return the default Dialect.

func GetDialectByDriver Uses

func GetDialectByDriver(driver string) Dialect

GetDialectByDriver return the Dialect of given driver.

type H Uses

type H map[string]interface{}

H is a shorthand of map.

type Join Uses

type Join struct {
    Table     string
    FieldA    string
    Operation string
    FieldB    string

Join contains the table and field and operation.

type RawUpdate Uses

type RawUpdate struct {
    Expression string
    Args       []interface{}

RawUpdate contains the expression and arguments.

type SQLComponent Uses

type SQLComponent struct {
    Fields     []string
    Functions  []string
    TableName  string
    Wheres     []Where
    Leftjoins  []Join
    Args       []interface{}
    Order      string
    Offset     string
    Limit      string
    WhereRaws  string
    UpdateRaws []RawUpdate
    Group      string
    Statement  string
    Values     H

SQLComponent is a sql components set.

type Where Uses

type Where struct {
    Operation string
    Field     string
    Qmark     string

Where contains the operation and field.

Package dialect imports 3 packages (graph) and is imported by 11 packages. Updated 2020-08-01. Refresh now. Tools for package owners.