Help us shape the future of Go! Take the 2026 Go Developer Survey

drivers

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DriverName added in v1.2.0

type DriverName = internaldrivers.DriverName

DriverName names a database engine.

const (
	SQLiteDriverName   DriverName = internaldrivers.SQLiteDriverName
	PostgresDriverName DriverName = internaldrivers.PostgresDriverName
)

type Option added in v1.2.0

type Option interface {
	// contains filtered or unexported methods
}

Option configures Diff.

func WithData added in v1.2.0

func WithData() Option

WithData adds the comparison of the rows.

func WithDriver added in v1.2.0

func WithDriver(driver DriverName) Option

WithDriver names the engine. Without this option the detection reads the source and the target arguments.

func WithPrivileges added in v1.2.0

func WithPrivileges() Option

WithPrivileges adds the comparison of the PostgreSQL privileges.

func WithSchema added in v1.2.0

func WithSchema(schema string) Option

WithSchema names the PostgreSQL schema on both sides. Without this option the search path of the connection string applies.

func WithScratchServerVersion added in v1.2.0

func WithScratchServerVersion(version string) Option

WithScratchServerVersion names the PostgreSQL version of the temporary server that materializes a SQL source when both sides are SQL sources.

type Statement added in v1.2.0

type Statement struct {
	SQL string

	// Comment names the object that the statement changes.
	Comment string
}

A Statement is one SQL statement of a diff.

func Diff added in v1.2.0

func Diff(ctx context.Context, source string, target string, options ...Option) ([]Statement, error)

Diff reads the schema of the source and of the target, and it gives the statements that change the source. An argument names a database, a .sql file, or a directory of .sql files.

Jump to

Keyboard shortcuts

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