Documentation
¶
Index ¶
- type Catalog
- func (c *Catalog) CompositeTypes(ctx context.Context) (*orderedmap.Map[string, *model.CompositeType], error)
- func (c *Catalog) Domains(ctx context.Context) (*orderedmap.Map[string, *model.Domain], error)
- func (c *Catalog) Enums(ctx context.Context) (*orderedmap.Map[string, *model.Enum], error)
- func (c *Catalog) ListColumnsByTables(ctx context.Context, tables []*model.Table) (map[uint32][]*model.Column, error)
- func (c *Catalog) ListCompositeTypes(ctx context.Context) ([]*model.CompositeType, error)
- func (c *Catalog) ListConstraintsByTables(ctx context.Context, tables []*model.Table) (map[uint32][]*model.Constraint, map[uint32][]*model.ForeignKey, error)
- func (c *Catalog) ListDomains(ctx context.Context) ([]*model.Domain, error)
- func (c *Catalog) ListEnums(ctx context.Context) ([]*model.Enum, error)
- func (c *Catalog) ListIndexes(ctx context.Context) ([]*model.Index, error)
- func (c *Catalog) ListPoliciesByTables(ctx context.Context, tables []*model.Table) (map[uint32][]*model.Policy, error)
- func (c *Catalog) ListRoutines(ctx context.Context) ([]*model.Routine, error)
- func (c *Catalog) ListSequences(ctx context.Context) ([]*model.Sequence, error)
- func (c *Catalog) ListTables(ctx context.Context) ([]*model.Table, error)
- func (c *Catalog) ListTriggers(ctx context.Context) ([]*model.Trigger, error)
- func (c *Catalog) ListViews(ctx context.Context) ([]*model.View, error)
- func (c *Catalog) Routines(ctx context.Context) (*orderedmap.Map[string, *model.Routine], error)
- func (c *Catalog) Sequences(ctx context.Context) (*orderedmap.Map[string, *model.Sequence], error)
- func (c *Catalog) Tables(ctx context.Context) (*orderedmap.Map[string, *model.Table], error)
- func (c *Catalog) Views(ctx context.Context) (*orderedmap.Map[string, *model.View], error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Catalog ¶
type Catalog struct {
// contains filtered or unexported fields
}
func (*Catalog) CompositeTypes ¶ added in v1.20.0
func (c *Catalog) CompositeTypes(ctx context.Context) (*orderedmap.Map[string, *model.CompositeType], error)
func (*Catalog) ListColumnsByTables ¶ added in v1.39.0
func (c *Catalog) ListColumnsByTables(ctx context.Context, tables []*model.Table) (map[uint32][]*model.Column, error)
ListColumnsByTables returns the columns of the given tables, keyed by table OID and in attnum order. One query serves every table; reading them one at a time cost a round trip per table.
func (*Catalog) ListCompositeTypes ¶ added in v1.20.0
func (*Catalog) ListConstraintsByTables ¶ added in v1.39.0
func (c *Catalog) ListConstraintsByTables(ctx context.Context, tables []*model.Table) (map[uint32][]*model.Constraint, map[uint32][]*model.ForeignKey, error)
ListConstraintsByTables returns the table constraints and the foreign keys of the given tables, each keyed by table OID and in contype then name order. One query serves every table.
func (*Catalog) ListDomains ¶ added in v0.12.0
func (*Catalog) ListIndexes ¶
func (*Catalog) ListPoliciesByTables ¶ added in v1.39.0
func (c *Catalog) ListPoliciesByTables(ctx context.Context, tables []*model.Table) (map[uint32][]*model.Policy, error)
ListPoliciesByTables returns the row-level security policies attached to the given tables, keyed by table OID and in pg_policy.polname order. One query serves every table.
func (*Catalog) ListRoutines ¶ added in v1.30.0
ListRoutines returns the functions and procedures pistachio manages.
Each row is read as the CREATE statement pg_get_functiondef renders and handed to the same parser the desired schema goes through, so both sides of the diff produce the same model and render through the same SQL writer. That is what keeps a dump fed back as the desired schema planning clean, without the definition-text normalization views and triggers need.
Aggregates (prokind 'a') and window functions (prokind 'w') are left out, as is a routine with a SQL-standard body (BEGIN ATOMIC): such a body records pg_depend entries on whatever it reads, which contradicts the order pistachio creates routines in. The parser skips the same ones, so neither side of the diff sees them.
func (*Catalog) ListSequences ¶ added in v1.17.0
ListSequences returns all sequences in the filtered schemas, including those owned by serial/identity columns. OwnerTable/OwnerColumn identify the owning column (nil for standalone sequences).
func (*Catalog) ListTables ¶
func (*Catalog) ListTriggers ¶ added in v1.29.0
ListTriggers returns the triggers on the tables and views in the catalog's schemas. Both relation kinds come from one query, the way ListIndexes serves tables and materialized views together.
func (*Catalog) Routines ¶ added in v1.30.0
Routines returns the managed functions and procedures in the filtered schemas, keyed by FQRN.
func (*Catalog) Sequences ¶
Sequences returns the standalone sequences in the filtered schemas, keyed by FQN. Sequences owned by a table column (serial or identity) are excluded: they are managed as column attributes, not as standalone objects.