Help us shape the future of Go! Take the 2026 Go Developer Survey

sqlite

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package sqlite provides a SQLite key-value storage backend.

This is the recommended storage backend for persistent storage. Data is persisted to a local SQLite database file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Path is the database file path.
	Path string
}

Config configures the SQLite storage.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store implements kvs.Store with SQLite.

func New

func New(cfg Config) (*Store, error)

New creates a new SQLite storage.

func (*Store) Close

func (s *Store) Close() error

Close releases storage resources.

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, key string) error

Delete removes a key.

func (*Store) Get

func (s *Store) Get(ctx context.Context, key string) ([]byte, error)

Get retrieves a value by key.

func (*Store) List

func (s *Store) List(ctx context.Context, prefix string) ([]string, error)

List returns all keys matching the given prefix.

func (*Store) Path

func (s *Store) Path() string

Path returns the database file path.

func (*Store) Set

func (s *Store) Set(ctx context.Context, key string, value []byte, ttl time.Duration) error

Set stores a value with an optional TTL.

Jump to

Keyboard shortcuts

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