Documentation
¶
Overview ¶
Package sqlitestore implements the blob.KV interface using SQLite3.
Index ¶
- func Opener(_ context.Context, addr string) (blob.StoreCloser, error)
- type KV
- func (s KV) Delete(ctx context.Context, key string) error
- func (s KV) Get(ctx context.Context, key string) ([]byte, error)
- func (s KV) Has(ctx context.Context, keys ...string) (blob.KeySet, error)
- func (s KV) Len(ctx context.Context) (int64, error)
- func (s KV) List(ctx context.Context, start string) iter.Seq2[string, error]
- func (s KV) Put(ctx context.Context, opts blob.PutOptions) error
- type Options
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Opener ¶
Opener constructs a sqlitestore from a SQLite URI, for use with the store package.
- If poolsize=n is set, it is used to set the pool size to n connections.
- If compress=v is set, it is used to enable/disable compression (default true).
- If journal=m is set, it is used to set the journaling mode.
Any other query parameters are passed to SQLite verbatim.
Types ¶
type KV ¶
type KV struct {
// contains filtered or unexported fields
}
A KV implements the blob.KV interface using a SQLite3 database.
type Options ¶
type Options struct {
// The name of the SQL driver to use, default "sqlite".
Driver string
// The number of connections to allow in the pool. If <= 0, use runtime.NumCPU.
PoolSize int
// If true, store blobs without compression; by default blob data are
// compressed with Snappy.
Uncompressed bool
// If set, set the journal mode of the database to this value.
// See: https://sqlite.org/pragma.html#pragma_journal_mode
JournalMode string
}
Options are options for constructing a KV. A nil *Options is ready for use and provides default values as described.
Click to show internal directories.
Click to hide internal directories.