db

package
v0.0.0-...-5d153c6 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Defaults = DatabaseOptions{
		Filename:         "./sparq.db",
		SkipVersionCheck: false,
	}
)
View Source
var (
	InstanceHostname string = "localhost.dev"
)
View Source
var Migrations embed.FS

Functions

func InitDB

func InitDB(filename string, remove bool) (*sqlx.DB, func(), error)

Used to initialize a new database for tests

func MigrateExec

func MigrateExec(args []string) error

func OpenDB

func OpenDB(opts DatabaseOptions) (*sqlx.DB, error)

func Seed

func Seed(dbx *sqlx.DB) error

func SqliteVersion

func SqliteVersion(dbx *sqlx.DB) string

func TestDB

func TestDB(filename string) (*sqlx.DB, func(), error)

Types

type DatabaseOptions

type DatabaseOptions struct {
	Filename         string
	SkipVersionCheck bool
}

Jump to

Keyboard shortcuts

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