Updated
On this page
Package risk provides shared risk classification for schema change operations, categorizing DDL statements by safety level for diff and migrate.
#internal/risk
#internal/risk
Package risk provides shared risk classification for schema change operations, categorizing DDL statements by safety level for diff and migrate.
#Safe
go
const Safe RiskLevel = iota#Caution
go
const Caution RiskLevel = iota#Dangerous
go
const Dangerous RiskLevel = iota#LockNone
go
const LockNone LockType = iota#LockShareLock
go
const LockShareLock LockType = iota#LockShareRowExclusive
go
const LockShareRowExclusive LockType = iota#LockShareUpdateExclusive
go
const LockShareUpdateExclusive LockType = iota#LockAccessExclusive
go
const LockAccessExclusive LockType = iota#OpCreateTable
go
const OpCreateTable OpType = "create_table"#OpDropTable
go
const OpDropTable OpType = "drop_table"#OpAddColumn
go
const OpAddColumn OpType = "add_column"#OpDropColumn
go
const OpDropColumn OpType = "drop_column"#OpAlterColumnType
go
const OpAlterColumnType OpType = "alter_column_type"#OpSetNotNull
go
const OpSetNotNull OpType = "set_not_null"#OpDropNotNull
go
const OpDropNotNull OpType = "drop_not_null"#OpAddFK
go
const OpAddFK OpType = "add_fk"#OpAddFKNotValid
go
const OpAddFKNotValid OpType = "add_fk_not_valid"#OpValidateConstraint
go
const OpValidateConstraint OpType = "validate_constraint"#OpCreateIndex
go
const OpCreateIndex OpType = "create_index"#OpCreateIndexConcurrently
go
const OpCreateIndexConcurrently OpType = "create_index_concurrently"#OpDropIndex
go
const OpDropIndex OpType = "drop_index"#OpDropIndexConcurrently
go
const OpDropIndexConcurrently OpType = "drop_index_concurrently"#OpRenameTable
go
const OpRenameTable OpType = "rename_table"#OpRenameColumn
go
const OpRenameColumn OpType = "rename_column"#OpAlterEnumAddValue
go
const OpAlterEnumAddValue OpType = "alter_enum_add_value"#OpAddUnique
go
const OpAddUnique OpType = "add_unique"#OpDropUnique
go
const OpDropUnique OpType = "drop_unique"#OpAddCheck
go
const OpAddCheck OpType = "add_check"#OpDropCheck
go
const OpDropCheck OpType = "drop_check"#OpAddExclusion
go
const OpAddExclusion OpType = "add_exclusion"#OpDropExclusion
go
const OpDropExclusion OpType = "drop_exclusion"#OpAlterIndexSet
go
const OpAlterIndexSet OpType = "alter_index_set"#OpCreateView
go
const OpCreateView OpType = "create_view"#OpDropView
go
const OpDropView OpType = "drop_view"#OpCreateOrReplaceView
go
const OpCreateOrReplaceView OpType = "create_or_replace_view"#OpCreateMaterializedView
go
const OpCreateMaterializedView OpType = "create_materialized_view"#OpDropMaterializedView
go
const OpDropMaterializedView OpType = "drop_materialized_view"#OpRefreshMaterializedView
go
const OpRefreshMaterializedView OpType = "refresh_materialized_view"#OpCreateSequence
go
const OpCreateSequence OpType = "create_sequence"#OpDropSequence
go
const OpDropSequence OpType = "drop_sequence"#OpAlterSequence
go
const OpAlterSequence OpType = "alter_sequence"#OpCreateEnum
go
const OpCreateEnum OpType = "create_enum"#OpCreateCompositeType
go
const OpCreateCompositeType OpType = "create_composite_type"#OpDropCompositeType
go
const OpDropCompositeType OpType = "drop_composite_type"#OpCreateDomain
go
const OpCreateDomain OpType = "create_domain"#OpDropDomain
go
const OpDropDomain OpType = "drop_domain"#OpAlterDomain
go
const OpAlterDomain OpType = "alter_domain"#OpCreateFunction
go
const OpCreateFunction OpType = "create_function"#OpDropFunction
go
const OpDropFunction OpType = "drop_function"#OpCreateOrReplaceFunction
go
const OpCreateOrReplaceFunction OpType = "create_or_replace_function"#OpCreateTrigger
go
const OpCreateTrigger OpType = "create_trigger"#OpDropTrigger
go
const OpDropTrigger OpType = "drop_trigger"#OpCreatePolicy
go
const OpCreatePolicy OpType = "create_policy"#OpDropPolicy
go
const OpDropPolicy OpType = "drop_policy"#OpAlterPolicy
go
const OpAlterPolicy OpType = "alter_policy"#OpEnableRLS
go
const OpEnableRLS OpType = "enable_rls"#OpDisableRLS
go
const OpDisableRLS OpType = "disable_rls"#OpForceRLS
go
const OpForceRLS OpType = "force_rls"#OpNoForceRLS
go
const OpNoForceRLS OpType = "no_force_rls"#OpCreatePartmanParent
go
const OpCreatePartmanParent OpType = "create_partman_parent"#OpUpdatePartmanRetention
go
const OpUpdatePartmanRetention OpType = "update_partman_retention"#OpUpdatePartmanPremake
go
const OpUpdatePartmanPremake OpType = "update_partman_premake"#RiskLevel
go
type RiskLevel intRiskLevel represents the safety level of a schema operation.
#LockType
go
type LockType intLockType represents the PostgreSQL lock level required by an operation.
#OpType
go
type OpType stringOpType identifies a schema change operation.
#OpContext
go
type OpContext structOpContext provides context about the operation environment for risk assessment.
#Classification
go
type Classification structClassification is the risk assessment result for a schema operation.
#Classify
go
func Classify(op OpType, ctx OpContext) ClassificationClassify assesses the risk of a schema operation given its context.
#RiskLevel.String
go
func (r RiskLevel) String() string#LockType.String
go
func (l LockType) String() string