sq3schema

package module
v1.0.1-0...-e217695 Latest Latest
Warning

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

Go to latest
Published: May 20, 2020 License: BSD-2-Clause Imports: 7 Imported by: 0

README

Documentation

Overview

Package sq3schema exposes a simple API to utilize the user_version pragma to apply a slice of migrations to a sqlite database. This provides a simple schema migration facility.

Remember the migrations slice should be considered "immutable", that is don't remove entries from in there. Just add entries, even if you want to drop tables.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MemDB

func MemDB(migrations []string) *sqlitex.Pool

MemDB returns a new in-memory DB Pool with the migrations already applied. This is meant to be used for tests, and so it panics on errors.

func Migrate

func Migrate(conn *sqlite.Conn, migrations []string) error

Migrate runs the migrations on the connection.

Types

This section is empty.

Jump to

Keyboard shortcuts

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