sqlite

package
v0.0.0-...-40ef43a Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultStoreDirectory is the default name of the directory
	// where the SQLite data will be kept.
	DefaultStoreDirectory string = "sqlite"
	// DefaultStoreFileName is the default name of the SQLite3 data file.
	DefaultStoreFileName string = "sqlite3.db"
)
View Source
const (
	// DefaultSQLite3FileName is the default name for the SQLite3
	// on-disk data file.
	DefaultSQLite3FileName string = "sqlite3.db"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(store *Store)

Option represents the optional function.

func WithStoreDirectory

func WithStoreDirectory(value string) Option

WithStoreDirectory sets up the directory where the SQLite data will be kept.

func WithStoreFileName

func WithStoreFileName(value string) Option

WithStoreFileName sets up the name of the SQLite3 data file.

type Store

type Store struct {
	// db is the database for the FSM.
	DB *sql.DB
	// DataDirectory is the directory where the DB files are stored.
	DataDirectory string
	// DataFileName is the name of the SQLite3 data file.
	DataFileName string
}

Store is a store based on a local SQLite database.

func New

func New(options ...Option) (*Store, error)

New creates and initialises a new SQLite-based store.

Jump to

Keyboard shortcuts

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