postgres

package
v0.0.0-...-931ac2b Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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

func NewPostgreSQLReader(db *sql.DB, schema string) *Reader

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)"

func (*Reader) ReadSchema

func (r *Reader) ReadSchema() (*types.DBSchema, error)

ReadSchema reads the complete database schema

Jump to

Keyboard shortcuts

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