package
25.1.0+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev

# Functions

AssignSequenceOptions moves options from the AST node to the sequence options descriptor, starting with defaults and overriding them with user-provided options.
CannotWriteToComputedColError constructs a write error for a computed column.
DequalifyAndValidateExpr is a convenience function to DequalifyAndValidateExprImpl.
DequalifyAndValidateExprImpl validates that an expression has the given type and contains no functions with a volatility greater than maxVolatility.
DequalifyColumnRefs returns a serialized expression with database and table names stripped from qualified column names.
ExtractColumnIDs returns the set of column IDs within the given expression.
FormatColumnForDisplay formats a column descriptor as a SQL string.
FormatExprForDisplay formats a schema expression string for display.
FormatExprForExpressionIndexDisplay formats an expression index's expression element string for display.
GetSeqIDFromExpr takes an expr and looks for a sequence ID in this expr.
GetUDFIDs extracts all UDF descriptor ids from the given expression, assuming that the UDF names has been replaced with OID references.
GetUDFIDsFromExprStr extracts all UDF descriptor ids from the given expression string, assuming that the UDF names has been replaced with OID references.
HasValidColumnReferences returns true if all columns referenced in rootExpr exist in desc.
MakeCheckConstraintBuilder returns a CheckConstraintBuilder struct that can be used to build descpb.TableDescriptor_CheckConstraints.
MakeComputedExprs returns a slice of the computed expressions for the slice of input column descriptors, or nil if none of the input column descriptors have computed expressions.
MakeDefaultExprs returns a slice of the default expressions for the slice of input column descriptors, or nil if none of the input column descriptors have default expressions.
MakeHashShardComputeExpr creates the serialized computed expression for a hash shard column based on the column names and the number of buckets.
MakePartialIndexExpr is like MakePartialIndexExprs but for a single partial index using all public columns of the table.
MakePartialIndexExprs returns a map of predicate expressions for each partial index in the input list of indexes, or nil if none of the indexes are partial indexes.
MaybeRewriteComputedColumn consults the experimental_computed_column_rewrites session setting; if the given expression matches a "before expression" in the setting, it is replaced to the corresponding "after expression".
ParseComputedColumnRewrites parses a string of the form: (before expression) -> (after expression) [, (before expression) -> (after expression) ...] into a ComputedColumnRewritesMap.
ParseSequenceOpts is to transform the sequence options saved the descriptor to a descpb.TableDescriptor_SequenceOpts.
ParseTriggerWhenExprForDisplay parses a trigger WHEN expression and rewrites the resulting expression to be suitable for display.
ProcessColumnSet returns columns in cols, and other writable columns in tableDesc that fulfills a given criteria in inSet.
RenameColumn replaces any occurrence of the column from in expr with to, and returns a string representation of the new expression.
ReplaceColumnVars replaces the occurrences of column names in an expression with dummyColumns containing their type, so that they may be type-checked.
ReplaceSequenceIDsWithFQNames walks the given expr and replaces occurrences of regclass IDs in the expr with the descriptor's fully qualified name.
SanitizeVarFreeExpr verifies that an expression is valid, has the correct type and contains no variable expressions.
ValidateColumnHasNoDependents verifies that the input column has no dependent computed columns.
ValidateComputedColumnExpression verifies that an expression is a valid computed column expression.
ValidateComputedColumnExpressionDoesNotDependOnColumn verifies that the expression of a computed column does not depend on the given column.
ValidatePartialIndex verifies that we have no partial indexes that reference the column through the partial index's predicate.
ValidatePartialIndexPredicate verifies that an expression is a valid partial index predicate.
ValidateTTLExpirationExpression verifies that the ttl_expiration_expression, if any, is valid according to the following rules: * type-checks as a TIMESTAMPTZ.
ValidateTTLExpression verifies that the ttl_expiration_expression, if any, does not reference the given column.
ValidateUniqueWithoutIndexPredicate verifies that an expression is a valid unique without index predicate.

# Structs

CheckConstraintBuilder creates descpb.TableDescriptor_CheckConstraints from tree.CheckConstraintTableDefs.
RowIndexedVarContainer is used to evaluate expressions over various rows.

# Type aliases

ComputedColumnRewritesMap stores a map of computed column expression rewrites.