package
25.1.0+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev
# Packages
Package colconv exposes utilities for working with vectorized columns.
Package colfetcher implements logic for fetching kv's and forming table rows for an arbitrary number of tables.
Package decodeusername contains utilities for decoding usernames from their specs as defined in tree.
Package doctor provides utilities for checking the consistency of cockroach internal persisted metadata.
Package evalcatalog provides the concrete implementation of eval.CatalogBuiltins.
Package execinfra contains the common interfaces for colexec and rowexec.
Package exprutil contains tools for type checking and evaluating expressions.
Package faketreeeval provides fake implementations of tree eval interfaces.
Package isql provides interfaces for interacting with the database using SQL from within the database itself.
Package lexbase contains utilities for lexing sql.
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.
Package paramparse provides utilities for parsing storage paramaters.
Package parser contains exposes a SQL parser for cockroach.
Package privilege outlines the basic privilege system for cockroach.
Package randgen provides utility functions for generating random syntax trees,
datums, encoded datums, types, and more.
Package regions provides infrastructure to retrieve the regions available to a tenant.
Package rowinfra contains constants and types used by the row package that must also be accessible from other packages.
schemachange contains utilities describing type conversions.
Package sqlerrors exports errors which can occur in the sql package.
Package sqlfsm contains the definitions for the state labels of the conn executor FSM.
Package sqlinstance provides interfaces that will be exposed to interact with the sqlinstance subsystem.
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.
Package storageparam defines interfaces and functions for setting and resetting storage parameters.
# Functions
ActivateRestoredTenant marks a restored 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.
ApplyZoneConfigForMultiRegionTable applies zone config settings based on the options provided.
ApplyZoneConfigFromDatabaseRegionConfig applies a zone configuration to the database using the information in the supplied RegionConfig.
BootstrapTenant bootstraps the span of the newly created tenant identified in the passed tenant info using the passed zone config.
CheckClusterRegionIsLive checks whether a region supplied is one of the currently active cluster regions.
CheckDestinationPrivileges iterates over the External Storage URIs and ensures the user has adequate privileges to use each of them.
CheckSessionVariableValueValid returns an error if the value is not valid for the given variable.
ClearPlanHooks is used by tests to clear out any mocked out plan hooks that were registered.
ClosestInstances returns the subset of instances which are closest to the passed locality, i.e.
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().
CreateEnumTypeDesc creates a new enum type descriptor.
CreateGCJobRecord creates the job record for a GC job, setting some properties which are common for all GC jobs.
CreatePartitioning returns a set of implicit columns and a new partitioning descriptor to build an index with partitioning fields populated to align with the tree.PartitionBy clause.
CreateRowLevelTTLScheduledJob creates a new row-level TTL schedule.
CreateSchemaDescriptorWithPrivileges creates a new schema descriptor with the provided name and privileges.
CreateTenantRecord creates a tenant in system.tenants and installs an initial span config (in system.span_configurations) for it.
CreateTestTableDescriptor converts a SQL string to a table for test purposes.
CreateUserDefinedArrayTypeDesc creates a type descriptor for the array of the given user-defined type.
CreateUserDefinedSchemaDescriptor constructs a mutable schema descriptor.
DecodeCopy unescapes a single COPY field.
DeleteSchedule deletes specified schedule.
DeleteTableDescAndZoneConfig removes a table's descriptor and zone config from the KV database.
DeleteTableWithPredicate issues a series of point and range tombstones over a subset of keys in a table that match the passed-in predicate.
DescsTxn is a convenient method for running a transaction on descriptors when you have an ExecutorConfig.
EmptySystemTenantOnly returns a SystemTenantOnly where SystemTenantOnly.Get returns an error.
EncodeCopy escapes a single COPY field.
EnsureUserOnlyBelongsToRoles grants all the roles in `roles` to `user` and, revokes all other roles.
FinalizePlan adds a final "result" stage and a final projection if necessary as well as populates the endpoints of the plan.
GCTenantSync clears the tenant's data and removes its record.
GenerateSubzoneSpans constructs from a TableDescriptor the entries mapping zone config spans to subzones for use in the SubzoneSpans field of zonepb.ZoneConfig.
GetAllNonDropTenantIDs returns all tenants in the system table, excluding those in the DROP state.
GetExtendedTenantInfo hydrates a TenantInfoWithUsage with the additional data beyond the TenantInfo record.
GetHydratedZoneConfigForDatabase returns a fully hydrated zone config for a given database ID.
GetHydratedZoneConfigForNamedZone returns a zone config for the given named zone.
GetHydratedZoneConfigForTable returns a fully hydrated zone config for a given table ID.
GetHydratedZoneConfigForTenantsRange returns the zone config for RANGE TENANTS.
GetInternalOpName returns the "opName" parameter that was specified when issuing a query via the Internal Executor.
GetLiveClusterRegions returns a set of live region names in the cluster.
GetLocalityRegionEnumPhysicalRepresentation returns the physical representation of the given locality stored in the multi-region enum type associated with dbID.
GetRegionEnumRepresentations returns representations stored in the multi-region enum type associated with dbID, and the primary region of it.
GetSequenceDescFromIdentifier resolves the sequence descriptor for the given sequence identifier.
GetTenantRecordByID retrieves a tenant in system.tenants.
GetTenantRecordByName retrieves a tenant with the provided name from system.tenants.
GetUserSessionInitInfo determines if the given user exists and also returns a password retrieval function, other authentication-related information, and default session variable settings that are to be applied before a SQL session is created.
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.
HasVirtualUniqueConstraints returns true if the table has one or more constraints that are validated by RevalidateUniqueConstraintsInTable.
InsertEventRecords inserts events into the event log as part of the provided transaction, using the provided internal executor.
IsConstraintError returns true if the error is considered as an error introduced by the user.
IsCustomOptionSessionVariable returns whether the given varName is a custom session variable.
IsInsufficientPrivilegeError returns true if the error is a pgerror with code pgcode.InsufficientPrivilege.
IsMaybeHashedOid returns if the OID value is possibly a hashed value.
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.
JobSchedulerEnv returns JobSchedulerEnv.
LogEventForJobs emits a cluster event in the context of a job.
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.
MakeInternalExecutor creates an InternalExecutor.
MakeInternalExecutorMemMonitor creates and starts memory monitor for an InternalExecutor.
MakeJobExecContext makes a JobExecContext.
MakeMemMetrics instantiates the metric objects for an SQL endpoint.
MakeSequenceKeyVal returns the key and value of a sequence being set with newVal.
MakeSpanPartitionWithRangeCount constructs a SpanPartition with the specified count of ranges.
MakeStmtBufReader creates a StmtBufReader.
MakeSystemTenantOnly returns a SystemTenantOnly where SystemTenantOnly.Get returns t.
MaybeConvertStoredPasswordHash attempts to convert a stored hash to match the current server.user_login.password_encryption setting.
MaybeHashAppName returns the provided app name, possibly hashed.
measurePlanChange computes the number of node changes (addition or removal) in the source and destination clusters as a fraction of the total number of nodes in both clusters in the previous plan.
MemberOfWithAdminOption looks up all the roles 'member' belongs to (direct and indirect) and returns a map of "role" -> "isAdmin".
NewCallbackResultWriter creates a new CallbackResultWriter.
NewClosedSessionCache returns a new ClosedSessionCache.
NewDistSQLPlanner initializes a DistSQLPlanner.
NewIndexBackfiller creates a new IndexBackfillPlanner.
NewIndexBackfillerMergePlanner creates a new IndexBackfillerMergePlanner.
NewIndexMergeTracker creates a new IndexMergeTracker.
NewIndexSplitAndScatter creates a new scexec.IndexSpanSplitter implementation.
NewInternalDB returns a new InternalDB.
NewInternalDBWithSessionDataOverrides creates a new DB that wraps the given DB and customizes the session data.
NewInternalPlanner is an exported version of newInternalPlanner.
NewInternalSessionData returns a 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.
NewMetadataCallbackWriter creates a new MetadataCallbackWriter.
NewMetadataOnlyMetadataCallbackWriter creates a new MetadataCallbackWriter that uses errOnlyResultWriter and only supports receiving execinfrapb.ProducerMetadata.
NewReferenceProviderFactory returns a new ReferenceProviderFactory.
NewReferenceProviderFactoryForTest returns a new ReferenceProviderFactory only for test.
NewRowMetrics creates a rowinfra.Metrics struct for either internal or user queries.
NewRowResultWriter creates a new RowResultWriter.
NewSchemaChangerBuildEventLogger returns a scbuild.EventLogger implementation.
NewSchemaChangerForTesting only for tests.
NewSchemaChangerMetrics constructs a new SchemaChangerMetrics.
NewSchemaChangerRunEventLogger returns a scrun.EventLogger implementation.
NewSequenceTableDesc creates a sequence descriptor.
NewServer creates a new Server.
NewSessionRegistry creates a new SessionRegistry with an empty set of sessions.
NewShimInternalDB is used to bootstrap the server which needs access to components which will ultimately have a handle to an InternalDB.
NewSkippingCacheSchemaResolver constructs a schemaResolver which always skip descriptor cache.
NewStmtBuf creates a StmtBuf.
NewTableDesc creates a table descriptor from a CreateTable statement.
NewTableDescOptionBypassLocalityOnNonMultiRegionDatabaseCheck will allow LOCALITY on non multi-region tables.
NewTemporaryObjectCleaner initializes the TemporaryObjectCleaner with the required arguments, but does not start it.
NewTxnFingerprintIDCache returns a new TxnFingerprintIDCache.
NewVirtualSchemaHolder creates a new VirtualSchemaHolder.
NumRangesInSpanContainedBy returns the number of ranges that covers a span and how many of those ranged are wholly contained in containedBy.
NumRangesInSpans returns the number of ranges that cover a set of spans.
PhysicalPlanChangeChecker returns a function which will periodically call the passed function at the requested interval until the returned channel is closed and compare the plan it returns to the passed initial plan, returning an error if it has changed (as defined by CalculatePlanGrowth) by more than the passed threshold.
PlanAndRunCTAS plans and runs the CREATE TABLE AS command.
PlanCDCExpression plans the execution of CDCExpression.
RemoveIndexZoneConfigs removes the zone configurations for some indexes being dropped.
ReplacePlaceholdersWithValuesForBundle takes the contents of statement.sql from the bundle and substitutes all placeholders with their values.
ReplanOnChangedFraction returns a PlanChangeDecision that returns true when a new plan has a number of instances that would be assigned new or changed processors exceeding the passed fraction of the old plan's total instances.
ReplanOnCustomFunc returns a PlanChangeDecision that returns true when a new plan is sufficiently different than the previous plan.
ResolveFK looks up the tables and columns mentioned in a `REFERENCES` constraint and adds metadata representing that constraint to the descriptor.
ResolveUniqueWithoutIndexConstraint looks up the columns mentioned in a UNIQUE WITHOUT INDEX constraint and adds metadata representing that constraint to the descriptor.
RevalidateUniqueConstraintsInTable verifies that all unique constraints defined on the given table are valid.
RoleExists returns true if the role exists.
RunCDCEvaluation runs plan previously prepared by PlanCDCExpression.
Save stores any file into the writer in JSON format.
SetCopyFromBatchSize exports overriding copy batch size for test code.
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.
StartHistoryRetentionJob creates a cluster-level protected timestamp and a job that owns it.
StubTableStats generates "stub" statistics for a table which are missing statistics on virtual computed columns, multi-column stats, and histograms, and have 0 for all values.
SynthesizeRegionConfig returns a RegionConfig representing the user configured state of a multi-region database by coalescing state from both the database descriptor and multi-region type descriptor.
TablesMetadataFilename give the appropriate name where to store or read any schema description from a specific database.
TestingConvertRegionToZoneConfig converts a given region config into a zone configuration, ensuring the result is fully hydrated.
TestingDescsTxn is a convenience function for running a transaction on descriptors when you have a serverutils.ApplicationLayerInterface.
TestingGetAllNames is a wrapper for getAllNames.
TestingOverrideExplainEnvVersion overrides the version reported by EXPLAIN (OPT, ENV).
TestingResetSessionVariables resets all session settings in evalCtx to their global default, if they have a global default.
TestingSetSessionVariable sets a new value for session setting `varName` in the session settings owned by `evalCtx`, returning an error if not successful.
TestingUpdateTenantRecord is a public wrapper around updateTenantRecord intended for testing purposes.
TranslateDataPlacement translates a tree.DataPlacement into a descpb.DataPlacement.
TranslateProtoSurvivalGoal translate a descpb.SurvivalGoal into a tree.SurvivalGoal.
TranslateSurvivalGoal translates a tree.SurvivalGoal into a descpb.SurvivalGoal.
UpdateDescriptorCount updates our sql.schema_changer.object_count gauge with a fresh count of objects in the system.descriptor table.
UpdateTenantRecord updates a tenant in system.tenants.
ValidateConstraint validates the constraint against all rows in `tbl`.
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.
WithDescCollection configures the planner with the provided collection instead of the default (creating a new one from scratch).
WithExtraColumn returns an option to add column to the CDC table.
WithOnlyGlobalTables modifies an refreshZoneConfigOptions to only apply to global tables.
WithOnlyRegionalTablesAndGlobalTables modifies an refreshZoneConfigOptions to only apply to global tables and regional tables.
# 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.
BulkJobIdColName is the key for the job id for bulk jobs.
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.
CopyBatchRowSizeDefault is the number of rows we insert in one insert statement.
Vector wise inserts scale much better and this is suitable default.
CrdbInternalName is the name of the crdb_internal schema.
CustomPlanThreshold is the maximum number of custom plan costs tracked by planCosts.
DontNeedRowDesc specifies that a row description message is not needed.
EmptyTable represents an existing table that is empty.
EnumTypeMultiRegion is a multi-region related enum.
EnumTypeUserDefined is a user defined enum.
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.
FullDistribution distributes a plan across multiple SQL instances whether it is a system tenant or non-system tenant.
GetPGMetadataSQL is a query uses udt_name::regtype instead of data_type column because data_type only says "ARRAY" but does not say which kind of array it is.
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.
LocalDistribution does not distribute a plan across multiple SQL instances.
LogEverywhere logs to all the possible outputs.
LogExternally makes InsertEventRecords write the event(s) to the external logs.
LogToDevChannelIfVerbose makes InsertEventRecords copy the structured event to the DEV logging channel if the vmodule filter for the log call is set high enough.
LogToSystemTable makes InsertEventRecords write one or more entries to the system eventlog table.
MaxSQLBytes is the maximum length in bytes of SQL statements serialized into a serverpb.Session.
RDBMS options.
NeedRowDesc specifies that a row description message is needed.
NewTable represents a new table, where the constraint is specified in the CREATE TABLE.
NodeDraining means that the node should be avoided because it's draining.
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.
NotPausablePortalForUnsupportedStmt is used when the cluster setting the session variable multiple_active_portals_enabled is set to true, while we don't support underlying statement.
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.
PartitionSpansBoundCFWithinRow indicates that consecutive spans passed to PartitionSpans _might_ be part of the same SQL row (when they correspond to different column families within a single row), and in that case those spans need to be assigned the same instance.
PartitionSpansBoundDefault indicates that consecutive spans passed to PartitionSpans can always be processed on different instances.
PausablePortal is set when the session variable multiple_active_portals_enabled is set to true and the underlying statement is a read-only SELECT query with no sub-queries or post-queries.
PgCompatLocale is the locale string we advertise in `LC_*` session variables.
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".
PortalPausabilityDisabled is the default status of a portal when the session variable multiple_active_portals_enabled is false.
RDBMS options.
PreparedStatementOriginSessionMigration signifies that the prepared statement came from a call to crdb_internal.deserialize_session.
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.
RunningStatusBackfill is for jobs that are currently running a backfill for a schema element.
RunningStatusDeleteOnly is for jobs that are currently waiting on the cluster to converge to seeing the schema element in the DELETE_ONLY state.
RunningStatusDeletingData is used for the GC job when it is about to clear the data.
RunningStatusMerging is for jobs that are currently waiting on the cluster to converge to seeing the schema element in the MERGING state.
RunningStatusValidation is for jobs that are currently validating a schema element.
RunningStatusWaitingForMVCCGC is used for the GC job when it has cleared the data but is waiting for MVCC GC to remove the data.
RunningStatusWaitingGC is for jobs that are currently in progress and are waiting for the GC interval to expire.
RunningStatusWriteOnly is for jobs that are currently waiting on the cluster to converge to seeing the schema element in the WRITE_ONLY state.
SecondaryTenantsMultiRegionAbstractionsEnabledSettingName is the name of the cluster setting that governs secondary tenant multi-region abstraction usage.
SpanPartitionReason_CLOSEST_LOCALITY_MATCH is reported when we picked an instance with the closest match to the provided locality filter.
SpanPartitionReason_GATEWAY_NO_HEALTHY_INSTANCES is reported when there are no healthy instances and so we default to the gateway node.
SpanPartitionReason_GATEWAY_NO_LOCALITY_MATCH is reported when there is no match to the provided locality filter and so we default to the gateway.
SpanPartitionReason_GATEWAY_ON_ERROR is reported when there is an error and so we default to the gateway node.
SpanPartitionReason_GATEWAY_TARGET_UNHEALTHY is reported when the target node is unhealthy and so we default to the gateway node.
SpanPartitionReason_GOSSIP_GATEWAY_TARGET_UNHEALTHY is reported when the target node retrieved via gossip is deemed unhealthy.
SpanPartitionReason_GOSSIP_TARGET_HEALTHY is reported when the target node retrieved via gossip is deemed healthy.
SpanPartitionReason_LOCALITY_FILTERED_RANDOM is reported when there is no match to the provided locality filter and the gateway is not eligible.
SpanPartitionReason_LOCALITY_FILTERED_RANDOM_GATEWAY_OVERLOADED is reported when there is no match to the provided locality filter and the gateway is eligible but overloaded with other partitions.
SpanPartitionReason_ROUND_ROBIN is reported when there is no locality info on any of the instances and so we default to a naive round-robin strategy.
SpanPartitionReason_TARGET_HEALTHY is reported when the target node is healthy.
SpanPartitionReason_UNSPECIFIED is reported when the reason is unspecified.
SpanPartitionReasonMax tracks the number of SpanPartitionReason objects.
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
AllowSessionRevival is true if the cluster is allowed to create session revival tokens and use them to authenticate a session.
ApplyZoneConfigForMultiRegionTableOptionTableAndIndexes applies table zone configs on the entire table as well as its indexes, replacing multi-region related zone configuration fields.
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.
When this many rows are in the copy buffer, they are inserted.
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 the user attempted to have multiple active portals but either without setting session variable multiple_active_portals_enabled to true or the underlying query does not satisfy the restriction.
ErrPlanChanged is a sentinel marker error for use to signal a plan changed.
ErrStmtNotSupportedForPausablePortal is returned when the user have set session variable multiple_active_portals_enabled to true but set an unsupported statement for a portal.
GetMultiRegionEnumAddValuePlacementCCL is the public hook point for the CCL-licensed code to determine the placement for a new region inside a region enum.
InitializeMultiRegionMetadataCCL is the public hook point for the CCL-licensed multi-region initialization code.
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.
Below are the metadata for the statement executed counters.
Below are the metadata for the statement started 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.
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.
NewTenantNetworkEgressCounter is used to create a tenantNetworkEgressCounter.
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, or that we create in an index backfill .
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.
SecondaryTenantScatterEnabled controls if secondary tenants are allowed to run ALTER TABLE/INDEX ..
SecondaryTenantsMultiRegionAbstractionsEnabled controls if secondary tenants are allowed to use multi-region abstractions.
SecondaryTenantSplitAtEnabled controls if secondary tenants are allowed to run ALTER TABLE/INDEX ..
SerialNormalizationMode controls how the SERIAL type is interpreted in table definitions.
SupportedVTables are the crdb_internal tables that are "supported" for real customer use in production for legacy reasons.
TempObjectCleanupInterval is a ClusterSetting controlling how often temporary objects get cleaned up.
TempObjectWaitInterval is a ClusterSetting controlling how long after a creation a temporary object will be cleaned up.
TenantGlobalMetricsExporterInterval is the interval at which an external tenant's process in the cluster will update the global metrics, and is measured from the *last update*.
TipUserAboutSystemInterface informs the user in error payloads about the existence of the system interface.
TraceStmtThreshold is identical to traceTxnThreshold except it applies to individual statements in a transaction.
TxnFingerprintIDCacheCapacity is the cluster setting that controls the capacity of the txn fingerprint ID cache.
TxnStateTransitions describe the transitions used by a connExecutor's fsm.Machine.
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.
# Structs
ActivityUpdaterMetrics must be public for metrics to get registered.
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.
CallbackResultWriter is a rowResultWriter that runs a callback function on AddRow.
CDCExpressionPlan encapsulates execution plan for evaluation of CDC expressions.
ClosedSessionCache is an in-memory FIFO cache for closed sessions.
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.
CopyOut is the command for execution of the Copy-out 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.
DescriptorWithObjectType wraps a descriptor with the corresponding privilege object type.
DistSQLPlanner is used to generate distributed plans from logical plans.
DistSQLReceiver is an execinfra.RowReceiver and execinfra.BatchReceiver that writes results to a rowResultWriter and batchResultWriter, respectively.
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.
EventLogTestingKnobs provides hooks and knobs for event logging.
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.
FakeJobExecContext is used for mocking the JobExecContext in tests.
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.
GuardrailMetrics groups metrics related to different guardrails in the SQL layer.
HasAdminRoleCache is stored in extraTxnState and used to cache if the user has admin role throughout a transaction.
IndexBackfillerMergePlanner holds dependencies for the merge step of the index backfiller.
IndexBackfillPlanner holds dependencies for an index backfiller for use in the declarative schema changer.
IndexMergeTracker abstracts the infrastructure to read and write merge progress to job state.
InternalDB stored information needed to construct a new internal executor.
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.
MemoryMetrics contains pointers to the metrics object for one of the SQL endpoints: - "client" for connections received via pgwire.
MergeProgress tracks the progress for an index backfill merge.
MetadataCallbackWriter wraps a rowResultWriter to stream metadata in a DistSQL flow.
Metrics collects timeseries data about SQL activity.
NodeInfo contains metadata about the executing node and cluster.
PGMetadataColumnDiff describes diffs information for a column type.
PGMetadataColumnType represents a column type from postgres/mysql.
PGMetadataDiffFile is used to store expected diffs or by the diff tool to validate a diff is an expected diff.
PGMetadataFile stores the schema gotten from postgres/mysql.
PGMetadataTableInfo represents a table with column mapping and column names in insertion order.
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.
SchemaChangerMetrics are metrics corresponding to the schema changer.
SchemaChangerState is state associated with the new schema changer.
SchemaChangerTestingKnobs for testing the schema change execution path through both the synchronous and asynchronous paths.
SchemaTelemetryTestingKnobs contains testing knobs for schema telemetry.
SendError is a command that, upon execution, send a specific error to the client.
Server is the top level singleton for handling SQL connections.
ServerMetrics collects timeseries data about Server activities that are unrelated to SQL planning and execution.
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 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 associates a subset of spans with a specific SQL instance, chosen to have the most efficient access to those spans.
Statement contains a statement with optional expected result columns and metadata.
StatementCounters groups metrics for counting different types of statements.
StatsMetrics groups metrics related to SQL Stats collection.
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.
StreamingTestingKnobs contains knobs for streaming behavior.
Summary will keep accountability for any unexpected difference and report it in the log.
Sync is a command that serves two purposes: 1) It marks the end of one batch of commands and the beginning of the next.
TelemetryLoggingTestingKnobs provides hooks and knobs for unit tests.
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.
TTLTestingKnobs contains testing knobs for TTL deletion.
TxnFingerprintIDCache is a thread-safe cache tracking transaction fingerprint IDs at the session level.
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.
CDCOption is an option to configure cdc expression planning and execution.
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.
CopyOutResult represents the result of a CopyOut 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.
JobExecContext provides the execution environment for a job.
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.
SyncResult represents the result of a Sync command.
SystemTenantOnly wraps an object in the ExecutorConfig that is only available when accessed by the system tenant.
TenantNetworkEgressCounter is used by tenants running EXPLAIN ANALYZE to measure the number of bytes that would be sent over the network if the query result was returned to the client.
VirtualTabler is used to fetch descriptors for virtual tables and databases.
# Type aliases
BulkJobInfoKey are for keys stored in pgwire.commandResult.bulkJobInfo.
CmdPos represents the index of a command relative to the start of a connection.
DistributionType is an enum defining when a plan should be distributed.
EnumType is the type of an enum.
InternalPlannerParamsOption is an option that can be passed to NewInternalPlanner.
LiveClusterRegions is a set representing regions that are live in a given cluster.
LogEventDestination indicates for InsertEventRecords where the event should be directed to.
NewTableDescOption is an option on NewTableDesc.
NodeStatus represents a node's health and compatibility in the context of physical planning for a query.
PartitionSpansBoundGranularity indicates how "granular" boundaries between spans passed to PartitionSpans are.
PGMetadataColumnDiffs maps column names to datatype diffs.
PGMetadataColumns maps columns names to datatypes.
PGMetadataTableDiffs is used to store and load expected diffs: - A table name pointing to a zero length PGMetadataColumnDiffs means that we expect this table to be missing in cockroach db.
PGMetadataTables maps tables with columns.
PGShDependType is an enumeration that lists pg_shdepend deptype column values.
PhysicalPlanMaker describes a function that makes a physical plan.
PlanChangeDecision describes a function that decides if a plan has "changed" within a given context, for example, if enough of its processor placements have changed that it should be replanned.
PlanHookRowFn describes the row-production for hook-created plans.
PlanHookTypeCheckFn is a function that can intercept a statement being prepared and type check its arguments.
PortalPausablity mark if the portal is pausable and the reason.
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.
RewriteEvTypes could be a enumeration if rewrite rules gets implemented.
RowDescOpt specifies whether a result needs a row description message.
SaveFlowsFunc is the signature for a function used to examine the physical plan for a query.
SessionDataOverride is a function that can be used to override some fields in the session data through all uses of a isql.DB.
SessionDefaults mirrors fields in Session, for restoring default configuration values in SET ..
SpanPartitionReason is the reason why a span was assigned to a particular node or SQL Instance ID.
StatementFilter is the type of callback that ExecutorTestingKnobs.StatementFilter takes.
TableState is the state of the referencing table ResolveFK() or ResolveUniqueWithoutIndexConstraint() is called on.
TransactionStatusIndicator represents a pg identifier for the transaction state.
UpdateVersionSystemSettingHook provides a callback that allows us update the cluster version inside the system.settings table.
VersionUpgradeHook is used to run upgrades starting in v21.1.