Documentation ¶
Overview ¶
Package sqlite implements gdb.Driver, which supports operations for database SQLite.
Note: 1. It needs manually import: _ "github.com/glebarez/go-sqlite" 2. It does not support Save/Replace features.
Index ¶
- func New() gdb.Driver
- func NewSqlite() cooldb.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) DoInsert(ctx context.Context, link gdb.Link, table string, list gdb.List, ...) (result sql.Result, err 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) 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)
- type DriverSqlite
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Driver ¶ added in v0.0.25
Driver is the driver for sqlite database.
func (*Driver) DoFilter ¶ added in v0.0.25
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) DoInsert ¶ added in v0.0.25
func (d *Driver) DoInsert( ctx context.Context, link gdb.Link, table string, list gdb.List, option gdb.DoInsertOption, ) (result sql.Result, err error)
DoInsert is not supported in sqlite.
func (*Driver) GetChars ¶ added in v0.0.25
GetChars returns the security char for this type of database.
func (*Driver) New ¶ added in v0.0.25
New creates and returns a database object for sqlite. It implements the interface of gdb.Driver for extra database driver installation.
func (*Driver) Open ¶ added in v0.0.25
Open creates and returns a underlying sql.DB object for sqlite. https://github.com/glebarez/go-sqlite
func (*Driver) TableFields ¶ added in v0.0.25
func (d *Driver) TableFields( ctx context.Context, table string, schema ...string, ) (fields map[string]*gdb.TableField, err error)
TableFields retrieves and returns the fields' information of specified table of current schema.
Also see DriverMysql.TableFields.
type DriverSqlite ¶
type DriverSqlite struct { }
func (*DriverSqlite) GetConn ¶
func (d *DriverSqlite) GetConn(config *gdb.ConfigNode) (db *gorm.DB, err error)