pgdesign v0.26.0 /internal/risk
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 go
const Safe      RiskLevel = iota

#Caution

Go go
const Caution   RiskLevel = iota

#Dangerous

Go go
const Dangerous RiskLevel = iota

#LockNone

Go go
const LockNone                 LockType = iota

#LockShareLock

Go go
const LockShareLock            LockType = iota

#LockShareRowExclusive

Go go
const LockShareRowExclusive    LockType = iota

#LockShareUpdateExclusive

Go go
const LockShareUpdateExclusive LockType = iota

#LockAccessExclusive

Go go
const LockAccessExclusive      LockType = iota

#OpCreateTable

Go go
const OpCreateTable             OpType = "create_table"

#OpDropTable

Go go
const OpDropTable               OpType = "drop_table"

#OpAddColumn

Go go
const OpAddColumn               OpType = "add_column"

#OpDropColumn

Go go
const OpDropColumn              OpType = "drop_column"

#OpAlterColumnType

Go go
const OpAlterColumnType         OpType = "alter_column_type"

#OpSetNotNull

Go go
const OpSetNotNull              OpType = "set_not_null"

#OpDropNotNull

Go go
const OpDropNotNull             OpType = "drop_not_null"

#OpAddFK

Go go
const OpAddFK                   OpType = "add_fk"

#OpAddFKNotValid

Go go
const OpAddFKNotValid           OpType = "add_fk_not_valid"

#OpValidateConstraint

Go go
const OpValidateConstraint      OpType = "validate_constraint"

#OpCreateIndex

Go go
const OpCreateIndex             OpType = "create_index"

#OpCreateIndexConcurrently

Go go
const OpCreateIndexConcurrently OpType = "create_index_concurrently"

#OpDropIndex

Go go
const OpDropIndex               OpType = "drop_index"

#OpDropIndexConcurrently

Go go
const OpDropIndexConcurrently   OpType = "drop_index_concurrently"

#OpRenameTable

Go go
const OpRenameTable             OpType = "rename_table"

#OpRenameColumn

Go go
const OpRenameColumn            OpType = "rename_column"

#OpAlterEnumAddValue

Go go
const OpAlterEnumAddValue       OpType = "alter_enum_add_value"

#OpAddUnique

Go go
const OpAddUnique               OpType = "add_unique"

#OpDropUnique

Go go
const OpDropUnique              OpType = "drop_unique"

#OpAddCheck

Go go
const OpAddCheck                OpType = "add_check"

#OpDropCheck

Go go
const OpDropCheck               OpType = "drop_check"

#OpAddExclusion

Go go
const OpAddExclusion            OpType = "add_exclusion"

#OpDropExclusion

Go go
const OpDropExclusion           OpType = "drop_exclusion"

#OpAlterIndexSet

Go go
const OpAlterIndexSet           OpType = "alter_index_set"

#OpCreateView

Go go
const OpCreateView              OpType = "create_view"

#OpDropView

Go go
const OpDropView                OpType = "drop_view"

#OpCreateOrReplaceView

Go go
const OpCreateOrReplaceView     OpType = "create_or_replace_view"

#OpCreateMaterializedView

Go go
const OpCreateMaterializedView  OpType = "create_materialized_view"

#OpDropMaterializedView

Go go
const OpDropMaterializedView    OpType = "drop_materialized_view"

#OpRefreshMaterializedView

Go go
const OpRefreshMaterializedView OpType = "refresh_materialized_view"

#OpCreateSequence

Go go
const OpCreateSequence          OpType = "create_sequence"

#OpDropSequence

Go go
const OpDropSequence            OpType = "drop_sequence"

#OpAlterSequence

Go go
const OpAlterSequence           OpType = "alter_sequence"

#OpCreateEnum

Go go
const OpCreateEnum              OpType = "create_enum"

#OpCreateCompositeType

Go go
const OpCreateCompositeType     OpType = "create_composite_type"

#OpDropCompositeType

Go go
const OpDropCompositeType       OpType = "drop_composite_type"

#OpCreateDomain

Go go
const OpCreateDomain            OpType = "create_domain"

#OpDropDomain

Go go
const OpDropDomain              OpType = "drop_domain"

#OpAlterDomain

Go go
const OpAlterDomain             OpType = "alter_domain"

#OpCreateFunction

Go go
const OpCreateFunction          OpType = "create_function"

#OpDropFunction

Go go
const OpDropFunction            OpType = "drop_function"

#OpCreateOrReplaceFunction

Go go
const OpCreateOrReplaceFunction OpType = "create_or_replace_function"

#OpCreateTrigger

Go go
const OpCreateTrigger OpType = "create_trigger"

#OpDropTrigger

Go go
const OpDropTrigger   OpType = "drop_trigger"

#OpCreatePolicy

Go go
const OpCreatePolicy OpType = "create_policy"

#OpDropPolicy

Go go
const OpDropPolicy   OpType = "drop_policy"

#OpAlterPolicy

Go go
const OpAlterPolicy  OpType = "alter_policy"

#OpEnableRLS

Go go
const OpEnableRLS    OpType = "enable_rls"

#OpDisableRLS

Go go
const OpDisableRLS   OpType = "disable_rls"

#OpForceRLS

Go go
const OpForceRLS     OpType = "force_rls"

#OpNoForceRLS

Go go
const OpNoForceRLS   OpType = "no_force_rls"

#OpCreatePartmanParent

Go go
const OpCreatePartmanParent    OpType = "create_partman_parent"

#OpUpdatePartmanRetention

Go go
const OpUpdatePartmanRetention OpType = "update_partman_retention"

#OpUpdatePartmanPremake

Go go
const OpUpdatePartmanPremake   OpType = "update_partman_premake"

#RiskLevel

Go go
type RiskLevel int

RiskLevel represents the safety level of a schema operation.

#LockType

Go go
type LockType int

LockType represents the PostgreSQL lock level required by an operation.

#OpType

Go go
type OpType string

OpType identifies a schema change operation.

#OpContext

Go go
type OpContext struct

OpContext provides context about the operation environment for risk assessment.

#Classification

Go go
type Classification struct

Classification is the risk assessment result for a schema operation.

#Classify

Go go
func Classify(op OpType, ctx OpContext) Classification

Classify assesses the risk of a schema operation given its context.

#RiskLevel.String

Go go
func (r RiskLevel) String() string

#LockType.String

Go go
func (l LockType) String() string
Search