sqliteStorage

package
v1.19.2 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2020 License: MPL-2.0 Imports: 17 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPiecesStorage added in v1.19.0

func NewPiecesStorage(opts NewPoolOpts) (_ 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 NewPool added in v1.19.0

func NewPool(opts NewPoolOpts) (_ ConnPool, _ ProviderOpts, err error)

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

func SetCapacity(conn conn, cap int64) error

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

type ConnPool interface {
	Get(context.Context) conn
	Put(conn)
	Close() error
}

type NewPoolOpts added in v1.19.0

type NewPoolOpts struct {
	Path     string
	Memory   bool
	NumConns int
	// Forces WAL, disables shared caching.
	ConcurrentBlobReads bool
	DontInitSchema      bool
	// If non-zero, overrides the existing setting.
	Capacity int64
}

type ProviderOpts added in v1.19.0

type ProviderOpts struct {
	NumConns int
	// Concurrent blob reads require WAL.
	ConcurrentBlobRead bool
	BatchWrites        bool
}

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.

Jump to

Keyboard shortcuts

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