Documentation ¶
Index ¶
- Variables
- type Conn
- func (c *Conn) Begin() (driver.Tx, error)
- func (c *Conn) Close() error
- func (c *Conn) Exec(query string, args []driver.Value) (driver.Result, error)
- func (c *Conn) Prepare(query string) (driver.Stmt, error)
- func (c *Conn) PrepareContext(ctx context.Context, query string) (driver.Stmt, error)
- func (c *Conn) Query(query string, args []driver.Value) (driver.Rows, error)
- type Driver
- type ExecerQueryer
- type ExecerQueryerPreparer
- type JSONType
- type SQLDialect
- type Stmt
Constants ¶
This section is empty.
Variables ¶
View Source
var ( InsertJSONStatementHeads = []string{"INSERT INTO", "Insert Into", "insert into"} InsertJSONStatementRegex = regexp.MustCompile(`^(INSERT INTO|Insert Into|insert into)\s*(?P<TABLE>[\w\d\_]+)\s*(JSON|Json|json)\s*(?P<JSON>.*)\s*(\;*)$`) )
View Source
var (
ErrFailedToParseString = errors.New("failed to parse string")
)
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) PrepareContext ¶
type Driver ¶
type Driver struct { SQL SQLDialect // contains filtered or unexported fields }
func WrapDriver ¶
func WrapDriver(baseDriver driver.Driver, sql SQLDialect) *Driver
type ExecerQueryerPreparer ¶
type ExecerQueryerPreparer interface { ExecerQueryer Prepare(query string) (driver.Stmt, error) }
type SQLDialect ¶
type SQLDialect interface { GetAllTableNames(x ExecerQueryer) ([]string, error) GetAllTableColumns(tableName string, x ExecerQueryer) (map[string]string, error) CreateNewTable(table string, keys []string, types []JSONType, x ExecerQueryer) error AddColumnToTable(table, key string, t JSONType, x ExecerQueryer) error InsertValuesPrepare(table string, keys []string, x ExecerQueryerPreparer) (driver.Stmt, error) }
Click to show internal directories.
Click to hide internal directories.