db

package
v0.0.0-...-7d0679b Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

DB is the SQL database.

func New

func New(dbPath string) *DB

New creates a new database. Deletes any existing database.

func Open

func Open(dbPath string) *DB

Open an existing database, creating it if it does not exist.

func (*DB) Close

func (db *DB) Close() error

Close closes the underlying database connection.

func (*DB) CommitTransaction

func (db *DB) CommitTransaction() error

CommitTransaction commits all changes made since StartTraction was called.

func (*DB) Execute

func (db *DB) Execute(stmt string) error

Execute executes the given sqlite statement, of a type that doesn't return rows.

func (*DB) Query

func (db *DB) Query(query string) (RowResults, error)

Query runs the supplied query against the sqlite database. It returns a slice of RowResults.

func (*DB) RollbackTransaction

func (db *DB) RollbackTransaction() error

RollbackTransaction aborts the transaction. No statement issued since StartTransaction was called will take effect.

func (*DB) StartTransaction

func (db *DB) StartTransaction() error

StartTransaction starts an explicit transaction.

type RowResult

type RowResult map[string]string

RowResult is the result type.

type RowResults

type RowResults []map[string]string

RowResults is the list of results.

Jump to

Keyboard shortcuts

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