Documentation ¶
Index ¶
- Constants
- Variables
- func Close(db *gorm.DB) (err error)
- func Open(enforceFKs bool) (db *gorm.DB, err error)
- type Conn
- func (c *Conn) Begin() (tx driver.Tx, err error)
- func (c *Conn) BeginTx(ctx context.Context, opts driver.TxOptions) (tx driver.Tx, err error)
- func (c *Conn) Close() (err error)
- func (c *Conn) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (r driver.Result, err error)
- func (c *Conn) IsValid() (b bool)
- func (c *Conn) Ping(ctx context.Context) (err error)
- func (c *Conn) Prepare(query string) (stmt driver.Stmt, err error)
- func (c *Conn) PrepareContext(ctx context.Context, query string) (stmt driver.Stmt, err error)
- func (c *Conn) QueryContext(ctx context.Context, query string, args []driver.NamedValue) (r driver.Rows, err error)
- func (c *Conn) ResetSession(ctx context.Context) (err error)
- type Driver
- type PkSequence
- type Stmt
- func (s *Stmt) Close() (err error)
- func (s *Stmt) Exec(args []driver.Value) (r driver.Result, err error)
- func (s *Stmt) ExecContext(ctx context.Context, args []driver.NamedValue) (r driver.Result, err error)
- func (s *Stmt) NumInput() (n int)
- func (s *Stmt) Query(args []driver.Value) (r driver.Rows, err error)
- func (s *Stmt) QueryContext(ctx context.Context, args []driver.NamedValue) (r driver.Rows, err error)
- type Tx
Constants ¶
View Source
const ( ConnectionString = "file:%s?_journal=WAL" FKsOn = "&_foreign_keys=yes" FKsOff = "&_foreign_keys=no" )
Variables ¶
View Source
var Settings = &settings.Settings
Functions ¶
Types ¶
type Conn ¶ added in v0.6.0
type Conn struct {
// contains filtered or unexported fields
}
Conn is a DB connection.
func (*Conn) ExecContext ¶ added in v0.6.0
func (c *Conn) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (r driver.Result, err error)
ExecContext executes an SQL/DDL statement with context.
func (*Conn) IsValid ¶ added in v0.6.0
IsValid returns true when the connection is valid. When true, the connection may be reused by the sql package.
func (*Conn) PrepareContext ¶ added in v0.6.0
PrepareContext prepares a statement with context.
type Driver ¶ added in v0.6.0
type Driver struct {
// contains filtered or unexported fields
}
Driver is a wrapper around the SQLite driver. The purpose is to prevent database locked errors using a mutex around write operations.
type PkSequence ¶ added in v0.6.0
type PkSequence struct {
// contains filtered or unexported fields
}
PkSequence provides a primary key sequence.
var PK PkSequence
PK singleton pk sequence.
type Stmt ¶ added in v0.6.0
type Stmt struct {
// contains filtered or unexported fields
}
Stmt is a SQL/DDL statement.
func (*Stmt) ExecContext ¶ added in v0.6.0
func (s *Stmt) ExecContext(ctx context.Context, args []driver.NamedValue) (r driver.Result, err error)
ExecContext executes the statement with context.
func (*Stmt) QueryContext ¶ added in v0.6.0
func (s *Stmt) QueryContext(ctx context.Context, args []driver.NamedValue) (r driver.Rows, err error)
QueryContext executes a query.
Click to show internal directories.
Click to hide internal directories.