data

package
v0.0.0-...-ef8ae41 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDataService

func CreateDataService() apid.DataService

func DBPath

func DBPath(id string) string

func Delete

func Delete(versionedID string) interface{}

func StructsFromRows

func StructsFromRows(dest interface{}, rows *sql.Rows) error

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

func VersionedDBID(id, version string) string

Types

type ApidDb

type ApidDb struct {
	// contains filtered or unexported fields
}

func (*ApidDb) Begin

func (d *ApidDb) Begin() (apid.Tx, error)

func (*ApidDb) Exec

func (d *ApidDb) Exec(query string, args ...interface{}) (sql.Result, error)

func (*ApidDb) Ping

func (d *ApidDb) Ping() error

func (*ApidDb) Prepare

func (d *ApidDb) Prepare(query string) (*sql.Stmt, error)

func (*ApidDb) Query

func (d *ApidDb) Query(query string, args ...interface{}) (*sql.Rows, error)

func (*ApidDb) QueryRow

func (d *ApidDb) QueryRow(query string, args ...interface{}) *sql.Row

func (*ApidDb) QueryStructs

func (d *ApidDb) QueryStructs(dest interface{}, query string, args ...interface{}) error

func (*ApidDb) SetConnMaxLifetime

func (d *ApidDb) SetConnMaxLifetime(du time.Duration)

func (*ApidDb) SetMaxIdleConns

func (d *ApidDb) SetMaxIdleConns(n int)

func (*ApidDb) SetMaxOpenConns

func (d *ApidDb) SetMaxOpenConns(n int)

func (*ApidDb) Stats

func (d *ApidDb) Stats() sql.DBStats

type Tx

type Tx struct {
	// contains filtered or unexported fields
}

func (*Tx) Commit

func (tx *Tx) Commit() error

func (*Tx) Exec

func (tx *Tx) Exec(query string, args ...interface{}) (sql.Result, error)

func (*Tx) ExecContext

func (tx *Tx) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)

func (*Tx) Prepare

func (tx *Tx) Prepare(query string) (*sql.Stmt, error)

func (*Tx) PrepareContext

func (tx *Tx) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error)

func (*Tx) Query

func (tx *Tx) Query(query string, args ...interface{}) (*sql.Rows, error)

func (*Tx) QueryContext

func (tx *Tx) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)

func (*Tx) QueryRow

func (tx *Tx) QueryRow(query string, args ...interface{}) *sql.Row

func (*Tx) QueryRowContext

func (tx *Tx) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row

func (*Tx) QueryStructs

func (tx *Tx) QueryStructs(dest interface{}, query string, args ...interface{}) error

func (*Tx) Rollback

func (tx *Tx) Rollback() error

func (*Tx) Stmt

func (tx *Tx) Stmt(stmt *sql.Stmt) *sql.Stmt

func (*Tx) StmtContext

func (tx *Tx) StmtContext(ctx context.Context, stmt *sql.Stmt) *sql.Stmt

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL