sqlite

package
v1.15.1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTimeout     = 20 * time.Second // Default timeout for database requests, in seconds
	DefaultBusyTimeout = 2 * time.Second
)

Variables

This section is empty.

Functions

func ValidIdentifier

func ValidIdentifier(v string) bool

Validates an identifier, such as table or DB name.

Types

type GetConnectionStringOpts

type GetConnectionStringOpts struct {
	// Enabled foreign keys
	EnableForeignKeys bool
}

GetConnectionStringOpts contains options for GetConnectionString

type SqliteAuthMetadata

type SqliteAuthMetadata struct {
	ConnectionString string        `mapstructure:"connectionString" mapstructurealiases:"url"`
	Timeout          time.Duration `mapstructure:"timeout" mapstructurealiases:"timeoutInSeconds"`
	BusyTimeout      time.Duration `mapstructure:"busyTimeout"`
	DisableWAL       bool          `mapstructure:"disableWAL"` // Disable WAL journaling. You should not use WAL if the database is stored on a network filesystem (or data corruption may happen). This is ignored if the database is in-memory.
}

SqliteAuthMetadata contains the auth metadata for a SQLite component.

func (*SqliteAuthMetadata) GetConnectionString

func (m *SqliteAuthMetadata) GetConnectionString(log logger.Logger, opts GetConnectionStringOpts) (string, error)

GetConnectionString returns the parsed connection string.

func (*SqliteAuthMetadata) IsInMemoryDB

func (m *SqliteAuthMetadata) IsInMemoryDB() bool

IsInMemoryDB returns true if the connection string is for an in-memory database.

func (*SqliteAuthMetadata) Reset

func (m *SqliteAuthMetadata) Reset()

Reset the object

func (*SqliteAuthMetadata) Validate

func (m *SqliteAuthMetadata) Validate() error

Validate the auth metadata and returns an error if it's not valid.

Jump to

Keyboard shortcuts

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