deploy

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

DB is the target of deploying a DDL schema.

func Open

func Open(driverName string, dataSourceName string) (*DB, error)

Open opens a database specified by its database driver name.

func (*DB) Close

func (db *DB) Close() error

Close closes the database.

func (*DB) Deploy

func (db *DB) Deploy(ctx context.Context, plan *Plan) error

Deploy deploys the new schema according to the plan.

func (*DB) Import added in v0.0.7

func (db *DB) Import(ctx context.Context, sqlText string) error

Import imports and updates the schemalex revision using sqlText.

func (*DB) LoadSchema added in v0.0.7

func (db *DB) LoadSchema(ctx context.Context) (string, error)

LoadSchema loads existing table schemas from running database.

func (*DB) Plan

func (db *DB) Plan(ctx context.Context, schema string) (*Plan, error)

Plan generates a series statements to migrate from the current one to the new schema.

type Plan

type Plan struct {
	From  string
	To    string
	Stmts diff.Stmts
}

func (*Plan) Preview added in v0.0.2

func (plan *Plan) Preview(w io.Writer) error

Jump to

Keyboard shortcuts

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