Versions in this module Expand all Collapse all v0 v0.11.0 Sep 9, 2026 Changes in this version + type ArrayType struct + Dimensions int + ElementType string + Name string + Schema string + type Attribute struct + Default string + Name string + NotNull bool + Position int + Type string + type AuthPatternType string + const AuthPatternCustom + const AuthPatternJWT + const AuthPatternNone + const AuthPatternRLS + const AuthPatternSession + const AuthPatternStorage + type CastType int + const AssignmentCast + const ExplicitCast + const ImplicitCast + const NoCast + type Category string + const CategoryComments + const CategoryConstraints + const CategoryCritical + const CategoryData + const CategoryExtensions + const CategoryFoundation + const CategoryFunctions + const CategoryIndexes + const CategorySecurity + const CategoryTriggers + type CompatibilityLevel int + const FullyCompatible + const Incompatible + const MostlyCompatible + const PartiallyCompatible + type CompositeType struct + Attributes []Attribute + Name string + Schema string + type Constraint struct + Expression string + Name string + Validated bool + type ContextType int + const ArrayElementContext + const CompositeAttributeContext + const DomainBaseContext + const FunctionParameterContext + const FunctionReturnContext + const IndexExpressionContext + const TableColumnContext + type CrossSchemaRef struct + ObjectName string + ObjectType ObjectType + Schema string + type CustomType struct + Attributes map[string]string + BaseType string + Category TypeCategory + Constraints []string + Name string + Schema string + type DependencyType int + const ArrayElementDependency + const CompositionDependency + const DomainBaseDependency + const FunctionParameterDependency + const InheritanceDependency + const TableColumnDependency + type Domain struct + BaseType string + Constraints []Constraint + Default string + Name string + NotNull bool + Schema string + type EnumType struct + Name string + Schema string + Values []string + type ExecutionTimeCategory string + const ExecutionFast + const ExecutionInstant + const ExecutionMedium + const ExecutionSlow + const ExecutionUnknown + type LockLevel string + const LockAccessExclusive + const LockAccessShare + const LockExclusive + const LockNone + const LockRowExclusive + const LockRowShare + const LockShare + const LockShareRowExclusive + const LockShareUpdateExclusive + type Migration struct + Filename string + ParseErrors []string + Sequence int + Size int64 + Statements []Statement + type MigrationTypeAnalysis struct + Dependencies []*TypeDependency + TypeChanges []*TypeChange + TypesUsed map[string]*TypeInfo + Warnings []string + type ObjectType string + const TypeComment + const TypeComposite + const TypeConstraint + const TypeData + const TypeDoBlock + const TypeDomain + const TypeEnum + const TypeEventTrigger + const TypeExtension + const TypeFunction + const TypeGeneratedColumn + const TypeIndex + const TypeMultirangeType + const TypePolicy + const TypePublication + const TypeRole + const TypeSchema + const TypeSequence + const TypeStatistic + const TypeSubscription + const TypeTable + const TypeTrigger + const TypeType + const TypeUnknown + const TypeVectorIndex + const TypeView + type Operation string + const OpAlter + const OpComment + const OpCreate + const OpDelete + const OpDrop + const OpGrant + const OpInsert + const OpRevoke + const OpUpdate + type PostgreSQLTypeSystem struct + func NewPostgreSQLTypeSystem(version string) *PostgreSQLTypeSystem + func (pts *PostgreSQLTypeSystem) CheckTypeCompatibility(fromType, toType string) *TypeCompatibility + func (pts *PostgreSQLTypeSystem) GetCompositeTypeAttributes(typeName string) ([]Attribute, error) + func (pts *PostgreSQLTypeSystem) GetTypeSize(typeName string) (int, error) + func (pts *PostgreSQLTypeSystem) IsBuiltinType(typeName string) bool + func (pts *PostgreSQLTypeSystem) IsCompatibleArrayDimensions(from, to *ArrayType) bool + func (pts *PostgreSQLTypeSystem) ParseArrayType(typeSpec string) (*ArrayType, error) + func (pts *PostgreSQLTypeSystem) RegisterCompositeType(compositeType *CompositeType) + func (pts *PostgreSQLTypeSystem) RegisterCustomType(customType *CustomType) + func (pts *PostgreSQLTypeSystem) RegisterDomain(domain *Domain) + func (pts *PostgreSQLTypeSystem) RegisterEnumType(enumType *EnumType) + func (pts *PostgreSQLTypeSystem) ValidateEnumValue(enumTypeName, value string) error + type RangeType struct + Canonical string + Collation string + Name string + Schema string + SubType string + SubTypeDiff string + SubTypeOpClass string + type Statement struct + AlterTypeNewValue string + AuthPattern AuthPatternType + Category Category + Column int + Comments []string + CrossSchema []CrossSchemaRef + Dependencies []string + Filename string + Grantees []string + IfNotExists bool + IndexHadExplicitAccessMethod bool + IsDataOp bool + IsDynamic bool + Line int + Metadata StatementMetadata + ObjectName string + ObjectType ObjectType + Operation Operation + ParseTree *pg_query.ParseResult + Privileges []string + SQL string + Schema string + type StatementMetadata struct + Concurrent bool + ExecutionTime ExecutionTimeCategory + Idempotent bool + LockLevel LockLevel + PreserveVerbatim bool + RequiresNoTransaction bool + VersionGate string + type TypeAnalyzer struct + func NewTypeAnalyzer(typeSystem *PostgreSQLTypeSystem, db *sql.DB) *TypeAnalyzer + func (ta *TypeAnalyzer) AnalyzeMigrationTypes(ctx context.Context, statements []Statement) (*MigrationTypeAnalysis, error) + func (ta *TypeAnalyzer) AnalyzeStatement(ctx context.Context, sql string) ([]*TypeInfo, error) + func (ta *TypeAnalyzer) GenerateTypeConversion(ctx context.Context, fromType, toType string, columnName string) (*TypeConversion, error) + type TypeCategory int + const ArrayTypeCategory + const BaseType + const CompositeTypeCategory + const DomainType + const EnumTypeCategory + const PseudoType + const RangeTypeCategory + type TypeChange struct + Column string + DataLoss bool + FromType string + Reversible bool + Table string + ToType string + type TypeCompatibility struct + CastType CastType + CompatibilityLevel CompatibilityLevel + Compatible bool + FromType string + RequiresCast bool + ToType string + Warnings []string + type TypeConversion struct + ConversionSQL string + DataLoss bool + FromType string + LossDescription string + ReverseSQL string + Reversible bool + ToType string + Warnings []string + type TypeDependency struct + DependentType string + DependsOnType string + Optional bool + Relationship DependencyType + type TypeInfo struct + ArrayDims int + BaseType string + Category TypeCategory + Constraints []string + Dependencies []TypeDependency + ElementType string + IsArray bool + IsBuiltin bool + Length int + Modifiers []string + Name string + Precision int + Scale int + Schema string + Size int + UsageContext []UsageContext + type UsageContext struct + Constraints []string + Context ContextType + Location string + Required bool