driver

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 2, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColumnDefinition

type ColumnDefinition struct {
	ColumnName             string
	DataType               string
	UDTName                string
	DateTimePrecision      sql.NullInt64
	IsNullable             string
	CollationName          sql.NullString
	IsIdentity             string
	IdentityGeneration     sql.NullString
	IsGenerated            string
	GenerationExpression   sql.NullString
	ColumnDefault          sql.NullString
	CharacterMaximumLength sql.NullInt64
	NumericPrecision       sql.NullInt64
	NumericScale           sql.NullInt64
}

type ConstraintDefinition

type ConstraintDefinition struct {
	TableName      string
	ConstraintType string
	Definition     sql.NullString
}

type DbClient

type DbClient interface {
	Execute(query string, args ...interface{}) (*QueryResult, error)
	Close() error
}

type EnumDefinition

type EnumDefinition struct {
	Labels []string
}

type ForeignKeyDefinition

type ForeignKeyDefinition struct {
	ConstraintName    string
	TableName         string
	ColumnName        string
	ForeignTableName  string
	ForeignColumnName string
	UpdateRule        string
	DeleteRule        string
}

type FunctionDefinition

type FunctionDefinition struct {
	RoutineName       string
	RoutineType       string
	ReturnType        string
	RoutineDefinition string
}

type IndexDefinition

type IndexDefinition struct {
	IndexDef string
}

type PostgresClient

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

func NewPostgresClient

func NewPostgresClient(postgresPath string) (*PostgresClient, error)

func (*PostgresClient) Close

func (p *PostgresClient) Close() error

func (*PostgresClient) Execute

func (p *PostgresClient) Execute(query string, args ...interface{}) (*QueryResult, error)

type QueryResult

type QueryResult struct {
	Rows   *sql.Rows
	Result sql.Result
}

type SchemaSnapshot

type SchemaSnapshot struct {
	Tables      map[string]TableDefinition
	Views       map[string]ViewDefinition
	Indexes     map[string]IndexDefinition
	Constraints map[string]ConstraintDefinition
	EnumTypes   map[string]EnumDefinition
	ForeignKeys map[string]ForeignKeyDefinition
	Triggers    map[string]TriggerDefinition
	Functions   map[string]FunctionDefinition
	Sequences   map[string]SequenceDefinition
}

type SequenceDefinition

type SequenceDefinition struct {
	SequenceName string
	DataType     string
	StartValue   string
	MinValue     string
	MaxValue     string
	Increment    string
	CycleOption  string
}

type TableDefinition

type TableDefinition struct {
	Columns []ColumnDefinition
}

type TriggerDefinition

type TriggerDefinition struct {
	TriggerName       string
	EventManipulation string
	EventObjectTable  string
	ActionTiming      string
	ActionStatement   string
}

type ViewDefinition

type ViewDefinition struct {
	Definition string
}

Jump to

Keyboard shortcuts

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