Documentation ¶
Index ¶
- func InitSchema(conn conn, pageSize int, triggers bool) error
- func NewDirectStorage(opts NewDirectStorageOpts) (_ storage.ClientImplCloser, err error)
- func NewProvider(pool ConnPool, opts ProviderOpts) (_ *provider, err error)
- func SetCapacity(conn conn, cap int64) error
- func UnlimitCapacity(conn conn) error
- type ConnPool
- type InitConnOpts
- type InitDbOpts
- type InitPoolOpts
- type NewConnOpts
- type NewDirectStorageOpts
- type NewPiecesStorageOpts
- type NewPoolOpts
- type PoolConf
- type ProviderOpts
- type UnexpectedJournalMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitSchema ¶ added in v1.22.0
func NewDirectStorage ¶ added in v1.28.0
func NewDirectStorage(opts NewDirectStorageOpts) (_ storage.ClientImplCloser, err error)
A convenience function that creates a connection pool, resource provider, and a pieces storage ClientImpl and returns them all with a Close attached.
func NewProvider ¶
func NewProvider(pool ConnPool, opts ProviderOpts) (_ *provider, err error)
Needs the ConnPool size so it can initialize all the connections with pragmas. Takes ownership of the ConnPool (since it has to initialize all the connections anyway).
func SetCapacity ¶ added in v1.19.0
Set the capacity limit to exactly this value.
func UnlimitCapacity ¶ added in v1.19.0
func UnlimitCapacity(conn conn) error
Remove any capacity limits.
Types ¶
type ConnPool ¶ added in v1.19.0
func NewPool ¶ added in v1.19.0
func NewPool(opts NewPoolOpts) (_ ConnPool, err error)
type InitConnOpts ¶ added in v1.28.0
type InitDbOpts ¶ added in v1.28.0
type InitPoolOpts ¶ added in v1.28.0
type InitPoolOpts struct { NumConns int InitConnOpts }
type NewConnOpts ¶ added in v1.28.0
type NewConnOpts struct { // See https://www.sqlite.org/c3ref/open.html. NB: "If the filename is an empty string, then a // private, temporary on-disk database will be created. This private database will be // automatically deleted as soon as the database connection is closed." Path string Memory bool // Whether multiple blobs will not be read simultaneously. Enables journal mode other than WAL, // and NumConns < 2. NoConcurrentBlobReads bool }
type NewDirectStorageOpts ¶ added in v1.28.0
type NewDirectStorageOpts struct { NewConnOpts InitDbOpts InitConnOpts GcBlobs bool NoCacheBlobs bool BlobFlushInterval time.Duration }
type NewPiecesStorageOpts ¶ added in v1.22.0
type NewPiecesStorageOpts struct { NewPoolOpts InitDbOpts ProvOpts func(*ProviderOpts) StorageOpts func(*storage.ResourcePiecesOpts) }
type NewPoolOpts ¶ added in v1.19.0
type NewPoolOpts struct { NewConnOpts InitConnOpts NumConns int }
type PoolConf ¶ added in v1.28.0
There's some overlap here with NewPoolOpts, and I haven't decided what needs to be done. For now, the fact that the pool opts are a superset, means our helper NewPiecesStorage can just take the top-level option type.
type ProviderOpts ¶ added in v1.19.0
type ProviderOpts struct {
BatchWrites bool
}
type UnexpectedJournalMode ¶ added in v1.28.0
type UnexpectedJournalMode struct {
JournalMode string
}
func (UnexpectedJournalMode) Error ¶ added in v1.29.0
func (me UnexpectedJournalMode) Error() string
Click to show internal directories.
Click to hide internal directories.