Documentation ¶
Overview ¶
Package sqlite implements gdb.Driver, which supports operations for database SQLite.
Index ¶
- func New() gdb.Driver
- type Driver
- func (d *Driver) DoFilter(ctx context.Context, link gdb.Link, sql string, args []interface{}) (newSql string, newArgs []interface{}, err error)
- func (d *Driver) FormatUpsert(columns []string, list gdb.List, option gdb.DoInsertOption) (string, error)
- func (d *Driver) GetChars() (charLeft string, charRight string)
- func (d *Driver) New(core *gdb.Core, node *gdb.ConfigNode) (gdb.DB, error)
- func (d *Driver) Open(config *gdb.ConfigNode) (db *sql.DB, err error)
- func (d *Driver) OrderRandomFunction() string
- func (d *Driver) TableFields(ctx context.Context, table string, schema ...string) (fields map[string]*gdb.TableField, err error)
- func (d *Driver) Tables(ctx context.Context, schema ...string) (tables []string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Driver ¶
Driver is the driver for sqlite database.
func (*Driver) DoFilter ¶
func (d *Driver) DoFilter( ctx context.Context, link gdb.Link, sql string, args []interface{}, ) (newSql string, newArgs []interface{}, err error)
DoFilter deals with the sql string before commits it to underlying sql driver.
func (*Driver) FormatUpsert ¶ added in v2.6.4
func (d *Driver) FormatUpsert(columns []string, list gdb.List, option gdb.DoInsertOption) (string, error)
FormatUpsert returns SQL clause of type upsert for SQLite. For example: ON CONFLICT (id) DO UPDATE SET ...
func (*Driver) New ¶
New creates and returns a database object for sqlite. It implements the interface of gdb.Driver for extra database driver installation.
func (*Driver) Open ¶
Open creates and returns an underlying sql.DB object for sqlite. https://github.com/glebarez/go-sqlite
func (*Driver) OrderRandomFunction ¶ added in v2.7.4
OrderRandomFunction returns the SQL function for random ordering.
Click to show internal directories.
Click to hide internal directories.