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 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
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
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.