Documentation
¶
Index ¶
- type ExcludeConstraintDefinition
- type PostgreSQLWriter
- func (w *PostgreSQLWriter) BeginTransaction() error
- func (w *PostgreSQLWriter) CommitTransaction() error
- func (w *PostgreSQLWriter) DropAllTables() error
- func (w *PostgreSQLWriter) ExecuteSQL(sqlExpr string) error
- func (w *PostgreSQLWriter) IsDryRun() bool
- func (w *PostgreSQLWriter) RollbackTransaction() error
- func (w *PostgreSQLWriter) SetDryRun(dryRun bool)
- type Reader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExcludeConstraintDefinition ¶
type ExcludeConstraintDefinition struct {
UsingMethod string
Elements string
WhereCondition string
}
ExcludeConstraintDefinition represents the parsed components of an EXCLUDE constraint
type PostgreSQLWriter ¶
type PostgreSQLWriter struct {
// contains filtered or unexported fields
}
PostgreSQLWriter writes schemas to PostgreSQL databases
func NewPostgreSQLWriter ¶
func NewPostgreSQLWriter(db *sql.DB, schema string) *PostgreSQLWriter
NewPostgreSQLWriter creates a new PostgreSQL schema writer
func (*PostgreSQLWriter) BeginTransaction ¶
func (w *PostgreSQLWriter) BeginTransaction() error
BeginTransaction starts a new transaction
func (*PostgreSQLWriter) CommitTransaction ¶
func (w *PostgreSQLWriter) CommitTransaction() error
CommitTransaction commits the current transaction
func (*PostgreSQLWriter) DropAllTables ¶
func (w *PostgreSQLWriter) DropAllTables() error
DropAllTables drops ALL tables and enums in the database schema (COMPLETE CLEANUP!)
func (*PostgreSQLWriter) ExecuteSQL ¶
func (w *PostgreSQLWriter) ExecuteSQL(sqlExpr string) error
ExecuteSQL executes a SQL statement
func (*PostgreSQLWriter) IsDryRun ¶
func (w *PostgreSQLWriter) IsDryRun() bool
IsDryRun returns whether dry run mode is enabled
func (*PostgreSQLWriter) RollbackTransaction ¶
func (w *PostgreSQLWriter) RollbackTransaction() error
RollbackTransaction rolls back the current transaction
func (*PostgreSQLWriter) SetDryRun ¶
func (w *PostgreSQLWriter) SetDryRun(dryRun bool)
SetDryRun enables or disables dry run mode
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader reads schema from PostgreSQL databases
func NewPostgreSQLReader ¶
NewPostgreSQLReader creates a new PostgreSQL schema reader
func (*Reader) ParseExcludeConstraintDefinition ¶
func (r *Reader) ParseExcludeConstraintDefinition(definition string) (*ExcludeConstraintDefinition, error)
ParseExcludeConstraintDefinition parses an EXCLUDE constraint definition from pg_get_constraintdef Example input: "EXCLUDE USING gist (room_id WITH =, during WITH &&) WHERE (is_active = true)"