package
25.1.0+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev
# Functions
AsZone returns a Zone corresponding to the provided ZoneConfig.
EmptyZone returns an empty Zone.
ExpandDataSourceGlob is a utility function that expands a tree.TablePattern into a list of object names.
FormatSequence nicely formats a catalog sequence using a treeprinter for debugging and testing.
FormatTable nicely formats a catalog table using a treeprinter for debugging and testing.
FormatView nicely formats a catalog view using a treeprinter for debugging and testing.
FormatZone nicely formats a catalog zone using a treeprinter for debugging and testing.
GetRowLevelTriggers returns the set of row-level triggers for the given table and given trigger event type and timing.
HasRowLevelTriggers returns true if the given table has any row-level triggers that match the given action time and event type.
IsMutationIndex is a convenience function that returns true if the index at the given ordinal position is a mutation index.
MaybeHidden is a helper constructor for either Visible or Hidden, depending on a flag.
MaybeMarkRedactable surrounds an unsafe string with redaction markers if markRedactable is true.
ResolveTableIndex resolves a TableIndexName.
ValidateCreateTrigger checks that the CREATE TRIGGER statement is valid.
# Constants
DefaultStableID is the uninitialized stable ID, used to represent an invalid or default state for catalog objects.
DeleteOnly columns are mutation columns that have to be updated only on deletes and cannot be otherwise accessed.
GeneratedAlwaysAsIdentity column is created with the GENERATED ALWAYS AS IDENTITY syntax.
GeneratedByDefaultAsIdentity column is created with the GENERATED BY DEFAULT AS IDENTITY syntax, which can be overwritten.
Hidden columns are visible to queries by name, but are not part of the star expansion (e.g.
Inaccessible columns are not visible to queries in any way.
Inverted columns are implicit columns that represent the keys of inverted indexes.
NotGeneratedAsIdentity column is created without the GENERATED {ALWAYS | BY DEFAULT} AS IDENTITY syntax.
Ordinary columns are "regular" table columns (including hidden columns like `rowid` and virtual computed columns).
PrimaryIndex selects the primary index of a table when calling the Table.Index method.
System columns are implicit columns that every physical table contains.
Visible columns are visible to queries and are part of the star expansion (e.g.
WriteOnly columns are mutation columns that have to be updated on writes (inserts, updates, deletes) and cannot be otherwise accessed.
# Structs
Column stores information about table columns, exposing only the information needed by the query optimizer.
DependencyDigest can be stored and confirm that all catalog objects resolved, at the current point in time will have the same version, stats, valid privileges, and name resolution.
FamilyColumn describes a single column that is part of a family definition.
Flags allows controlling aspects of some Catalog operations.
HistogramBucket contains the data for a single histogram bucket.
IndexColumn describes a single column that is part of an index definition.
# Interfaces
Catalog is an interface to a database catalog, exposing only the information needed by the query optimizer.
CheckConstraint represents a check constraint on a table.
Constraint governs placement of range replicas on nodes.
ConstraintSet is a set of constraints that apply to a range, restricting which nodes can host that range or stating which nodes are preferred as the leaseholder.
DataSource is an interface to a database object that provides rows, like a table, a view, or a sequence.
Family is an interface to a table column family, exposing only the information needed by the query optimizer.
ForeignKeyConstraint represents a foreign key constraint.
Index is an interface to a database index, exposing only the information needed by the query optimizer.
Object is implemented by all objects in the catalog.
Partition is an interface to a PARTITION BY LIST partition of an index.
ReplicaConstraints is a set of constraints that apply to one or more replicas of a range, restricting which nodes can host that range.
Schema is an interface to a database schema, which is a namespace that contains other database objects, like tables and views.
Sequence is an interface to a database sequence.
Subzone is an interface to zone configuration information that applies to either a SQL table index or a partition of a SQL table index.
Table is an interface to a database table, exposing only the information needed by the query optimizer.
TableStatistic is an interface to a table statistic.
Trigger is an interface to a trigger on a table or view, which executes a trigger function in response to a pre-defined mutation of the table.
UniqueConstraint represents a uniqueness constraint.
View is an interface to a database view, exposing only the information needed by the query optimizer.
Zone is an interface to zone configuration information used by the optimizer.
# Type aliases
ColumnKind differentiates between different kinds of table columns.
ColumnVisibility controls if a column is visible for queries and if it is part of the star expansion.
DataSourceName is an alias for tree.TableName, and is used for views and sequences as well as tables.
GeneratedAsIdentityType reflects how the creation of this column is associated with the GENERATED {ALWAYS | BY DEFAULT} AS IDENTITY syntax.
IndexOrdinal identifies an index (in the context of a Table).
IndexOrdinals identifies a list of indexes (in the context of a Table).
SchemaName is an alias for tree.ObjectNamePrefix, since it consists of the catalog + schema name.
StableID permanently and uniquely identifies a catalog object (table, view, index, column, etc.) within its scope:
data source StableID: unique within database index StableID: unique within table column StableID: unique within table
If a new catalog object is created, it will always be assigned a new StableID that has never, and will never, be reused by a different object in the same scope.
UniqueOrdinal identifies a unique constraint (in the context of a Table).
UniqueOrdinals identifies a list of unique constraints (in the context of a Table).