package
0.0.0-20160920194302-ad86efcaa21b
Repository: https://github.com/a10y/cockroach.git
Documentation: pkg.go.dev

# Functions

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.
ColumnsSelectors generates Select expressions for cols.
DecodeIndexKey decodes the values that are a part of the specified index key.
DecodeIndexKeyPrefix decodes the prefix of an index key and returns the index id and a slice for the rest of the key.
DecodeKeyVals decodes the values that are part of the key.
DecodeTableIDIndexID decodes a table id followed by an index id.
DecodeTableKey decodes a table key/value.
DecodeTableValue decodes a value encoded by EncodeTableValue.
EncodeColumns is a version of EncodeIndexKey that takes ColumnIDs and directions explicitly.
EncodeDatum encodes a datum (order-preserving encoding, suitable for keys).
EncodeDTuple encodes a DTuple (order-preserving).
EncodeIndexKey creates a key by concatenating keyPrefix with the encodings of the columns in the index.
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.
EqualName returns true iff the normalizations of a and b are equal.
ExtractIndexKey constructs the index (primary) key for a row from any index key/value entry, including secondary indexes.
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.
IsIntegrityConstraintError returns true if the error is some kind of SQL constraint violation.
IsSystemConfigID returns true if this ID is for a system config object.
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.
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.
MakeKeyVals returns a slice of Datums with the correct types for the given columns.
MakeMetadataSchema constructs a new MetadataSchema value which constructs the "system" database.
MakeNameMetadataKey returns the key for the name.
MakeSrcCtx creates a SrcCtx value with contextual information about the caller at the requested depth.
MakeZoneKey returns the key for 'id's entry in the system.zones table.
MarshalColumnValue returns a Go primitive value equivalent of val, of the type expected by col.
NewDatabaseAlreadyExistsError creates a new ErrDatabaseAlreadyExists.
NewDefaultPrivilegeDescriptor returns a privilege descriptor with ALL privileges for the root user.
NewNonNullViolationError creates a new ErrNonNullViolation.
NewPrivilegeDescriptor returns a privilege descriptor for the given user with the specified list of privileges.
NewRelationAlreadyExistsError creates a new ErrRelationAlreadyExists.
NewRetryError creates a ErrRetry.
NewSyntaxError creates a new ErrSyntax.
NewTransactionAbortedError creates a new ErrTransactionAborted.
NewTransactionCommittedError creates a new ErrTransactionCommitted.
NewUndefinedDatabaseError creates a new ErrUndefinedDatabase.
NewUndefinedTableError creates a new ErrUndefinedTable.
NewUndefinedViewError creates a new ErrUndefinedTable, which is also used for views (sharing the same postgres error code).
NewUniquenessConstraintViolationError creates a new ErrUniquenessConstrainViolation.
NewWrongObjectTypeError creates a new ErrWrongObjectType.
NormalizeName normalizes to lowercase and Unicode Normalization Form C (NFC).
NormalizeTableName normalizes the TableName using NormalizeName().
PrettySpan returns a human-readable representation of a span.
PrettySpans returns a human-readable description of the spans.
RandColumnType returns a random ColumnType_Kind value.
RandDatum generates a random Datum of the given type.
RandDatumEncoding returns a random DatumEncoding value.
RandEncDatum generates a random EncDatum (of a random type).
RandEncDatumSlice generates a slice of random EncDatum values of the same random type.
RandEncDatumSlices generates EncDatum slices, each slice with values of the same random type.
ReNormalizeName performs the same work as NormalizeName but when the string originates from the database.
RunFilter runs a filter expression and returns whether the filter passes.
SanitizeVarFreeExpr verifies a default 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.
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/.
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
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.
DescriptorAbsent for a descriptor that doesn't exist.
DescriptorActive for a descriptor that is completely active for read/write and delete operations.
DescriptorIncomplete for a descriptor that is a part of a schema change, and is still being processed.
Descriptor is being added.
Operations can use this invisible descriptor to implicitly delete entries.
Descriptor is being dropped.
Not used.
Not used.
Operations can use this invisible descriptor to implicitly write and delete entries.
DescriptorTableSchema is checked in TestSystemTables.
EventLogTableSchema describes the schema of the event log table.
FamilyFormatVersion corresponds to the encoding described in https://github.com/cockroachdb/cockroach/blob/master/docs/RFCS/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
InterleavedFormatVersion corresponds to the encoding described in https://github.com/cockroachdb/cockroach/blob/master/docs/RFCS/sql_interleaved_tables.md.
InvalidMutationID is the uninitialised mutation id.
LeaseTableSchema is checked in TestSystemTables.
NamespaceTableSchema is checked in TestSystemTables.
PrimaryKeyIndexName is the name of the index for the primary key.
RangeEventTableSchema defines the schema of the event log table.
Descriptor is being added.
Descriptor is being dropped.
Not used.
UITableSchema is checked in TestSystemTables.
UsersTableSchema is checked in TestSystemTables.
ZonesTableSchema is checked in TestSystemTables.

# Variables

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
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
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
LeaseTable is the descriptor for the leases table.
NamespaceTable is the descriptor for the namespace table.
RangeEventTable is the descriptor for the range log table.
SystemConfigAllowedPrivileges describes the privileges allowed for each system config object.
SystemDB is the descriptor for the system database.
No description provided by the author
No description provided by the author
UITable is the descriptor for the ui table.
UsersTable is the descriptor for the users table.
ZonesTable is the descriptor for the zones table.

# Structs

BackupDescriptor represents a consistent snapshot of ranges.
BackupRangeDescriptor represents a file that contains the diff for a key range between two timestamps.
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.
No description provided by the author
ConstraintDetail describes a constraint.
DatabaseDescriptor represents a namespace (aka database) and is stored in a structured metadata key.
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 parser.Datum.
EncDatumRowAlloc is a helper that speeds up allocation of EncDatumRows (preferably of the same length).
ErrDatabaseAlreadyExists represents a missing database error.
ErrNonNullViolation represents a violation of a non-NULL constraint.
ErrRelationAlreadyExists represents a missing database error.
ErrRetry means that the transaction can be retried.
ErrSyntax represents a syntax error.
ErrTransactionAborted represents an error for trying to run a command in the context of transaction that's already aborted.
ErrTransactionCommitted signals that the SQL txn is in the COMMIT_WAIT state and that only a COMMIT statement will be accepted.
ErrUndefinedDatabase represents a missing database error.
ErrUndefinedTable represents a missing database table.
ErrUniquenessConstraintViolation represents a violation of a UNIQUE constraint.
ErrWrongObjectType represents a wrong object type error.
No description provided by the author
No description provided by the author
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.
PrivilegeDescriptor describes a list of users and attached privileges.
RowFetcher handles fetching kvs and forming table rows.
SrcCtx contains contextual information about the source of an error.
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
The schema update lease.
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.
ErrorWithPGCode represents errors that carries an error code to the user.

# Type aliases

ColumnID is a custom type for ColumnDescriptor IDs.
ColumnOrdering is used to describe a desired column ordering.
These mirror the types supported by the sql/parser.
ConstraintType is used to itentify 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.
DescriptorStatus is the status for a descriptor.
DescriptorVersion is a custom type for TableDescriptor Versions.
EncDatumRow is a row of EncDatums.
EncDatumRows is a slice of EncDatumRows.
FamilyID is a custom type for ColumnFamilyDescriptor IDs.
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.
The direction of a column in the index.
IndexID is a custom type for IndexDescriptor IDs.
MutationID is custom type for TableDescriptor mutations.
State is set if this TableDescriptor is in the process of being added or deleted.