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

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Package doctor provides utilities for checking the consistency of cockroach internal persisted metadata.
No description provided by the author
No description provided by the author
No description provided by the author
Package faketreeeval provides fake implementations of tree eval interfaces.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Package oidext contains oids that are not in `github.com/lib/pq/oid` as they are not shipped by default with postgres.
Package opt contains the Cockroach SQL optimizer.
No description provided by the author
Package paramparse parses parameters that are set in param lists or session vars.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Package schemaexpr provides utilities for dealing with expressions with table schemas, such as check constraints, computed columns, and partial index predicates.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Package sqlerrors exports errors which can occur in the sql package.
Package sqlliveness provides interfaces to associate resources at the SQL level with tenant SQL processes.
Package sqltelemetry contains telemetry counter definitions for various SQL features.
Package sqltestutils provides helper methods for testing sql packages.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

ActivateTenant marks a tenant active.
AddPlanHook adds a hook used to short-circuit creating a planNode from a tree.Statement.
AlterColumnType takes an AlterTableAlterColumnType, determines which conversion to use and applies the type conversion.
BytesToClusterWideID converts raw bytes into a ClusterWideID.
ClearPlanHooks is used by tests to clear out any mocked out plan hooks that were registered.
ClearTableDataInChunks truncates the data of a table in chunks.
ClusterIsInternal returns true if the cluster organization contains "Cockroach Labs", indicating an internal cluster.
CopyInFileStmt creates a COPY FROM statement which can be used to upload files, and be prepared with Tx.Prepare().
CreateGCJobRecord creates the job record for a GC job, setting some properties which are common for all GC jobs.
CreateInheritedPrivilegesFromDBDesc creates privileges with the appropriate owner (node for system, the restoring user otherwise.).
CreatePartitioning constructs the partitioning descriptor for an index that is partitioned into ranges, each addressable by zone configs.
CreateTenantRecord creates a tenant in system.tenants.
CreateTestTableDescriptor converts a SQL string to a table for test purposes.
DestroyTenant marks the tenant as DROP.
DistIngest is used by IMPORT to run a DistSQL flow to ingest data by starting reader processes on many nodes that each read and ingest their assigned files and then send back a summary of what they ingested.
GCTenant clears the tenant's data and removes its record.
GenerateClusterWideID takes a timestamp and SQLInstanceID, and generates a ClusterWideID.
GenerateInvertedSpans constructs spans to scan the inverted index.
GenerateSubzoneSpans constructs from a TableDescriptor the entries mapping zone config spans to subzones for use in the SubzoneSpans field of zonepb.ZoneConfig.
GetUserHashedPassword determines if the given user exists and also returns a password retrieval function.
GetZoneConfigInTxn looks up the zone and subzone for the specified object ID, index, and partition.
HashForReporting 1-way hashes values for use in stat reporting.
IsOwner returns if the role has ownership on the descriptor.
IsPermanentSchemaChangeError returns true if the error results in a permanent failure of a schema change.
IsSessionVariableConfigurable returns true iff there is a session variable with the given name and it is settable by a client (e.g.
MakeBaseMemMetrics instantiates the metric objects for an SQL endpoint, but only includes the root metrics: .max and .current, without txn and session.
MakeDistSQLReceiver creates a DistSQLReceiver.
MakeEventLogger constructs a new EventLogger.
MakeIndexDescriptor creates an index descriptor from a CreateIndex node and optionally adds a hidden computed shard column (along with its check constraint) in case the index is hash sharded.
MakeInternalExecutor creates an InternalExecutor.
MakeMemMetrics instantiates the metric objects for an SQL endpoint.
MakePhysicalPlan returns a new PhysicalPlan.
MakeSequenceKeyVal returns the key and value of a sequence being set with newVal.
MakeStmtBufReader creates a StmtBufReader.
NewDistSQLPlanner initializes a DistSQLPlanner.
NewFakeSessionData returns "fake" session data for use in internal queries that are not run on behalf of a user session, such as those run during the steps of background jobs and schema changes.
NewInternalPlanner is an exported version of newInternalPlanner.
NewMetadataCallbackWriter creates a new MetadataCallbackWriter.
NewRowResultWriter creates a new RowResultWriter.
NewSchemaChangerForTesting only for tests.
NewSequenceTableDesc creates a sequence descriptor.
NewServer creates a new Server.
NewSessionRegistry creates a new SessionRegistry with an empty set of sessions.
NewStmtBuf creates a StmtBuf.
NewTableDesc creates a table descriptor from a CreateTable statement.
NewTemporaryObjectCleaner initializes the TemporaryObjectCleaner with the required arguments, but does not start it.
NewVirtualSchemaHolder creates a new VirtualSchemaHolder.
NormalizeAndValidateUsername case folds the specified username and verifies it validates according to the usernameRE regular expression.
NormalizeAndValidateUsernameNoBlocklist case folds the specified username and verifies it validates according to the usernameRE regular expression.
ParseHLC parses a string representation of an `hlc.Timestamp`.
PlanAndRunCTAS plans and runs the CREATE TABLE AS command.
RemoveIndexZoneConfigs removes the zone configurations for some indexs being dropped.
ResolveFK looks up the tables and columns mentioned in a `REFERENCES` constraint and adds metadata representing that constraint to the descriptor.
RevertTables reverts the passed table to the target time.
ScanMetaKVs returns the meta KVs for the ranges that touch the given span.
ShowCreatePartitioning returns a PARTITION BY clause for the specified index, if applicable.
ShowCreateSequence returns a valid SQL representation of the CREATE SEQUENCE statement used to create the given sequence.
ShowCreateTable returns a valid SQL representation of the CREATE TABLE statement used to create the given table.
ShowCreateView returns a valid SQL representation of the CREATE VIEW statement used to create the given view.
SimplifySerialInColumnDefWithRowID analyzes a column definition and simplifies any use of SERIAL as if SerialNormalizationMode was set to SerialUsesRowID.
StringToClusterWideID converts a string to a ClusterWideID.
TestingGetAllNames is a wrapper for getAllNames.
TestingOverrideExplainEnvVersion overrides the version reported by EXPLAIN (OPT, ENV).
TruncateInterleavedIndexes truncates the input set of indexes from the given table.
ValidateForwardIndexes checks that the indexes have entries for all the rows.
ValidateInvertedIndexes checks that the indexes have entries for all the items of data in rows.
WaitToUpdateLeases until the entire cluster has been updated to the latest version of the descriptor.
WithAnonymizedStatement attaches the anonymized form of a statement to an error object.

# Constants

Constants for the String() representation of the session states.
AuthAuditingClusterSettingName is the name of the cluster setting for the cluster setting that enables pgwire-level authentication audit logs.
Constants for the String() representation of the session states.
ConnAuditingClusterSettingName is the name of the cluster setting for the cluster setting that enables pgwire-level connection audit logs.
CrdbInternalName is the name of the crdb_internal schema.
DontNeedRowDesc specifies that a row description message is not needed.
EmptyTable represents an existing table that is empty.
EventLogAlterIndex is recorded when an index is altered.
EventLogAlterSequence is recorded when a sequence is altered.
EventLogAlterTable is recorded when a table is altered.
EventAlterType is recorded when a type is altered.
EventLogCommentOnColumn is recorded when a column is commented.
EventLogCommentOnTable is recorded when a table is commented.
EventLogCommentOnIndex is recorded when a index is commented.
EventLogCommentOnTable is recorded when a table is commented.
EventLogCreateDatabase is recorded when a database is created.
EventLogCreateIndex is recorded when an index is created.
EventLogCreateSequence is recorded when a sequence is created.
EventLogCreateStatistics is recorded when statistics are collected for a table.
EventLogCreateTable is recorded when a table is created.
EventLogCreateType is recorded when a type is created.
EventLogCreateView is recorded when a view is created.
EventLogDropDatabase is recorded when a database is dropped.
EventLogDropIndex is recorded when an index is dropped.
EventLogDropSchema is recorded when a schema is dropped.
EventLogDropSequence is recorded when a sequence is dropped.
EventLogDropTable is recorded when a table is dropped.
EventLogDropType is recorded when a type is dropped.
EventLogDropView is recorded when a view is dropped.
EventLogFinishSchemaChange is recorded when a previously initiated schema change has completed.
EventLogFinishSchemaRollback is recorded when a previously initiated schema change rollback has completed.
EventLogNodeDecommissioned is recorded when a node is marked as decommissioned.
EventLogNodeDecommissioned is recorded when a node is marked as decommissioning.
EventLogNodeJoin is recorded when a node joins the cluster.
EventLogNodeRecommissioned is recorded when a decommissioning node is recommissioned.
EventLogNodeRestart is recorded when an existing node rejoins the cluster after being offline.
EventLogRemoveZoneConfig is recorded when a zone config is removed.
EventLogReverseSchemaChange is recorded when an in-progress schema change encounters a problem and is reversed.
EventLogSetClusterSetting is recorded when a cluster setting is changed.
EventLogSetZoneConfig is recorded when a zone config is changed.
EventLogTruncateTable is recorded when a table is truncated.
EventLogUnsafeDeleteDescriptor is recorded when a descriptor is written using crdb_internal.unsafe_delete_descriptor.
EventLogUnsafeDeleteNamespaceEntry is recorded when a namespace entry is written using crdb_internal.unsafe_delete_namespace_entry.
EventLogUnsafeUpsertDescriptor is recorded when a descriptor is written using crdb_internal.unsafe_upsert_descriptor.
EventLogUnsafeUpsertNamespaceEntry is recorded when a namespace entry is written using crdb_internal.unsafe_upsert_namespace_entry.
ExperimentalDistSQLPlanningClusterSettingName is the name for the cluster setting that controls experimentalDistSQLPlanningClusterMode below.
FailedHashedValue is used as a default return value for when HashForReporting cannot hash a value correctly.
IdleTxnBlock means the session is outside of a transaction.
IncludeFkClausesInCreate will include foreign key information in the create statement, and error if a FK cannot be resolved.
InFailedTxnBlock means the session is inside a transaction, but the transaction is in the Aborted state.
Constants for the String() representation of the session states.
InTxnBlock means the session is inside a transaction.
KVStringOptValidate values.
KVStringOptValidate values.
KVStringOptValidate values.
MaxSQLBytes is the maximum length in bytes of SQL statements serialized into a serverpb.Session.
NeedRowDesc specifies that a row description message is needed.
NewTable represents a new table, where the FK constraint is specified in the CREATE TABLE.
NodeDistSQLVersionIncompatible means that the node should be avoided because it's DistSQL version is not compatible.
NodelocalFileUploadTable is used internally to identify a COPY initiated by nodelocal upload.
NodeOK means that the node can be used for planning.
NodeUnhealthy means that the node should be avoided because it's not healthy.
NonEmptyTable represents an existing non-empty table.
Constants for the String() representation of the session states.
OmitFKClausesFromCreate will not include any foreign key information in the create statement.
OmitMissingFKClausesFromCreate will include foreign key information only if they can be resolved.
Constants for the String() representation of the session states.
PgServerVersion is the latest version of postgres that we claim to support.
PgServerVersionNum is the latest version of postgres that we claim to support in the numeric format of "server_version_num".
PreparedStatementOriginSQL signifies the prepared statement was made over a parsed SQL query.
PreparedStatementOriginWire signifies the prepared statement was made over the wire.
ReorderJoinsLimitClusterSettingName is the name of the cluster setting for the maximum number of joins to reorder.
RevertTableDefaultBatchSize is the default batch size for reverting tables.
RunningStatusBackfill is for jobs that are currently running a backfill for a schema element.
RunningStatusDeleteAndWriteOnly is for jobs that are currently waiting on the cluster to converge to seeing the schema element in the DELETE_AND_WRITE_ONLY state.
RunningStatusDeleteOnly is for jobs that are currently waiting on the cluster to converge to seeing the schema element in the DELETE_ONLY state.
RunningStatusValidation is for jobs that are currently validating a schema element.
RunningStatusWaitingGC is for jobs that are currently in progress and are waiting for the GC interval to expire.
TemporarySchemaNameForRestorePrefix is the prefix name of the schema we synthesize during a full cluster restore.
UserFileUploadTable is used internally to identify a COPY initiated by userfile upload.
VectorizeClusterSettingName is the name for the cluster setting that controls the VectorizeClusterMode below.

# Variables

AlterColTypeInTxnNotSupportedErr is returned when an ALTER COLUMN TYPE is tried in an explicit transaction.
BoundTxnStateTransitions is the state machine used by the InternalExecutor when running SQL inside a higher-level txn.
ClusterOrganization is the organization name.
ClusterSecret is a cluster specific secret.
CreatePartitioningCCL is the public hook point for the CCL-licensed partitioning creation code.
DistSQLClusterExecMode controls the cluster default for when DistSQL is used.
DummyVars contains a list of dummy vars we do not support that PostgreSQL does, but are required as an easy fix to make certain tooling/ORMs work.
ErrLimitedResultClosed is a sentinel error produced by pgwire indicating the portal should be closed without error.
ErrLimitedResultNotSupported is an error produced by pgwire indicating an unsupported feature of row count limits was attempted.
MaxSQLStatReset is the cluster setting that controls at what interval SQL statement statistics must be flushed within.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Below are the metadata for the statement executed counters.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
Fully-qualified names for metrics.
NoticesEnabled is the cluster setting that allows users to enable notices.
PreservedSplitCountMultiple is the setting that configures the number of split points that we re-create on a table after a truncate.
ReorderJoinsLimitClusterValue controls the cluster default for the maximum number of joins reordered.
ReplicaOraclePolicy controls which policy the physical planner uses to choose a replica for a given range.
RoleOptionsTableName represents system.role_options.
SerialNormalizationMode controls how the SERIAL type is interpreted in table definitions.
SQLStatReset is the cluster setting that controls at what interval SQL statement statistics should be reset.
TempObjectCleanupInterval is a ClusterSetting controlling how often temporary objects get cleaned up.
TxnStateTransitions describe the transitions used by a connExecutor's fsm.Machine.
TxnStatsNumStmtIDsToRecord limits the number of statementIDs stored for in transactions statistics for a single transaction.
UnsupportedVars contains the set of PostgreSQL session variables and client parameters that are not supported in CockroachDB.
VectorizeClusterMode controls the cluster default for when automatic vectorization is enabled.
VectorizeRowCountThresholdClusterValue controls the cluster default for the vectorize row count threshold.

# Structs

BackupRestoreTestingKnobs contains knobs for backup and restore behavior.
BaseMemoryMetrics contains a max histogram and a current count of the bytes allocated by a sql endpoint.
BindStmt is the Command for creating a portal from a prepared statement.
ClusterWideID represents an identifier that is guaranteed to be unique across a cluster.
ConnectionHandler is the interface between the result of SetupConn and the ServeConn below.
CopyIn is the command for execution of the Copy-in pgwire subprotocol.
CreateRoleNode creates entries in the system.users table.
DeletePreparedStmt is the Command for freeing a prepared statement.
DescribeStmt is the Command for producing info about a prepared statement or portal.
DistSQLPlanner is used to generate distributed plans from logical plans.
DistSQLReceiver is a RowReceiver that writes results to a rowResultWriter.
DrainRequest represents a notice that the server is draining and command processing should stop soon.
DropRoleNode deletes entries from the system.users table.
EngineMetrics groups a set of SQL metrics.
An EventLogger exposes methods used to record events to the event table.
EventLogSetClusterSettingDetail is the json details for a settings change.
ExecPortal is the Command for executing a portal.
ExecStmt is the command for running a query sent through the "simple" pgwire protocol.
An ExecutorConfig encompasses the auxiliary objects and configuration required to create an executor.
ExecutorTestingKnobs is part of the context used to control parts of the system during testing.
Flush is a Command asking for the results of all previous commands to be delivered to the client.
GCJobTestingKnobs is for testing the Schema Changer GC job.
GrantRoleNode creates entries in the system.role_members table.
InternalExecutor can be used internally by code modules to execute SQL statements without needing to open a SQL connection.
InvalidIndexesError is used to represent indexes that failed revalidation.
MembershipCache is a shared cache for role membership information.
MemoryMetrics contains pointers to the metrics object for one of the SQL endpoints: - "client" for connections received via pgwire.
MetadataCallbackWriter wraps a rowResultWriter to stream metadata in a DistSQL flow.
Metrics collects timeseries data about SQL activity.
NamespaceKey represents a key from the namespace table.
NodeInfo contains metadata about the executing node and cluster.
PGWireTestingKnobs contains knobs for the pgwire module.
PhysicalPlan is a partial physical plan which corresponds to a planNode (partial in that it can correspond to a planNode subtree and not necessarily to the entire planNode for a given query).
PlanningCtx contains data used and updated throughout the planning process of a single query.
PreparedPortal is a PreparedStatement that has been bound with query arguments.
PreparedStatement is a SQL statement that has been parsed and the types of arguments and results have been determined.
PrepareStmt is the command for creating a prepared statement.
RevokeRoleNode removes entries from the system.role_members table.
RowResultWriter is a thin wrapper around a RowContainer.
SchemaChanger is used to change the schema on a table.
SchemaChangerTestingKnobs for testing the schema change execution path through both the synchronous and asynchronous paths.
SendError is a command that, upon execution, send a specific error to the client.
Server is the top level singleton for handling SQL connections.
SessionArgs contains arguments for serving a client connection.
SessionRegistry stores a set of all sessions on this node.
SessionTracing holds the state used by SET TRACING {ON,OFF,LOCAL} statements in the context of one SQL session.
ShowCreateDisplayOptions is a container struct holding the options that ShowCreate uses to determine how much information should be included in the CREATE statement.
SpanPartition is the intersection between a set of spans for a certain operation (e.g table scan) and the set of ranges owned by a given node.
Statement contains a statement with optional expected result columns and metadata.
StatementCounters groups metrics for counting different types of statements.
StmtBuf maintains a list of commands that a SQL client has sent for execution over a network connection.
StmtBufReader is an exported interface for reading a StmtBuf.
Sync is a command that serves two purposes: 1) It marks the end of one batch of commands and the beginning of the next.
TemporaryObjectCleaner is a background thread job that periodically cleans up orphaned temporary objects by sessions which did not close down cleanly.
TenantTestingKnobs contains knobs for tenant behavior.
TypeSchemaChangerTestingKnobs contains testing knobs for the typeSchemaChanger.
VirtualSchemaHolder is a type used to provide convenient access to virtual database and table descriptors.

# Interfaces

AuthorizationAccessor for checking authorization (e.g.
BindResult represents the result of a Bind command.
ClientComm is the interface used by the connExecutor for creating results to be communicated to client and for exerting some control over this communication.
ClientLock is an interface returned by ClientComm.lockCommunication().
Command is an interface implemented by all commands pushed by pgwire into the buffer.
CommandResult represents the result of a statement.
CommandResultClose is a subset of CommandResult dealing with the closing of the result.
CommandResultErrBase is the subset of CommandResult dealing with setting a query execution error.
CopyInResult represents the result of a CopyIn command.
DeleteResult represents the result of a DeletePreparedStatement command.
DescribeResult represents the result of a Describe command (for either describing a prepared statement or a portal).
DrainResult represents the result of a Drain command.
EmptyQueryResult represents the result of an empty query (a query representing a blank string).
ErrorResult represents the result of a SendError command.
FlushResult represents the result of a Flush command.
MetadataResultWriter is used to stream metadata rather than row results in a DistSQL flow.
ParseResult represents the result of a Parse command.
PlanHookState exposes the subset of planner needed by plan hooks.
RestrictedCommandResult is a subset of CommandResult meant to make it clear that its clients don't close the CommandResult.
ResultBase is the common interface implemented by all the different command results.
StmtDiagnosticsRecorder is the interface into *stmtdiagnostics.Registry to record statement diagnostics.
SyncResult represents the result of a Sync command.
VirtualTabler is used to fetch descriptors for virtual tables and databases.

# Type aliases

CmdPos represents the index of a command relative to the start of a connection.
EventLogType represents an event type that can be recorded in the event log.
FKTableState is the state of the referencing table ResolveFK() is called on.
HistoricalInternalExecTxnRunner is like historicalTxnRunner except it only passes the fn the exported InternalExecutor instead of the whole unexported extendedEvalContenxt, so it can be implemented outside pkg/sql.
InternalExecFn is the type of functions that operates using an internalExecutor.
KVStringOptValidate indicates the requested validation of a TypeAsStringOpts option.
NodeStatus represents a node's health and compatibility in the context of physical planning for a query.
PlanHookRowFn describes the row-production for hook-created plans.
PlanNode is the exported name for planNode.
PreparedStatementOrigin is an enum representing the source of where the prepare statement was made.
ReqOrdering is the ordering that must be preserved by an operator when it is distributed.
RowDescOpt specifies whether a result needs a row description message.
SessionDefaults mirrors fields in Session, for restoring default configuration values in SET ..
StatementFilter is the type of callback that ExecutorTestingKnobs.StatementFilter takes.
StmtDiagnosticsTraceFinishFunc is the type of function returned from ShouldCollectDiagnostics to report the outcome of a trace.
TransactionStatusIndicator represents a pg identifier for the transaction state.