Documentation ¶
Index ¶
- func CreateDataService() apid.DataService
- func DBPath(id string) string
- func Delete(versionedID string) interface{}
- func StructsFromRows(dest interface{}, rows *sql.Rows) error
- func VersionedDBID(id, version string) string
- type ApidDb
- func (d *ApidDb) Begin() (apid.Tx, error)
- func (d *ApidDb) Exec(query string, args ...interface{}) (sql.Result, error)
- func (d *ApidDb) Ping() error
- func (d *ApidDb) Prepare(query string) (*sql.Stmt, error)
- func (d *ApidDb) Query(query string, args ...interface{}) (*sql.Rows, error)
- func (d *ApidDb) QueryRow(query string, args ...interface{}) *sql.Row
- func (d *ApidDb) QueryStructs(dest interface{}, query string, args ...interface{}) error
- func (d *ApidDb) SetConnMaxLifetime(du time.Duration)
- func (d *ApidDb) SetMaxIdleConns(n int)
- func (d *ApidDb) SetMaxOpenConns(n int)
- func (d *ApidDb) Stats() sql.DBStats
- type Tx
- func (tx *Tx) Commit() error
- func (tx *Tx) Exec(query string, args ...interface{}) (sql.Result, error)
- func (tx *Tx) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (tx *Tx) Prepare(query string) (*sql.Stmt, error)
- func (tx *Tx) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error)
- func (tx *Tx) Query(query string, args ...interface{}) (*sql.Rows, error)
- func (tx *Tx) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func (tx *Tx) QueryRow(query string, args ...interface{}) *sql.Row
- func (tx *Tx) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
- func (tx *Tx) QueryStructs(dest interface{}, query string, args ...interface{}) error
- func (tx *Tx) Rollback() error
- func (tx *Tx) Stmt(stmt *sql.Stmt) *sql.Stmt
- func (tx *Tx) StmtContext(ctx context.Context, stmt *sql.Stmt) *sql.Stmt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDataService ¶
func CreateDataService() apid.DataService
func StructsFromRows ¶
StructsFromRows fill the dest slice with the values of according rows. Each row is marshaled into a struct. The "db" tag in the struct is used for field mapping. It will take care of null value. Supported type mappings from Sqlite3 to Go are: text->string; integer->int/int64/sql.NullInt64; float->float/float64/sql.NullFloat64; blob->[]byte/string/sql.NullString
func VersionedDBID ¶
Types ¶
type ApidDb ¶
type ApidDb struct {
// contains filtered or unexported fields
}
func (*ApidDb) QueryStructs ¶
func (*ApidDb) SetConnMaxLifetime ¶
func (*ApidDb) SetMaxIdleConns ¶
func (*ApidDb) SetMaxOpenConns ¶
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
func (*Tx) ExecContext ¶
func (*Tx) PrepareContext ¶
func (*Tx) QueryContext ¶
func (*Tx) QueryRowContext ¶
func (*Tx) QueryStructs ¶
Click to show internal directories.
Click to hide internal directories.