package
2.1.0-alpha.20180416+incompatible
Repository: https://github.com/kaavee315/cockroach.git
Documentation: pkg.go.dev
# Functions
AdjustEndKeyForInterleave returns an exclusive end key.
AdjustStartKeyForInterleave adjusts the start key to skip unnecessary interleaved sections.
CheckColumnType verifies that a given value is compatible with the type requested by the column.
CheckValueWidth checks that the width (for strings, byte arrays, and bit string) and scale (for decimals) of the value fits the specified column type.
ColIDtoRowIndexFromCols groups a slice of ColumnDescriptors by their ID field, returning a map from ID to ColumnDescriptor.
ColTypeInfoFromColDescs creates a ColTypeInfo from []ColumnDescriptor.
ColTypeInfoFromColTypes creates a ColTypeInfo from []ColumnType.
ColTypeInfoFromResCols creates a ColTypeInfo from ResultColumns.
ColumnsSelectors generates Select expressions for cols.
ColumnTypesToDatumTypes converts a slice of ColumnTypes to a slice of datum types.
CompareDatums compares two datum rows according to a column ordering.
ConvertBatchError returns a user friendly constraint violation error.
DatumToEncDatum initializes an EncDatum with the given Datum.
DatumTypeHasCompositeKeyEncoding is a version of HasCompositeKeyEncoding which works on datum types.
DatumTypeToColumnSemanticType converts a types.T to a SemanticType.
DatumTypeToColumnType converts a parser Type to a ColumnType.
DecodeIndexKey decodes the values that are a part of the specified index key (setting vals).
DecodeIndexKeyPrefix decodes the prefix of an index key and returns the index id and a slice for the rest of the key.
DecodeIndexKeyWithoutTableIDIndexIDPrefix is the same as DecodeIndexKey, except it expects its index key is missing its first table id / index id key prefix.
DecodeKeyVals decodes the values that are part of the key.
DecodePartitionTuple parses columns (which are a prefix of the columns of `idxDesc`) encoded with the "value" encoding and returns the parsed datums.
DecodeTableIDIndexID decodes a table id followed by an index id.
DecodeTableKey decodes a table key/value.
DecodeTableValue decodes a value encoded by EncodeTableValue.
EncDatumFromBuffer initializes an EncDatum with an encoding that is possibly followed by other data.
EncDatumFromEncoded initializes an EncDatum with the given encoded value.
EncDatumRowToDatums converts a given EncDatumRow to a Datums.
EncDatumValueFromBufferWithOffsetsAndType is just like calling EncDatumFromBuffer with DatumEncoding_VALUE, except it expects that you pass in the result of calling DecodeValueTag on the input buf.
EncodeColumns is a version of EncodePartialIndexKey that takes ColumnIDs and directions explicitly.
EncodeDatum encodes a datum (order-preserving encoding, suitable for keys).
EncodeDatums encodes a Datums (order-preserving).
EncodeIndexKey creates a key by concatenating keyPrefix with the encodings of the columns in the index.
EncodeInvertedIndexKeys creates a list of inverted index keys by concatenating keyPrefix with the encodings of the column in the index.
EncodeInvertedIndexTableKeys encodes the paths in a JSON `val` and concatenates it with `inKey`and returns a list of buffers per path.
EncodePartialIndexKey encodes a partial index key; only the first numCols of index.ColumnIDs are encoded.
EncodeSecondaryIndex encodes key/values for a secondary index.
EncodeSecondaryIndexes encodes key/values for the secondary indexes.
EncodeTableKey encodes `val` into `b` and returns the new buffer.
EncodeTableValue encodes `val` into `appendTo` using DatumEncoding_VALUE and returns the new buffer.
EncodingDirToDatumEncoding returns an equivalent DatumEncoding for the given encoding direction.
ExtractIndexKey constructs the index (primary) key for a row from any index key/value entry, including secondary indexes.
FillColumnRange creates a single range that refers to all the columns between firstIdx and lastIdx, inclusive.
GetColumnTypes returns the types of the columns with the given IDs.
GetDatabaseDescFromID retrieves the database descriptor for the database ID passed in using an existing txn.
GetTableDescFromID retrieves the table descriptor for the table ID passed in using an existing txn.
GetTableDescriptor retrieves a table descriptor directly from the KV layer.
HasCompositeKeyEncoding returns true if key columns of the given kind can have a composite encoding.
IndexKeyEquivSignature parses an index key if and only if the index key belongs to a table where its equivalence signature and all its interleave ancestors' signatures can be found in validEquivSignatures.
IndexKeyValDirs returns the corresponding encoding.Directions for all the encoded values in index's "fullest" possible index key, including directions for table/index IDs, the interleaved sentinel and the index column values.
IsCCLRequiredError returns whether the error is a CCLRequired error.
IsPermanentSchemaChangeError returns true if the error results in a permanent failure of a schema change.
IsQueryCanceledError checks whether this is a query canceled error.
IsReservedID returns whether this ID is for any system object.
IsSystemConfigID returns whether this ID is for a system config object.
IsUniquenessConstraintViolationError returns true if the error is for a uniqueness constraint violation.
JoinTypeFromAstString takes a join string as found in a SQL statement (e.g.
MakeAllDescsMetadataKey returns the key for all descriptors.
MakeColumnDefDescs creates the column descriptor for a column, as well as the index descriptor if the column is a primary key or unique.
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.
MakeDescMetadataKey returns the key for the descriptor.
MakeIndexKeyPrefix returns the key prefix used for the index's data.
MakeKeyFromEncDatums creates a key by concatenating keyPrefix with the encodings of the given EncDatum values.
MakeMetadataSchema constructs a new MetadataSchema value which constructs the "system" database.
MakeMultiSourceInfo constructs a MultiSourceInfo for the given DataSourceInfos.
MakeNameMetadataKey returns the key for the name.
MakePrimaryIndexKey creates a key prefix that corresponds to a table row (in the primary index); it is intended for tests.
MakeRowDeleter creates a RowDeleter for the given table.
MakeRowInserter creates a RowInserter for the given table.
MakeRowUpdater creates a RowUpdater for the given table.
MarshalColumnValue returns a Go primitive value equivalent of val, of the type expected by col.
MustBeValueEncoded returns true if columns of the given kind can only be value encoded.
NewCancelChecker returns a new CancelChecker.
NewCCLRequiredError creates an error for when a CCL feature is used in an OSS binary.
NewCustomRootPrivilegeDescriptor returns a privilege descriptor for the root user and specified privileges.
NewCustomSuperuserPrivilegeDescriptor returns a privilege descriptor for the root user and the admin role with specified privileges.
NewDatabaseAlreadyExistsError creates an error for a preexisting database.
NewDefaultPrivilegeDescriptor returns a privilege descriptor with ALL privileges for the root user and admin role.
NewDependentObjectError creates a dependent object error.
NewDependentObjectErrorWithHint creates a dependent object error with a hint.
NewInvalidSchemaDefinitionError creates an error for an invalid schema definition such as a schema definition that doesn't parse.
NewInvalidWildcardError creates an error that represents the result of expanding a table wildcard over an invalid database or schema prefix.
NewNonNullViolationError creates an error for a violation of a non-NULL constraint.
NewPrivilegeDescriptor returns a privilege descriptor for the given user with the specified list of privileges.
NewRangeUnavailableError creates an unavailable range error.
NewRelationAlreadyExistsError creates an error for a preexisting relation.
NewRetryError creates an error signifying that the transaction can be retried.
NewRowContainer allocates a new row container.
NewSourceInfoForSingleTable creates a simple DataSourceInfo which maps the same tableAlias to all columns.
NewStatementCompletionUnknownError creates an error with the corresponding pg code.
NewSyntaxError creates a syntax error.
NewTransactionAbortedError creates an error for trying to run a command in the context of transaction that's already aborted.
NewTransactionCommittedError creates an error that signals that the SQL txn is in the COMMIT_WAIT state and that only a COMMIT statement will be accepted.
NewUndefinedColumnError creates an error that represents a missing database column.
NewUndefinedDatabaseError creates an error that represents a missing database.
NewUndefinedRelationError creates an error that represents a missing database table or view.
NewUniquenessConstraintViolationError creates an error that represents a violation of a UNIQUE constraint.
NewUnsupportedSchemaUsageError creates an error for an invalid schema use, e.g.
NewWindowingError creates a windowing error.
NewWrongObjectTypeError creates a wrong object type error.
NoCheckPrivilege can be used to not perform any privilege checks during a TablesNeededForFKs function call.
NoLookup can be used to not perform any lookups during a TablesNeededForFKs function call.
PrettyKey pretty-prints the specified key, skipping over the first `skip` fields.
PrettySpan returns a human-readable representation of a span.
PrettySpans returns a human-readable description of the spans.
ProcessDefaultColumns adds columns with DEFAULT to cols if not present and returns the defaultExprs for cols.
RandCollationLocale returns a random element of collationLocales.
RandColumnType returns a random ColumnType value.
RandColumnTypes returns a slice of numCols random ColumnType values.
RandDatum generates a random Datum of the given type.
RandDatumEncoding returns a random DatumEncoding value.
RandEncDatum generates a random EncDatum (of a random type).
RandEncDatumRowOfTypes generates a slice of random EncDatum values for the corresponding type in types.
RandEncDatumRows generates EncDatumRows where all rows follow the same random []ColumnType structure.
RandEncDatumRowsOfTypes generates EncDatumRows, each row with values of the corresponding type in types.
RandSortingColumnType returns a column type which can be key-encoded.
RandSortingColumnTypes returns a slice of numCols random ColumnType values which are key-encodable.
RandSortingEncDatumSlice generates a slice of random EncDatum values of the same random type which is key-encodable.
RandSortingEncDatumSlices generates EncDatum slices, each slice with values of the same random type which is key-encodable.
ResultColumnsFromColDescs converts ColumnDescriptors to ResultColumns.
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.
SetKVBatchSize changes the kvFetcher batch size, and returns a function that restores it.
Sort sorts data.
TableEquivSignatures returns the equivalence signatures for each interleave ancestor and itself.
TablesNeededForFKs populates a map of TableLookupsByID for all the TableDescriptors that might be needed when performing FK checking for delete and/or insert operations.
UnmarshalColumnValue decodes the value from a key-value pair using the type expected by the column.
WrapDescriptor fills in a Descriptor.
# Constants
BaseFormatVersion corresponds to the encoding described in https://www.cockroachlabs.com/blog/sql-in-cockroachdb-mapping-table-data-to-key-value-storage/.
CheckDeletes checks if rows reference a changed value.
CheckFKs can be passed to row writers to check fk validity.
CheckInserts checks if a new value references an existing row.
CheckUpdates checks all references (CheckDeletes+CheckInserts).
CodeCCLRequired signals that a CCL binary is required to complete this task.
CodeRangeUnavailable signals that some data from the cluster cannot be accessed (e.g.
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
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
NULL is not supported as a table column type, however it can be transferred through distsql streams.
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
ConstraintTypeCheck identifies a CHECK constraint.
ConstraintTypeFK identifies a FOREIGN KEY constraint.
ConstraintTypePK identifies a PRIMARY KEY constraint.
ConstraintTypeUnique identifies a FOREIGN constraint.
No description provided by the author
No description provided by the author
Indicates that the datum is encoded using the order-preserving encoding used for keys (ascending order).
Indicates that the datum is encoded using the order-preserving encoding used for keys (descending order).
Indicates that the datum is encoded using the encoding used for values.
Descriptor is being added.
Operations can use this invisible descriptor to implicitly write and delete entries.
Operations can use this invisible descriptor to implicitly delete entries.
Descriptor is being dropped.
Not used.
Not used.
These system tables are part of the system config.
These system tables are not part of the system config.
Prettier aliases for JoinType values.
FamilyFormatVersion corresponds to the encoding described in https://github.com/cockroachdb/cockroach/blob/master/docs/RFCS/20151214_sql_column_families.md.
FamilyHeuristicTargetBytes is the target total byte size of columns that the current heuristic will assign to a family.
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
Prettier aliases for JoinType values.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Prettier aliases for JoinType values.
InterleavedFormatVersion corresponds to the encoding described in https://github.com/cockroachdb/cockroach/blob/master/docs/RFCS/20160624_sql_interleaved_tables.md.
Prettier aliases for JoinType values.
InvalidID is the uninitialised descriptor id.
InvalidMutationID is the uninitialised mutation id.
These system tables are not part of the system config.
EXCEPT_ALL is a special join-like operation that is only used for EXCEPT ALL and EXCEPT operations.
No description provided by the author
No description provided by the author
INTERSECT_ALL is a special join-like operation that is only used for INTERSECT ALL and INTERSECT operations.
A left anti join is an "inverted" semi join: it returns the rows from the left side that don't match any columns on the right side (as per equality columns and ON condition).
No description provided by the author
A left semi join returns the rows from the left side that match at least one row from the right side (as per equality columns and ON condition).
No description provided by the author
These system tables are not part of the system config.
Prettier aliases for JoinType values.
Prettier aliases for JoinType values.
Prettier aliases for JoinType values.
locations are used to map a locality specified by a node to geographic latitude, longitude coordinates, specified as degrees.
These system tables are part of the system config.
PartitionDefaultVal represents the special DEFAULT value.
PartitionMaxVal represents the special MAXVALUE value.
PartitionMinVal represents the special MINVALUE value.
PrimaryKeyIndexName is the name of the index for the primary key.
rangelog is currently envisioned as a wide table; many different event types can be recorded to the table.
Prettier aliases for JoinType values.
role_members stores relationships between roles (role->role and role->user).
RowUpdaterDefault indicates that a RowUpdater should update everything about a row, including secondary indexes.
RowUpdaterOnlyColumns indicates that a RowUpdater should only update the columns of a row.
These system tables are part of the system config.
SizeOfDatum is the memory size of a Datum reference.
SizeOfDatums is the memory size of a Datum slice.
SkipFKs can be passed to row writer to skip fk validity checks.
Descriptor is being added.
No description provided by the author
Descriptor is being dropped.
Not used.
No description provided by the author
table_statistics is used to track statistics collected about individual columns or groups of columns from every table in the database.
These system tables are not part of the system config.
These system tables are part of the system config.
web_sessions are used to track authenticated user actions over stateless connections, such as the cookie-based authentication used by the Admin UI.
Zone settings per DB/Table.
# Variables
AdminRole is the default (and non-droppable) role with superuser privileges.
AnonymousTable is the empty table name, used when a data source has no own name, e.g.
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
DefaultSearchPath is the search path used by virgin sessions.
DefaultSuperuserPrivileges is the list of privileges for super users on non-system objects.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
DescriptorTable is the descriptor for the descriptor table.
ErrDescriptorNotFound is returned by GetTableDescFromID to signal that a descriptor could not be found with the given id.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ErrMissingColumns indicates a table with no columns.
ErrMissingPrimaryKey indicates a table with no primary key.
EventLogTable is the descriptor for the event log table.
No description provided by the author
No description provided by the author
ForeignKeyReferenceActionValue allows the conversion between a tree.ReferenceAction and a ForeignKeyReference_Action.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
JobsTable is the descriptor for the jobs table.
No description provided by the author
No description provided by the author
LeaseTable is the descriptor for the leases table.
LocationsTable is the descriptor for the locations table.
NamespaceTable is the descriptor for the namespace table.
QueryCanceledError is an error representing query cancellation.
QueryTimeoutError is an error representing a query timeout.
RangeEventTable is the descriptor for the range log table.
RoleMembersTable is the descriptor for the role_members table.
SettingsTable is the descriptor for the jobs table.
SystemAllowedPrivileges describes the allowable privilege list for each system object.
SystemDB is the descriptor for the system database.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
TableStatistics table to hold statistics about columns and column groups.
UITable is the descriptor for the ui table.
UsersTable is the descriptor for the users table.
WebSessions table to authenticate sessions over stateless connections.
ZonesTable is the descriptor for the zones table.
# Structs
CancelChecker is a helper object for repeatedly checking whether the associated context has been canceled or not.
CheckHelper validates check constraints on rows, on INSERT and UPDATE.
ColTypeInfo is a type that allows multiple representations of column type information (to avoid conversions and allocations).
No description provided by the author
ColumnFamilyDescriptor is set of columns stored together in one kv entry.
ColumnOrderInfo describes a column (as an index) and a desired order direction.
ColumnResolver is a utility struct to be used when resolving column names to point to one of the data sources and one of the column IDs in that data source.
No description provided by the author
ConstraintDetail describes a constraint.
DatabaseDescriptor represents a namespace (aka database) and is stored in a structured metadata key.
DataSourceInfo provides column metadata for exactly one data source.
DatumAlloc provides batch allocation of datum pointers, amortizing the cost of the allocations.
Descriptor is a union type holding either a table or database descriptor.
No description provided by the author
No description provided by the author
A DescriptorMutation represents a column or an index that has either been added or dropped and hasn't yet transitioned into a stable state: completely backfilled and visible, or completely deleted.
No description provided by the author
No description provided by the author
EncDatum represents a datum that is "backed" by an encoding and/or by a tree.Datum.
EncDatumRowAlloc is a helper that speeds up allocation of EncDatumRows (preferably of the same length).
No description provided by the author
IndexDescriptor describes an index (primary or secondary).
IndexEntry represents an encoded key/value for an index entry.
InterleaveDescriptor represents an index (either primary or secondary) that is interleaved into another table's data.
No description provided by the author
MetadataSchema is used to construct the initial sql schema for a new CockroachDB cluster being bootstrapped.
PartitioningDescriptor represents the partitioning of an index into spans of keys addressable by a zone config.
List represents a list partitioning, which maps individual tuples to partitions.
Range represents a range partitioning, which maps ranges of tuples to partitions by specifying exclusive upper bounds.
PartitionTuple represents a tuple in a partitioning specification.
PrivilegeDescriptor describes a list of users and attached privileges.
ResultColumn contains the name and type of a SQL "cell".
RowContainer is a container for rows of Datums which tracks the approximate amount of memory allocated for row data.
RowDeleter abstracts the key/value operations for deleting table rows.
RowFetcher handles fetching kvs and forming table rows for an arbitrary number of tables.
RowFetcherTableArgs are the arguments passed to RowFetcher.Init for a given table that includes descriptors and row information.
RowInserter abstracts the key/value operations for inserting table rows.
RowUpdater abstracts the key/value operations for updating table rows.
SourceAlias associates a table name (alias) to a set of columns in the result row of a data source.
SpanKVFetcher is an kvFetcher that returns a set slice of kvs.
A TableDescriptor represents a table or view and is stored in a structured metadata key.
No description provided by the author
No description provided by the author
A table descriptor is named through a name map stored in the system.namespace table: a map from {parent_id, table_name} -> id.
No description provided by the author
No description provided by the author
The schema update lease.
No description provided by the author
TableLookup is the value type of TableLookupsByID: An optional table descriptor, populated when the table is public/leasable, and an IsAdding flag.
UserPrivileges describes the list of privileges available for a given user.
UserPrivilegeString is a pair of strings describing the privileges for a given user.
# Interfaces
DescriptorKey is the interface implemented by both databaseKey and tableKey.
DescriptorProto is the interface implemented by both DatabaseDescriptor and TableDescriptor.
FkSpanCollector can collect the spans that foreign key validation will touch.
# Type aliases
AnalyzeExprFunction is the function type used by the CheckHelper during initialization to analyze an expression.
CheckPrivilegeFunction is the function type used by TablesNeededForFKs that will check the privileges of the current user to access specific tables.
ColumnID is a custom type for ColumnDescriptor IDs.
ColumnIDs is a slice of ColumnDescriptor IDs.
ColumnOrdering is used to describe a desired column ordering.
These mirror the types supported by the sql/parser.
No description provided by the author
ConstraintType is used to identify the type of a constraint.
No description provided by the author
DatumEncoding identifies the encoding used for an EncDatum.
Direction of mutation.
A descriptor within a mutation is unavailable for reads, writes and deletes.
DescriptorVersion is a custom type for TableDescriptor Versions.
EncDatumRow is a row of EncDatums.
EncDatumRows is a slice of EncDatumRows having the same schema.
FamilyID is a custom type for ColumnFamilyDescriptor IDs.
FKCheck indicates a kind of FK check (delete, insert, or both).
No description provided by the author
FormatVersion is a custom type for TableDescriptor versions of the sql to key:value mapping.go:generate stringer -type=FormatVersion.
ID is a custom type for {Database,Table}Descriptor IDs.
IDs is a sortable list of IDs.
The direction of a column in the index.
The direction of a column in the index.
IndexID is a custom type for IndexDescriptor IDs.
JoinType is the particular type of a join (or join-like) operation.
MultiSourceInfo is a list of *DataSourceInfo.
MutationID is a custom type for TableDescriptor mutations.
PartitionSpecialValCode identifies a special value.
ResultColumns is the type used throughout the sql module to describe the column types of a table.
SourceAliases is an array of one or more SourceAlias.
AuditMode indicates which auditing actions to take when this table is used.
State is set if this TableDescriptor is in the process of being added or deleted.
TableDescriptors is a sortable list of *TableDescriptors.
TableLookupFunction is the function type used by TablesNeededForFKs that will perform the actual lookup.
TableLookupsByID maps table IDs to looked up descriptors or, for tables that exist but are not yet public/leasable, entries with just the IsAdding flag.