Documentation
¶
Index ¶
- func Pluralize(name string) string
- func QualifyPackage(pkgPath string) string
- func SaveSnapshot(path string, snap *Snapshot) error
- func ToSnakeCase(in string) string
- type Builder
- type Column
- type Constraint
- type ConstraintKind
- type Diff
- type EnumType
- type Index
- type Inspector
- type Operation
- type OperationKind
- type PostgresInspector
- type Schema
- type ScopeKind
- type Snapshot
- type Table
- type Type
- type TypeKind
- type View
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func QualifyPackage ¶
func SaveSnapshot ¶
func ToSnakeCase ¶
Types ¶
type Column ¶
type Column struct {
Name string
GoName string
Type Type
Nullable bool
PrimaryKey bool
Unique bool
Identity bool
AutoIncrement bool
Default string
Generated string
SoftDelete bool
CreatedAt bool
UpdatedAt bool
DeletedAt bool
CreatedBy bool
UpdatedBy bool
DeletedBy bool
Scope ScopeKind
Tags map[string]string
}
func (Column) IsAuditField ¶
func (Column) IsScopeField ¶
func (Column) TagsString ¶
type Constraint ¶
type ConstraintKind ¶
type ConstraintKind string
const ( ConstraintPrimaryKey ConstraintKind = "primary_key" ConstraintUnique ConstraintKind = "unique" ConstraintForeignKey ConstraintKind = "foreign_key" ConstraintCheck ConstraintKind = "check" )
type Operation ¶
type Operation struct {
Kind OperationKind
Table string
TableDef *Table
Column *Column
Previous *Column
Index *Index
Constraint *Constraint
}
type OperationKind ¶
type OperationKind string
const ( OpCreateTable OperationKind = "create_table" OpDropTable OperationKind = "drop_table" OpAddColumn OperationKind = "add_column" OpDropColumn OperationKind = "drop_column" OpAlterColumn OperationKind = "alter_column" OpCreateIndex OperationKind = "create_index" OpDropIndex OperationKind = "drop_index" OpCreateConstraint OperationKind = "create_constraint" OpDropConstraint OperationKind = "drop_constraint" )
type PostgresInspector ¶
type PostgresInspector struct{}
type Snapshot ¶
func LoadSnapshot ¶
type TypeKind ¶
type TypeKind string
const ( TypeUnknown TypeKind = "unknown" TypeBool TypeKind = "bool" TypeInt TypeKind = "int" TypeFloat TypeKind = "float" TypeString TypeKind = "string" TypeBytes TypeKind = "bytes" TypeTime TypeKind = "time" TypeUUID TypeKind = "uuid" TypeJSON TypeKind = "json" TypeArray TypeKind = "array" TypeEnum TypeKind = "enum" TypeCustom TypeKind = "custom" )
Click to show internal directories.
Click to hide internal directories.