Documentation
¶
Overview ¶
Package sqlite3 provides a high level interface for sqlite3, including pooled connections object serialization and transactions
Index ¶
- func IsComplete(v string) bool
- func Version() string
- type Conn
- func (conn *Conn) Close() error
- func (c *Conn) ColumnsForIndex(schema, index string) []string
- func (c *Conn) ColumnsForTable(schema, table string) []SQColumn
- func (conn *Conn) Do(ctx context.Context, flag SQTxnFlag, fn func(SQTransaction) error) error
- func (conn *Conn) Exec(st SQStatement, fn ExecFunc) error
- func (c *Conn) Filename(schema string) string
- func (this *Conn) ForeignKeyConstraints() (bool, error)
- func (c *Conn) IndexesForTable(schema, table string) []SQIndexView
- func (c *Conn) Modules(prefix ...string) []string
- func (c *Conn) Schemas() []string
- func (this *Conn) SetForeignKeyConstraints(enable bool) error
- func (c *Conn) Tables(schema string) []string
- func (c *Conn) Views(schema string) []string
- type ExecFunc
- type KeywordToken
- type NameToken
- type Pool
- type PoolCache
- type PoolConfig
- type PuncuationToken
- type Tokenizer
- type Txn
- type TxnFunc
- type TypeToken
- type ValueToken
- type WhitespaceToken
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsComplete ¶
Types ¶
type Conn ¶
func (*Conn) ColumnsForIndex ¶
ColumnsForIndex returns the indexes associated with a table
func (*Conn) ColumnsForTable ¶
ColumnsForTable returns the columns in a table
func (*Conn) Exec ¶
Execute SQL statement without preparing, and invoke a callback for each row of results which may return true to abort
func (*Conn) ForeignKeyConstraints ¶
func (*Conn) IndexesForTable ¶
IndexesForTable returns the indexes associated with a table
func (*Conn) Modules ¶
Modules returns a list of modules in a schema. If an argument is provided, then only modules with those name prefixes are returned.
func (*Conn) SetForeignKeyConstraints ¶
type KeywordToken ¶
type KeywordToken string
type Pool ¶
type Pool struct {
sync.WaitGroup
sync.Pool
PoolConfig
PoolCache
// contains filtered or unexported fields
}
Pool is a connection pool object
func NewPool ¶
NewPool returns a new default pool with a shared cache and maxiumum pool size of 5 connections. If filename is not empty, this database is opened or else memory is used. Pass a channel to receive errors, or nil to ignore
func OpenPool ¶
func OpenPool(config PoolConfig, errs chan<- error) (*Pool, error)
OpenPool returns a new pool with the specified configuration
func (*Pool) Get ¶
Get a connection from the pool, and return it to the pool when the context is cancelled or it is put back using the Put method. If there are no connections available, nil is returned.
type PoolCache ¶
type PoolCache struct {
}
PoolCache caches prepared statements and profiling information for statements so it's possible to see slow queries, etc.
type PoolConfig ¶
type PoolConfig struct {
Max int64 `yaml:"max"` // The maximum number of connections in the pool
Schemas map[string]string `yaml:"databases"` // Schema names mapped onto path for database file
Trace bool `yaml:"trace"` // Profiling for statements
Create bool `yaml:"create"` // When false, do not allow creation of new file-based databases
Auth SQAuth // Authentication and Authorization interface
Flags sqlite3.OpenFlags // Flags for opening connections
}
PoolConfig is the starting configuration for a pool
type PuncuationToken ¶
type PuncuationToken string
type Tokenizer ¶
func NewTokenizer ¶
type ValueToken ¶
type ValueToken string
type WhitespaceToken ¶
type WhitespaceToken string