catalog

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Catalog

type Catalog struct {
	DefaultSchema string
	Schemas       []*Schema
}

Catalog represents the parsed database schema.

type CheckConstraint

type CheckConstraint struct {
	Name       string
	Expression string
}

CheckConstraint represents a CHECK constraint.

type Column

type Column struct {
	Name       string
	Type       string // raw SQL type name, e.g. "UUID", "VARCHAR(255)", "TIMESTAMP"
	FullType   string // full SQL type with modifiers, e.g. "character varying(255)", "uuid"
	NotNull    bool
	IsArray    bool
	ArrayDims  int
	Comment    string
	Length     *int
	IsUnsigned bool
	Default    string // raw SQL expression, e.g. "uuid_generate_v4()", "CURRENT_TIMESTAMP"
	IsPrimary  bool
}

Column represents a column in a database table.

type Enum

type Enum struct {
	Name   string
	Values []string
}

Enum represents a database enum type.

type ForeignKey

type ForeignKey struct {
	Name       string
	Columns    []string
	RefTable   string
	RefSchema  string
	RefColumns []string
	OnDelete   string
	OnUpdate   string
}

ForeignKey represents a FOREIGN KEY constraint.

type Index

type Index struct {
	Name        string
	Columns     []string
	IsUnique    bool
	Where       string // partial index predicate, raw SQL
	IfNotExists bool
}

Index represents a database index.

type PrimaryKey

type PrimaryKey struct {
	Name    string
	Columns []string
}

PrimaryKey represents a PRIMARY KEY constraint.

type Schema

type Schema struct {
	Name       string
	Tables     []*Table
	Enums      []*Enum
	Extensions []string
}

Schema represents a database schema containing tables and types.

type Table

type Table struct {
	Name        string
	Schema      string
	Columns     []*Column
	Comment     string
	PrimaryKey  *PrimaryKey
	Indexes     []*Index
	ForeignKeys []*ForeignKey
	Uniques     []*UniqueConstraint
	Checks      []*CheckConstraint
}

Table represents a database table.

type UniqueConstraint

type UniqueConstraint struct {
	Name    string
	Columns []string
}

UniqueConstraint represents a UNIQUE constraint.

Jump to

Keyboard shortcuts

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