dbschema

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ensure

func Ensure(ctx context.Context, db *sql.DB, dir string) (int, error)

Ensure applies all relevant schema updates to the local database.

Return the initial schema version found before starting the update, along with any error occurred.

func MapDBError

func MapDBError(err error) error

MapDBError reports a violated constraint of the database as constraint violation. The message of the database, which names the affected table and column, is only kept as cause, it is of no use for the user.

func Version added in v0.10.0

func Version(ctx context.Context, db *sql.DB) (current int, latest int, _ error)

Version returns the current and the latest known schema version of db.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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