sqlite3

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2025 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache string
const (
	CacheShared  Cache = "shared"
	CachePrivate Cache = "private"
)

type DSNOption

type DSNOption func(*SQLite3DSN)

DSNOption defines a function that configures a SQLite3DSN.

func ReadOnly

func ReadOnly() DSNOption

func WithAuthCrypt

func WithAuthCrypt(crypt string) DSNOption

WithAuthCrypt sets the auth crypt for the DSN.

func WithAuthPass

func WithAuthPass(pass string) DSNOption

WithAuthPass sets the auth password for the DSN.

func WithAuthUser

func WithAuthUser(user string) DSNOption

WithAuthUser sets the auth user for the DSN.

func WithCache

func WithCache(cache Cache) DSNOption

WithCache sets the cache for the DSN.

func WithMode

func WithMode(mode Mode) DSNOption

WithMode sets the mode for the DSN.

type Mode

type Mode string
const (
	ModeRO  Mode = "ro"
	ModeRW  Mode = "rw"
	ModeRWC Mode = "rwc"
	ModeMem Mode = "memory"
)

type SQLite3DSN

type SQLite3DSN struct {
	Path      string `json:"path"`
	AuthUser  string `json:"_auth_user"`
	AuthPass  string `json:"_auth_pass"`
	AuthCrypt string `json:"_auth_crypt"`
	Mode      Mode   `json:"mode"`
	Cache     Cache  `json:"cache"`
}

func NewDSN

func NewDSN(path string, opts ...DSNOption) *SQLite3DSN

NewDSN creates a new SQLite3DSN with the given options.

func (SQLite3DSN) DSN

func (s SQLite3DSN) DSN() string

func (*SQLite3DSN) Info

func (s *SQLite3DSN) Info() string

Info implements database.DataSourceNamer.

func (SQLite3DSN) Type

func (s SQLite3DSN) Type() database.Type

Type implements database.DataSourceNamer.

Jump to

Keyboard shortcuts

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