sqlite

package
v0.0.0-...-95e2e8c Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const CurrentVersion = uint16(1)

Current version of the indexing protocol

Variables

This section is empty.

Functions

func HasMetadata

func HasMetadata(
	db *sql.DB,
	indexName string,
) (bool, error)

func Open

func Open(dsn string) (*sql.DB, error)

We use the driver directly rather than the database/sql interfaces, because the generic way tries to autodetect and normalize the return types. But we want to get the real types.

func SanitizeIdentifier

func SanitizeIdentifier(db *sql.DB, identifier string) (string, error)

Types

type Metadata

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

func LoadMetadata

func LoadMetadata(
	db *sql.DB,
	indexName string,
) (*Metadata, error)

func NewMetadata

func NewMetadata(
	db *sql.DB,
	indexName string,
	input input.Input,
) (*Metadata, error)

func (*Metadata) AssertValid

func (metadata *Metadata) AssertValid(input input.Input) error

Validates that the metadata of the file is a valid RODB index and matches the given configuration as well as the current version

func (*Metadata) GetTableIdentifier

func (metadata *Metadata) GetTableIdentifier() (string, error)

func (*Metadata) Save

func (metadata *Metadata) Save() error

func (*Metadata) SetCompleted

func (metadata *Metadata) SetCompleted(completed bool)

Sets the completed flag, which records wether or not the index generation has been finished

Jump to

Keyboard shortcuts

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