Documentation
¶
Index ¶
- func DomainToSQL(d *Domain) string
- func DomainsToSQL(domains *orderedmap.Map[string, *Domain]) string
- func EnumToSQL(e *Enum) string
- func EnumsToSQL(enums *orderedmap.Map[string, *Enum]) string
- func Ident(names ...string) string
- func QuoteLiteral(s string) string
- func TableToSQL(t *Table) string
- func TablesToSQL(tables *orderedmap.Map[string, *Table]) string
- func ViewToSQL(v *View) string
- func ViewsToSQL(views *orderedmap.Map[string, *View]) string
- type Column
- type ColumnGenerated
- type ColumnIdentity
- type Constraint
- type ConstraintType
- func (b ConstraintType) IsCheckConstraint() bool
- func (b ConstraintType) IsConstraintTrigger() bool
- func (b ConstraintType) IsExclusionConstraint() bool
- func (b ConstraintType) IsForeignKeyConstraint() bool
- func (b ConstraintType) IsNotNullConstraint() bool
- func (b ConstraintType) IsPrimaryKeyConstraint() bool
- func (b ConstraintType) IsUniqueConstraint() bool
- type Domain
- type DomainConstraint
- type Enum
- type ForeignKey
- type Index
- type Policy
- type PolicyCommand
- type Sequence
- type Table
- type View
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DomainToSQL ¶ added in v0.12.0
func DomainsToSQL ¶ added in v0.12.0
func DomainsToSQL(domains *orderedmap.Map[string, *Domain]) string
func EnumsToSQL ¶ added in v0.9.0
func EnumsToSQL(enums *orderedmap.Map[string, *Enum]) string
func QuoteLiteral ¶
func TableToSQL ¶ added in v0.3.0
func TablesToSQL ¶
func TablesToSQL(tables *orderedmap.Map[string, *Table]) string
func ViewsToSQL ¶
func ViewsToSQL(views *orderedmap.Map[string, *View]) string
Types ¶
type Column ¶
type ColumnGenerated ¶
type ColumnGenerated byte
func (ColumnGenerated) IsGeneratedColumn ¶
func (b ColumnGenerated) IsGeneratedColumn() bool
func (ColumnGenerated) IsStoredGeneratedColumn ¶
func (b ColumnGenerated) IsStoredGeneratedColumn() bool
func (ColumnGenerated) IsVirtualGeneratedColumn ¶
func (b ColumnGenerated) IsVirtualGeneratedColumn() bool
type ColumnIdentity ¶
type ColumnIdentity byte
func (ColumnIdentity) IsGeneratedAlways ¶
func (b ColumnIdentity) IsGeneratedAlways() bool
func (ColumnIdentity) IsGeneratedByDefault ¶
func (b ColumnIdentity) IsGeneratedByDefault() bool
func (ColumnIdentity) IsIdentityColumn ¶
func (b ColumnIdentity) IsIdentityColumn() bool
type Constraint ¶
type Constraint struct {
OID uint32
Name string
RenameFrom *string
Type ConstraintType
Definition string
Columns []string
Deferrable bool
Deferred bool
Validated bool
}
func (*Constraint) String ¶
func (con *Constraint) String() string
type ConstraintType ¶
type ConstraintType byte
func (ConstraintType) IsCheckConstraint ¶
func (b ConstraintType) IsCheckConstraint() bool
func (ConstraintType) IsConstraintTrigger ¶
func (b ConstraintType) IsConstraintTrigger() bool
func (ConstraintType) IsExclusionConstraint ¶
func (b ConstraintType) IsExclusionConstraint() bool
func (ConstraintType) IsForeignKeyConstraint ¶
func (b ConstraintType) IsForeignKeyConstraint() bool
func (ConstraintType) IsNotNullConstraint ¶
func (b ConstraintType) IsNotNullConstraint() bool
func (ConstraintType) IsPrimaryKeyConstraint ¶
func (b ConstraintType) IsPrimaryKeyConstraint() bool
func (ConstraintType) IsUniqueConstraint ¶
func (b ConstraintType) IsUniqueConstraint() bool
type Domain ¶ added in v0.12.0
type Domain struct {
OID uint32
Schema string
Name string
RenameFrom *string
BaseType string
NotNull bool
Default *string
Collation *string
Constraints []*DomainConstraint
Comment *string
}
func (Domain) CommentSQL ¶ added in v0.12.0
type DomainConstraint ¶ added in v0.12.0
type Enum ¶ added in v0.9.0
type Enum struct {
OID uint32
Schema string
Name string
RenameFrom *string
Values []string
Comment *string
}
func (Enum) CommentSQL ¶ added in v0.9.0
type ForeignKey ¶
type ForeignKey struct {
Constraint
Schema string
Table string
RefSchema *string
RefTable *string
}
func (ForeignKey) SQL ¶
func (fk ForeignKey) SQL() string
func (*ForeignKey) String ¶
func (fk *ForeignKey) String() string
type Index ¶
type Policy ¶ added in v1.3.0
type Policy struct {
Name string
RenameFrom *string
Schema string
Table string
Permissive bool
Command PolicyCommand
Roles []string
Using *string
WithCheck *string
}
type PolicyCommand ¶ added in v1.3.0
type PolicyCommand byte
PolicyCommand mirrors pg_policy.polcmd:
'*' ALL, 'r' SELECT, 'a' INSERT, 'w' UPDATE, 'd' DELETE
func (PolicyCommand) IsAll ¶ added in v1.3.0
func (c PolicyCommand) IsAll() bool
func (PolicyCommand) String ¶ added in v1.3.0
func (c PolicyCommand) String() string
type Sequence ¶
type Sequence struct {
OID uint32
Schema string
Name string
DataType string
Start int64
Min int64
Max int64
Increment int64
Cache int64
Cycle bool
OwnerTable *string
OwnerColumn *string
}
Sequence holds metadata for a PostgreSQL sequence. It is currently populated only by catalog.Catalog.Sequences and not yet consumed by the diff/apply pipeline; it is intentionally kept for future sequence-aware schema management and should not be deleted as dead code.
type Table ¶
type Table struct {
OID uint32
Schema string
Name string
RenameFrom *string
BulkAlter bool
TableSpace *string
Unlogged bool
Partitioned bool
PartitionDef *string
PartitionOf *string
PartitionBound *string
RowSecurity bool
ForceRowSecurity bool
Columns *orderedmap.Map[string, *Column]
Constraints *orderedmap.Map[string, *Constraint]
ForeignKeys *orderedmap.Map[string, *ForeignKey]
Indexes *orderedmap.Map[string, *Index]
Policies *orderedmap.Map[string, *Policy]
Comment *string
}
func (Table) CommentSQL ¶
Click to show internal directories.
Click to hide internal directories.