package
20.2.19+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev
# Functions
CannotWriteToComputedColError constructs a write error for a computed column.
DequalifyAndValidateExpr 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.
FormatIndexForDisplay formats a column descriptor as a SQL string.
MakeCheckConstraintBuilder returns a CheckConstraintBuilder struct that can be used to build descpb.TableDescriptor_CheckConstraints.
MakeComputedColumnValidator returns an ComputedColumnValidator struct that can be used to validate computed columns.
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.
MakeIndexPredicateValidator returns an IndexPredicateValidator struct that can be used to validate partial index predicates.
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.
MakeTableColSet returns a set initialized with the given values.
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.
ProcessColumnSet returns columns in cols, and other writable columns in tableDesc that fulfills a given criteria in inSet.
RemapIVarsInTypedExpr remaps tree.IndexedVars in expr using indexVarMap.
RenameColumn replaces any occurrence of the column from in expr with to, and returns a string representation of the new expression.
ResolveNamesUsingVisitor resolves the names in the given expression.
RunFilter runs a filter expression and returns whether the filter passes.
SanitizeVarFreeExpr verifies that an expression is valid, has the correct type and contains no variable expressions.
# Structs
CheckConstraintBuilder creates descpb.TableDescriptor_CheckConstraints from tree.CheckConstraintTableDefs.
ComputedColumnValidator validates that an expression is a valid computed column.
IndexPredicateValidator validates that an expression is a valid partial index predicate.
NameResolutionVisitor is a tree.Visitor implementation used to resolve the column names in an expression.
RowIndexedVarContainer is used to evaluate expressions over various rows.
TableColSet efficiently stores an unordered set of column ids.
# Type aliases
ComputedColumnRewritesMap stores a map of computed column expression rewrites.