cmd

package
v0.0.0-...-edeb3c3 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package migratecmd adds a new "migrate" command support to a PocketBase instance.

It also comes with automigrations support and templates generation (both for JS and GO migration files).

Example usage:

migratecmd.MustRegister(app, app.RootCmd, migratecmd.Config{
	TemplateLang: migratecmd.TemplateLangJS, // default to migratecmd.TemplateLangGo
	Automigrate:  true,
	Dir:          "/custom/migrations/dir", // optional template migrations path; default to "pb_migrations" (for JS) and "migrations" (for Go)
})

Note: To allow running JS migrations you'll need to enable first
[jsvm.MustRegister()].

Index

Constants

View Source
const (
	VERSION = "0.1.0"
)

Variables

This section is empty.

Functions

func CmdServe

func CmdServe(app *app.App) *cobra.Command

func Execute

func Execute(app *app.App)

func MustRegister

func MustRegister(app app.App, rootCmd *cobra.Command, dir string)

MustRegister registers the migratecmd plugin to the provided app instance and panic if it fails.

Example usage:

migratecmd.MustRegister(app, app.RootCmd, migratecmd.Config{})

func Register

func Register(app app.App, rootCmd *cobra.Command, dir string) error

Register registers the migratecmd plugin to the provided app instance.

func RootCmd

func RootCmd(app *app.App) *cobra.Command

func Serve

func Serve(app *app.App) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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