Documentation
¶
Index ¶
Constants ¶
View Source
const ErrClosed = errorstr("database closed")
ErrClosed is returned on use of a closed database.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB provides a pool of *sqlite3.Conn{}, configured by Driver{}.
func (*DB) Open ¶
Open will attempt to return an idle connection from pool, else opening new. NOTE: you MUST later call db.Release(), or you will hold its slot open indefinitely.
type Driver ¶
type Driver struct {
// OnOpen is an optional hook to
// be called on connection open.
OnOpen func(*sqlite3.Conn) error
// OnClose is an optional hook to
// be called on connection close.
OnClose func(*sqlite3.Conn)
// MaxIdleConns determines
// how many idle connections
// are allowed to be open.
MaxIdleConns int32
// MaxOpenConns determines
// how many open connections
// are allowed at once.
MaxOpenConns int32
}
Driver determines a set of configuration options used to open a DB{} instance.
Click to show internal directories.
Click to hide internal directories.