goosex

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: Apache-2.0 Imports: 9 Imported by: 9

Documentation

Overview

Package goosex provides shared functions used with goose to help reduce code duplication. This provides the ability to import the migrate command into individual applications and run migrations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MigrateUp deprecated added in v0.0.12

func MigrateUp(uri string, fsys fs.FS)

MigrateUp will run migrations and is provided as an easy way to ensure migrations are ran in test suites

Deprecated: use MigrateUpContext

func MigrateUpContext added in v0.4.0

func MigrateUpContext(ctx context.Context, uri string, fsys fs.FS)

MigrateUpContext will run migrations and is provided as an easy way to ensure migrations are ran in test suites

func RegisterCobraCommand

func RegisterCobraCommand(cmd *cobra.Command, setupFunc func())

RegisterCobraCommand will add a migrate command to the cobra command provided that provides a wrapper for running goose commands.

func SetBaseFS

func SetBaseFS(fsys fs.FS)

SetBaseFS accepts an embedded golang filesystem and sets that as the location for goose migration files.

func SetDBURI

func SetDBURI(uri string)

SetDBURI accepts a URI and saves it for use by goose during migrations

func SetLogger

func SetLogger(l *zap.SugaredLogger)

SetLogger accepts a zap logger and sets it as the logger for goose output

Types

This section is empty.

Jump to

Keyboard shortcuts

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