cockroach: github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb Index | Files

package descpb

import "github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb"

Index

Package Files

column.go constraint.go descriptor.go encoded_datum.pb.go formatversion_string.go index.go join_type.go join_type.pb.go locking.go locking.pb.go privilege.go privilege.pb.go privilegedescversion_string.go structured.go structured.pb.go

Constants

const (
    InnerJoin        = JoinType_INNER
    LeftOuterJoin    = JoinType_LEFT_OUTER
    RightOuterJoin   = JoinType_RIGHT_OUTER
    FullOuterJoin    = JoinType_FULL_OUTER
    LeftSemiJoin     = JoinType_LEFT_SEMI
    LeftAntiJoin     = JoinType_LEFT_ANTI
    IntersectAllJoin = JoinType_INTERSECT_ALL
    ExceptAllJoin    = JoinType_EXCEPT_ALL
)

Prettier aliases for JoinType values. See the original types for descriptions.

Variables

var (
    ErrInvalidLengthPrivilege = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowPrivilege   = fmt.Errorf("proto: integer overflow")
)
var (
    ErrInvalidLengthStructured = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowStructured   = fmt.Errorf("proto: integer overflow")
)
var AnonymousTable = tree.TableName{}

AnonymousTable is the empty table name, used when a data source has no own name, e.g. VALUES, subqueries or the empty source.

var CompositeKeyMatchMethodValue = [...]ForeignKeyReference_Match{
    tree.MatchSimple:  ForeignKeyReference_SIMPLE,
    tree.MatchFull:    ForeignKeyReference_FULL,
    tree.MatchPartial: ForeignKeyReference_PARTIAL,
}

CompositeKeyMatchMethodValue allows the conversion from a tree.ReferenceCompositeKeyMatchMethod to a ForeignKeyReference_Match.

var ConstraintToUpdate_ConstraintType_name = map[int32]string{
    0:  "CHECK",
    1:  "FOREIGN_KEY",
    2:  "NOT_NULL",
}
var ConstraintToUpdate_ConstraintType_value = map[string]int32{
    "CHECK":       0,
    "FOREIGN_KEY": 1,
    "NOT_NULL":    2,
}
var ConstraintValidity_name = map[int32]string{
    0:  "Validated",
    1:  "Unvalidated",
    2:  "Validating",
    3:  "Dropping",
}
var ConstraintValidity_value = map[string]int32{
    "Validated":   0,
    "Unvalidated": 1,
    "Validating":  2,
    "Dropping":    3,
}
var DatumEncoding_name = map[int32]string{
    0:  "ASCENDING_KEY",
    1:  "DESCENDING_KEY",
    2:  "VALUE",
}
var DatumEncoding_value = map[string]int32{
    "ASCENDING_KEY":  0,
    "DESCENDING_KEY": 1,
    "VALUE":          2,
}
var DefaultSuperuserPrivileges = privilege.List{privilege.ALL}

DefaultSuperuserPrivileges is the list of privileges for super users on non-system objects.

var DescriptorMutation_Direction_name = map[int32]string{
    0:  "NONE",
    1:  "ADD",
    2:  "DROP",
}
var DescriptorMutation_Direction_value = map[string]int32{
    "NONE": 0,
    "ADD":  1,
    "DROP": 2,
}
var DescriptorMutation_State_name = map[int32]string{
    0:  "UNKNOWN",
    1:  "DELETE_ONLY",
    2:  "DELETE_AND_WRITE_ONLY",
}
var DescriptorMutation_State_value = map[string]int32{
    "UNKNOWN":               0,
    "DELETE_ONLY":           1,
    "DELETE_AND_WRITE_ONLY": 2,
}
var DescriptorState_name = map[int32]string{
    0:  "PUBLIC",
    1:  "ADD",
    2:  "DROP",
    3:  "OFFLINE",
}
var DescriptorState_value = map[string]int32{
    "PUBLIC":  0,
    "ADD":     1,
    "DROP":    2,
    "OFFLINE": 3,
}
var ForeignKeyReferenceActionType = [...]tree.ReferenceAction{
    ForeignKeyReference_NO_ACTION:   tree.NoAction,
    ForeignKeyReference_RESTRICT:    tree.Restrict,
    ForeignKeyReference_SET_DEFAULT: tree.SetDefault,
    ForeignKeyReference_SET_NULL:    tree.SetNull,
    ForeignKeyReference_CASCADE:     tree.Cascade,
}

ForeignKeyReferenceActionType allows the conversion between a tree.ReferenceAction and a ForeignKeyReference_Action.

var ForeignKeyReferenceActionValue = [...]ForeignKeyReference_Action{
    tree.NoAction:   ForeignKeyReference_NO_ACTION,
    tree.Restrict:   ForeignKeyReference_RESTRICT,
    tree.SetDefault: ForeignKeyReference_SET_DEFAULT,
    tree.SetNull:    ForeignKeyReference_SET_NULL,
    tree.Cascade:    ForeignKeyReference_CASCADE,
}

ForeignKeyReferenceActionValue allows the conversion between a ForeignKeyReference_Action and a tree.ReferenceAction.

var ForeignKeyReferenceMatchValue = [...]tree.CompositeKeyMatchMethod{
    ForeignKeyReference_SIMPLE:  tree.MatchSimple,
    ForeignKeyReference_FULL:    tree.MatchFull,
    ForeignKeyReference_PARTIAL: tree.MatchPartial,
}

ForeignKeyReferenceMatchValue allows the conversion from a ForeignKeyReference_Match to a tree.ReferenceCompositeKeyMatchMethod. This should match CompositeKeyMatchMethodValue.

var ForeignKeyReference_Action_name = map[int32]string{
    0:  "NO_ACTION",
    1:  "RESTRICT",
    2:  "SET_NULL",
    3:  "SET_DEFAULT",
    4:  "CASCADE",
}
var ForeignKeyReference_Action_value = map[string]int32{
    "NO_ACTION":   0,
    "RESTRICT":    1,
    "SET_NULL":    2,
    "SET_DEFAULT": 3,
    "CASCADE":     4,
}
var ForeignKeyReference_Match_name = map[int32]string{
    0:  "SIMPLE",
    1:  "FULL",
    2:  "PARTIAL",
}
var ForeignKeyReference_Match_value = map[string]int32{
    "SIMPLE":  0,
    "FULL":    1,
    "PARTIAL": 2,
}
var IndexDescriptor_Direction_name = map[int32]string{
    0:  "ASC",
    1:  "DESC",
}
var IndexDescriptor_Direction_value = map[string]int32{
    "ASC":  0,
    "DESC": 1,
}
var IndexDescriptor_Type_name = map[int32]string{
    0:  "FORWARD",
    1:  "INVERTED",
}
var IndexDescriptor_Type_value = map[string]int32{
    "FORWARD":  0,
    "INVERTED": 1,
}
var JoinType_name = map[int32]string{
    0:  "INNER",
    1:  "LEFT_OUTER",
    2:  "RIGHT_OUTER",
    3:  "FULL_OUTER",
    4:  "LEFT_SEMI",
    5:  "LEFT_ANTI",
    6:  "INTERSECT_ALL",
    7:  "EXCEPT_ALL",
}
var JoinType_value = map[string]int32{
    "INNER":         0,
    "LEFT_OUTER":    1,
    "RIGHT_OUTER":   2,
    "FULL_OUTER":    3,
    "LEFT_SEMI":     4,
    "LEFT_ANTI":     5,
    "INTERSECT_ALL": 6,
    "EXCEPT_ALL":    7,
}
var ScanLockingStrength_name = map[int32]string{
    0:  "FOR_NONE",
    1:  "FOR_KEY_SHARE",
    2:  "FOR_SHARE",
    3:  "FOR_NO_KEY_UPDATE",
    4:  "FOR_UPDATE",
}
var ScanLockingStrength_value = map[string]int32{
    "FOR_NONE":          0,
    "FOR_KEY_SHARE":     1,
    "FOR_SHARE":         2,
    "FOR_NO_KEY_UPDATE": 3,
    "FOR_UPDATE":        4,
}
var ScanLockingWaitPolicy_name = map[int32]string{
    0:  "BLOCK",
    1:  "SKIP",
    2:  "ERROR",
}
var ScanLockingWaitPolicy_value = map[string]int32{
    "BLOCK": 0,
    "SKIP":  1,
    "ERROR": 2,
}
var SystemAllowedPrivileges = map[ID]privilege.List{
    keys.SystemDatabaseID:           privilege.ReadData,
    keys.NamespaceTableID:           privilege.ReadData,
    keys.DeprecatedNamespaceTableID: privilege.ReadData,
    keys.DescriptorTableID:          privilege.ReadData,
    keys.UsersTableID:               privilege.ReadWriteData,
    keys.RoleOptionsTableID:         privilege.ReadWriteData,
    keys.ZonesTableID:               privilege.ReadWriteData,

    keys.SettingsTableID:   privilege.ReadWriteData,
    keys.DescIDSequenceID:  privilege.ReadData,
    keys.TenantsTableID:    privilege.ReadData,
    keys.LeaseTableID:      privilege.ReadWriteData,
    keys.EventLogTableID:   privilege.ReadWriteData,
    keys.RangeEventTableID: privilege.ReadWriteData,
    keys.UITableID:         privilege.ReadWriteData,

    keys.JobsTableID:                          privilege.ReadWriteData,
    keys.WebSessionsTableID:                   privilege.ReadWriteData,
    keys.TableStatisticsTableID:               privilege.ReadWriteData,
    keys.LocationsTableID:                     privilege.ReadWriteData,
    keys.RoleMembersTableID:                   privilege.ReadWriteData,
    keys.CommentsTableID:                      privilege.ReadWriteData,
    keys.ReplicationConstraintStatsTableID:    privilege.ReadWriteData,
    keys.ReplicationCriticalLocalitiesTableID: privilege.ReadWriteData,
    keys.ReplicationStatsTableID:              privilege.ReadWriteData,
    keys.ReportsMetaTableID:                   privilege.ReadWriteData,
    keys.ProtectedTimestampsMetaTableID:       privilege.ReadData,
    keys.ProtectedTimestampsRecordsTableID:    privilege.ReadData,
    keys.StatementBundleChunksTableID:         privilege.ReadWriteData,
    keys.StatementDiagnosticsRequestsTableID:  privilege.ReadWriteData,
    keys.StatementDiagnosticsTableID:          privilege.ReadWriteData,
    keys.ScheduledJobsTableID:                 privilege.ReadWriteData,
    keys.SqllivenessID:                        privilege.ReadWriteData,
}

SystemAllowedPrivileges describes the allowable privilege list for each system object. Super users (root and admin) must have exactly the specified privileges, other users must not exceed the specified privileges.

var SystemColumnKind_name = map[int32]string{
    0:  "NONE",
    1:  "MVCCTIMESTAMP",
    2:  "TABLEOID",
}
var SystemColumnKind_value = map[string]int32{
    "NONE":          0,
    "MVCCTIMESTAMP": 1,
    "TABLEOID":      2,
}
var TableDescriptor_AuditMode_name = map[int32]string{
    0:  "DISABLED",
    1:  "READWRITE",
}
var TableDescriptor_AuditMode_value = map[string]int32{
    "DISABLED":  0,
    "READWRITE": 1,
}
var TypeDescriptor_EnumMember_Capability_name = map[int32]string{
    0:  "ALL",
    1:  "READ_ONLY",
}
var TypeDescriptor_EnumMember_Capability_value = map[string]int32{
    "ALL":       0,
    "READ_ONLY": 1,
}
var TypeDescriptor_Kind_name = map[int32]string{
    0:  "ENUM",
    1:  "ALIAS",
}
var TypeDescriptor_Kind_value = map[string]int32{
    "ENUM":  0,
    "ALIAS": 1,
}

func GetDescriptorMetadata Uses

func GetDescriptorMetadata(
    desc *Descriptor,
) (id ID, version DescriptorVersion, name string, state DescriptorState)

GetDescriptorMetadata extracts metadata out of a raw descpb.Descriptor. Used in cases where basic type-agnostic metadata is needed and unwrapping the descriptor is unnecessary.

func GetDescriptorModificationTime Uses

func GetDescriptorModificationTime(desc *Descriptor) hlc.Timestamp

GetDescriptorModificationTime returns the ModificationTime of the descriptor.

func GetDescriptorName Uses

func GetDescriptorName(desc *Descriptor) string

GetDescriptorName returns the Name of the descriptor.

func IsReservedID Uses

func IsReservedID(id ID) bool

IsReservedID returns whether this ID is for any system object.

func IsSystemConfigID Uses

func IsSystemConfigID(id ID) bool

IsSystemConfigID returns whether this ID is for a system config object.

func IsVirtualTable Uses

func IsVirtualTable(id ID) bool

IsVirtualTable returns true if the TableDescriptor describes a virtual Table (like the information_schema tables) and thus doesn't need to be physically stored.

func MaybeFixPrivileges Uses

func MaybeFixPrivileges(id ID, p *PrivilegeDescriptor) bool

MaybeFixPrivileges fixes the privilege descriptor if needed, including: * adding default privileges for the "admin" role * fixing default privileges for the "root" user * fixing maximum privileges for users. Returns true if the privilege descriptor was modified.

TODO(ajwerner): Figure out whether this is still needed. It seems like perhaps it was intended only for the 2.0 release but then somehow we got bad descriptors with bad initial permissions into later versions or we didn't properly bake this migration in.

func MaybeSetDescriptorModificationTimeFromMVCCTimestamp Uses

func MaybeSetDescriptorModificationTimeFromMVCCTimestamp(
    ctx context.Context, desc *Descriptor, ts hlc.Timestamp,
)

MaybeSetDescriptorModificationTimeFromMVCCTimestamp will update ModificationTime and possibly CreateAsOfTime on TableDescriptor with the provided timestamp. If ModificationTime is non-zero it must be the case that it is not after the provided timestamp.

When table descriptor versions are incremented they are written with a zero-valued ModificationTime. This is done to avoid the need to observe the commit timestamp for the writing transaction which would prevent pushes. This method is used in the read path to set the modification time based on the MVCC timestamp of row which contained this descriptor. If the ModificationTime is non-zero then we know that either this table descriptor was written by older version of cockroach which included the exact commit timestamp or it was re-written in which case it will include a timestamp which was set by this method.

It is vital that users which read table descriptor values from the KV store call this method.

type ColumnDescriptor Uses

type ColumnDescriptor struct {
    Name     string   `protobuf:"bytes,1,opt,name=name" json:"name"`
    ID       ColumnID `protobuf:"varint,2,opt,name=id,casttype=ColumnID" json:"id"`
    Type     *types.T `protobuf:"bytes,3,opt,name=type" json:"type,omitempty"`
    Nullable bool     `protobuf:"varint,4,opt,name=nullable" json:"nullable"`
    // Default expression to use to populate the column on insert if no
    // value is provided. Note that it is not correct to use DefaultExpr
    // as output to display to a user. User defined types within DefaultExpr
    // have been serialized in a internal format. Instead, use one of the
    // schemaexpr.FormatExpr* functions.
    DefaultExpr *string `protobuf:"bytes,5,opt,name=default_expr,json=defaultExpr" json:"default_expr,omitempty"`
    Hidden      bool    `protobuf:"varint,6,opt,name=hidden" json:"hidden"`
    // Ids of sequences used in this column's DEFAULT expression, in calls to nextval().
    UsesSequenceIds []ID `protobuf:"varint,10,rep,name=uses_sequence_ids,json=usesSequenceIds,casttype=ID" json:"uses_sequence_ids,omitempty"`
    // Ids of sequences that the column owns.
    OwnsSequenceIds []ID `protobuf:"varint,12,rep,name=owns_sequence_ids,json=ownsSequenceIds,casttype=ID" json:"owns_sequence_ids,omitempty"`
    // Expression to use to compute the value of this column if this is a
    // computed column. Note that it is not correct to use ComputeExpr
    // as output to display to a user. User defined types within ComputeExpr
    // have been serialized in a internal format. Instead, use one of the
    // schemaexpr.FormatExpr* functions.
    ComputeExpr *string `protobuf:"bytes,11,opt,name=compute_expr,json=computeExpr" json:"compute_expr,omitempty"`
    // PGAttributeNum must be accessed through the accessor, since it is set
    // lazily, it is incorrect to access it directly.
    // PGAttributeNum represents a column's number in catalog tables.
    // This only differs from ID when the Column order is swapped or
    // the ColumnDescriptor must be remade while remaining visual ordering.
    // This does not exist in TableDescriptors pre 20.2.
    PGAttributeNum uint32 `protobuf:"varint,13,opt,name=pg_attribute_num,json=pgAttributeNum" json:"pg_attribute_num"`
    // Used to indicate column is used and dropped for ALTER COLUMN TYPE mutation.
    AlterColumnTypeInProgress bool `protobuf:"varint,14,opt,name=alter_column_type_in_progress,json=alterColumnTypeInProgress" json:"alter_column_type_in_progress"`
    // SystemColumnKind represents what kind of system column this column
    // descriptor represents, if any.
    SystemColumnKind SystemColumnKind `protobuf:"varint,15,opt,name=system_column_kind,json=systemColumnKind,enum=cockroach.sql.sqlbase.SystemColumnKind" json:"system_column_kind"`
}

func (*ColumnDescriptor) CheckCanBeFKRef Uses

func (desc *ColumnDescriptor) CheckCanBeFKRef() error

CheckCanBeFKRef returns whether the given column is computed.

func (*ColumnDescriptor) ColName Uses

func (desc *ColumnDescriptor) ColName() tree.Name

ColName returns the name of the column as a tree.Name.

func (*ColumnDescriptor) Descriptor Uses

func (*ColumnDescriptor) Descriptor() ([]byte, []int)

func (*ColumnDescriptor) Equal Uses

func (this *ColumnDescriptor) Equal(that interface{}) bool

func (ColumnDescriptor) GetPGAttributeNum Uses

func (desc ColumnDescriptor) GetPGAttributeNum() uint32

GetPGAttributeNum returns the PGAttributeNum of the ColumnDescriptor if the PGAttributeNum is set (non-zero). Returns the ID of the ColumnDescriptor if the PGAttributeNum is not set.

func (*ColumnDescriptor) HasDefault Uses

func (desc *ColumnDescriptor) HasDefault() bool

HasDefault returns true if the column has a default value.

func (*ColumnDescriptor) HasNullDefault Uses

func (desc *ColumnDescriptor) HasNullDefault() bool

HasNullDefault checks that the column descriptor has a default of NULL.

func (*ColumnDescriptor) IsComputed Uses

func (desc *ColumnDescriptor) IsComputed() bool

IsComputed returns true if this is a computed column.

func (*ColumnDescriptor) Marshal Uses

func (m *ColumnDescriptor) Marshal() (dAtA []byte, err error)

func (*ColumnDescriptor) MarshalTo Uses

func (m *ColumnDescriptor) MarshalTo(dAtA []byte) (int, error)

func (*ColumnDescriptor) ProtoMessage Uses

func (*ColumnDescriptor) ProtoMessage()

func (*ColumnDescriptor) Reset Uses

func (m *ColumnDescriptor) Reset()

func (*ColumnDescriptor) SQLStringNotHumanReadable Uses

func (desc *ColumnDescriptor) SQLStringNotHumanReadable() string

SQLStringNotHumanReadable returns the SQL statement describing the column.

Note that this function does not serialize user defined types into a human readable format. schemaexpr.FormatColumnForDisplay should be used in cases where human-readability is required.

func (*ColumnDescriptor) Size Uses

func (m *ColumnDescriptor) Size() (n int)

func (*ColumnDescriptor) String Uses

func (m *ColumnDescriptor) String() string

func (*ColumnDescriptor) Unmarshal Uses

func (m *ColumnDescriptor) Unmarshal(dAtA []byte) error

func (*ColumnDescriptor) XXX_DiscardUnknown Uses

func (m *ColumnDescriptor) XXX_DiscardUnknown()

func (*ColumnDescriptor) XXX_Marshal Uses

func (m *ColumnDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ColumnDescriptor) XXX_Merge Uses

func (dst *ColumnDescriptor) XXX_Merge(src proto.Message)

func (*ColumnDescriptor) XXX_Size Uses

func (m *ColumnDescriptor) XXX_Size() int

func (*ColumnDescriptor) XXX_Unmarshal Uses

func (m *ColumnDescriptor) XXX_Unmarshal(b []byte) error

type ColumnFamilyDescriptor Uses

type ColumnFamilyDescriptor struct {
    Name string `protobuf:"bytes,1,opt,name=name" json:"name"`
    // Column family 0 is *always* included in k/v pairs for a row. This makes
    // sure that rows will all NULL values still have a k/v pair. When performing
    // optimizations involving column families, ensure that column family 0
    // is scanned if the row may have nulls.
    ID  FamilyID `protobuf:"varint,2,opt,name=id,casttype=FamilyID" json:"id"`
    // A list of column names of which the family is comprised. This list
    // parallels the column_ids list. If duplicating the storage of the column
    // names here proves to be prohibitive, we could clear this field before
    // saving and reconstruct it after loading.
    ColumnNames []string `protobuf:"bytes,3,rep,name=column_names,json=columnNames" json:"column_names,omitempty"`
    // A list of column ids of which the family is comprised. This list parallels
    // the column_names list.
    ColumnIDs []ColumnID `protobuf:"varint,4,rep,name=column_ids,json=columnIds,casttype=ColumnID" json:"column_ids,omitempty"`
    // If nonzero, the column involved in the single column optimization.
    //
    // Families store columns in a ValueType_TUPLE as repeated <columnID><data>
    // entries. As a space optimization and for backward compatibility, a single
    // column is written without the column id prefix. Because more columns could
    // be added, it would be ambiguous which column was stored when read back in,
    // so this field supplies it.
    DefaultColumnID ColumnID `protobuf:"varint,5,opt,name=default_column_id,json=defaultColumnId,casttype=ColumnID" json:"default_column_id"`
}

ColumnFamilyDescriptor is set of columns stored together in one kv entry. For more information, look at `docs/tech-notes/encoding.md#value-encoding`.

func (*ColumnFamilyDescriptor) Descriptor Uses

func (*ColumnFamilyDescriptor) Descriptor() ([]byte, []int)

func (*ColumnFamilyDescriptor) Equal Uses

func (this *ColumnFamilyDescriptor) Equal(that interface{}) bool

func (*ColumnFamilyDescriptor) Marshal Uses

func (m *ColumnFamilyDescriptor) Marshal() (dAtA []byte, err error)

func (*ColumnFamilyDescriptor) MarshalTo Uses

func (m *ColumnFamilyDescriptor) MarshalTo(dAtA []byte) (int, error)

func (*ColumnFamilyDescriptor) ProtoMessage Uses

func (*ColumnFamilyDescriptor) ProtoMessage()

func (*ColumnFamilyDescriptor) Reset Uses

func (m *ColumnFamilyDescriptor) Reset()

func (*ColumnFamilyDescriptor) Size Uses

func (m *ColumnFamilyDescriptor) Size() (n int)

func (*ColumnFamilyDescriptor) String Uses

func (m *ColumnFamilyDescriptor) String() string

func (*ColumnFamilyDescriptor) Unmarshal Uses

func (m *ColumnFamilyDescriptor) Unmarshal(dAtA []byte) error

func (*ColumnFamilyDescriptor) XXX_DiscardUnknown Uses

func (m *ColumnFamilyDescriptor) XXX_DiscardUnknown()

func (*ColumnFamilyDescriptor) XXX_Marshal Uses

func (m *ColumnFamilyDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ColumnFamilyDescriptor) XXX_Merge Uses

func (dst *ColumnFamilyDescriptor) XXX_Merge(src proto.Message)

func (*ColumnFamilyDescriptor) XXX_Size Uses

func (m *ColumnFamilyDescriptor) XXX_Size() int

func (*ColumnFamilyDescriptor) XXX_Unmarshal Uses

func (m *ColumnFamilyDescriptor) XXX_Unmarshal(b []byte) error

type ColumnID Uses

type ColumnID tree.ColumnID

ColumnID is a custom type for ColumnDescriptor IDs.

func (ColumnID) SafeValue Uses

func (ColumnID) SafeValue()

SafeValue implements the redact.SafeValue interface.

type ColumnIDs Uses

type ColumnIDs []ColumnID

ColumnIDs is a slice of ColumnDescriptor IDs.

func (ColumnIDs) Contains Uses

func (c ColumnIDs) Contains(i ColumnID) bool

Contains returns whether this list contains the input ID.

func (ColumnIDs) Equals Uses

func (c ColumnIDs) Equals(input ColumnIDs) bool

Equals returns true if the input list is equal to this list.

func (ColumnIDs) HasPrefix Uses

func (c ColumnIDs) HasPrefix(input ColumnIDs) bool

HasPrefix returns true if the input list is a prefix of this list.

func (ColumnIDs) Len Uses

func (c ColumnIDs) Len() int

func (ColumnIDs) Less Uses

func (c ColumnIDs) Less(i, j int) bool

func (ColumnIDs) Swap Uses

func (c ColumnIDs) Swap(i, j int)

type ComputedColumnSwap Uses

type ComputedColumnSwap struct {
    NewColumnId ColumnID `protobuf:"varint,1,opt,name=new_column_id,json=newColumnId,casttype=ColumnID" json:"new_column_id"`
    OldColumnId ColumnID `protobuf:"varint,2,opt,name=old_column_id,json=oldColumnId,casttype=ColumnID" json:"old_column_id"`
    // inverse_expr is the expression used to compute values for the old column
    // once it is swapped for the new column.
    InverseExpr string `protobuf:"bytes,3,opt,name=inverse_expr,json=inverseExpr" json:"inverse_expr"`
}

ComputedColumnSwap is a mutation corresponding to the atomic swap phase where Column a' that is computed using Column a is swapped to replace Column a while Column a becomes computed using a'.

func (*ComputedColumnSwap) Descriptor Uses

func (*ComputedColumnSwap) Descriptor() ([]byte, []int)

func (*ComputedColumnSwap) Equal Uses

func (this *ComputedColumnSwap) Equal(that interface{}) bool

func (*ComputedColumnSwap) Marshal Uses

func (m *ComputedColumnSwap) Marshal() (dAtA []byte, err error)

func (*ComputedColumnSwap) MarshalTo Uses

func (m *ComputedColumnSwap) MarshalTo(dAtA []byte) (int, error)

func (*ComputedColumnSwap) ProtoMessage Uses

func (*ComputedColumnSwap) ProtoMessage()

func (*ComputedColumnSwap) Reset Uses

func (m *ComputedColumnSwap) Reset()

func (*ComputedColumnSwap) Size Uses

func (m *ComputedColumnSwap) Size() (n int)

func (*ComputedColumnSwap) String Uses

func (m *ComputedColumnSwap) String() string

func (*ComputedColumnSwap) Unmarshal Uses

func (m *ComputedColumnSwap) Unmarshal(dAtA []byte) error

func (*ComputedColumnSwap) XXX_DiscardUnknown Uses

func (m *ComputedColumnSwap) XXX_DiscardUnknown()

func (*ComputedColumnSwap) XXX_Marshal Uses

func (m *ComputedColumnSwap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ComputedColumnSwap) XXX_Merge Uses

func (dst *ComputedColumnSwap) XXX_Merge(src proto.Message)

func (*ComputedColumnSwap) XXX_Size Uses

func (m *ComputedColumnSwap) XXX_Size() int

func (*ComputedColumnSwap) XXX_Unmarshal Uses

func (m *ComputedColumnSwap) XXX_Unmarshal(b []byte) error

type ConstraintDetail Uses

type ConstraintDetail struct {
    Kind        ConstraintType
    Columns     []string
    Details     string
    Unvalidated bool

    // Only populated for PK and Unique Constraints.
    Index *IndexDescriptor

    // Only populated for FK Constraints.
    FK              *ForeignKeyConstraint
    ReferencedTable *TableDescriptor

    // Only populated for Check Constraints.
    CheckConstraint *TableDescriptor_CheckConstraint
}

ConstraintDetail describes a constraint.

TODO(ajwerner): Lift this up a level of abstraction next to the Immutable and have it store those for the ReferencedTable.

type ConstraintToUpdate Uses

type ConstraintToUpdate struct {
    ConstraintType ConstraintToUpdate_ConstraintType `protobuf:"varint,1,req,name=constraint_type,json=constraintType,enum=cockroach.sql.sqlbase.ConstraintToUpdate_ConstraintType" json:"constraint_type"`
    Name           string                            `protobuf:"bytes,2,req,name=name" json:"name"`
    Check          TableDescriptor_CheckConstraint   `protobuf:"bytes,3,opt,name=check" json:"check"`
    // All fields past 3 haven't been persisted before 19.2.
    ForeignKey    ForeignKeyConstraint `protobuf:"bytes,4,opt,name=foreign_key,json=foreignKey" json:"foreign_key"`
    NotNullColumn ColumnID             `protobuf:"varint,6,opt,name=not_null_column,json=notNullColumn,casttype=ColumnID" json:"not_null_column"`
}

ConstraintToUpdate represents a constraint to be added to the table and validated for existing rows. More generally, in the future, when we support adding constraints that are unvalidated for existing rows and can be validated later using VALIDATE CONSTRAINT, this mutation will also represent either adding an unvalidated constraint or validating an existing constraint.

This mutation effects changes only in the backfill step of the schema changer: First, a new version of the table descriptor with the constraint added is published, after all columns being added have been backfilled. After waiting for the constraint to be enforced for writes on all nodes, the constraint is then validated for all existing rows. This ensures that constraints added to columns that are being added are correctly enforced before the column becomes public.

func (*ConstraintToUpdate) Descriptor Uses

func (*ConstraintToUpdate) Descriptor() ([]byte, []int)

func (*ConstraintToUpdate) Equal Uses

func (this *ConstraintToUpdate) Equal(that interface{}) bool

func (*ConstraintToUpdate) Marshal Uses

func (m *ConstraintToUpdate) Marshal() (dAtA []byte, err error)

func (*ConstraintToUpdate) MarshalTo Uses

func (m *ConstraintToUpdate) MarshalTo(dAtA []byte) (int, error)

func (*ConstraintToUpdate) ProtoMessage Uses

func (*ConstraintToUpdate) ProtoMessage()

func (*ConstraintToUpdate) Reset Uses

func (m *ConstraintToUpdate) Reset()

func (*ConstraintToUpdate) Size Uses

func (m *ConstraintToUpdate) Size() (n int)

func (*ConstraintToUpdate) String Uses

func (m *ConstraintToUpdate) String() string

func (*ConstraintToUpdate) Unmarshal Uses

func (m *ConstraintToUpdate) Unmarshal(dAtA []byte) error

func (*ConstraintToUpdate) XXX_DiscardUnknown Uses

func (m *ConstraintToUpdate) XXX_DiscardUnknown()

func (*ConstraintToUpdate) XXX_Marshal Uses

func (m *ConstraintToUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ConstraintToUpdate) XXX_Merge Uses

func (dst *ConstraintToUpdate) XXX_Merge(src proto.Message)

func (*ConstraintToUpdate) XXX_Size Uses

func (m *ConstraintToUpdate) XXX_Size() int

func (*ConstraintToUpdate) XXX_Unmarshal Uses

func (m *ConstraintToUpdate) XXX_Unmarshal(b []byte) error

type ConstraintToUpdate_ConstraintType Uses

type ConstraintToUpdate_ConstraintType int32
const (
    ConstraintToUpdate_CHECK       ConstraintToUpdate_ConstraintType = 0
    ConstraintToUpdate_FOREIGN_KEY ConstraintToUpdate_ConstraintType = 1
    // NOT NULL constraints being added are represented by a dummy check
    // constraint so that a multi-state schema change, including a bulk
    // validation step, can occur. The check field contains the dummy
    // constraint.
    ConstraintToUpdate_NOT_NULL ConstraintToUpdate_ConstraintType = 2
)

func (ConstraintToUpdate_ConstraintType) Enum Uses

func (x ConstraintToUpdate_ConstraintType) Enum() *ConstraintToUpdate_ConstraintType

func (ConstraintToUpdate_ConstraintType) EnumDescriptor Uses

func (ConstraintToUpdate_ConstraintType) EnumDescriptor() ([]byte, []int)

func (ConstraintToUpdate_ConstraintType) String Uses

func (x ConstraintToUpdate_ConstraintType) String() string

func (*ConstraintToUpdate_ConstraintType) UnmarshalJSON Uses

func (x *ConstraintToUpdate_ConstraintType) UnmarshalJSON(data []byte) error

type ConstraintType Uses

type ConstraintType string

ConstraintType is used to identify the type of a constraint.

const (
    // ConstraintTypePK identifies a PRIMARY KEY constraint.
    ConstraintTypePK ConstraintType = "PRIMARY KEY"
    // ConstraintTypeFK identifies a FOREIGN KEY constraint.
    ConstraintTypeFK ConstraintType = "FOREIGN KEY"
    // ConstraintTypeUnique identifies a FOREIGN constraint.
    ConstraintTypeUnique ConstraintType = "UNIQUE"
    // ConstraintTypeCheck identifies a CHECK constraint.
    ConstraintTypeCheck ConstraintType = "CHECK"
)

type ConstraintValidity Uses

type ConstraintValidity int32
const (
    // The constraint is valid for all rows.
    ConstraintValidity_Validated ConstraintValidity = 0
    // The constraint has not yet been validated for all rows (and will not be
    // validated until VALIDATE CONSTRAINT is used).
    ConstraintValidity_Unvalidated ConstraintValidity = 1
    // The constraint was just added, but the validation for existing rows is not
    // yet complete. If validation fails, the constraint will be dropped.
    ConstraintValidity_Validating ConstraintValidity = 2
    // The constraint is being dropped in the schema changer.
    ConstraintValidity_Dropping ConstraintValidity = 3
)

func (ConstraintValidity) Enum Uses

func (x ConstraintValidity) Enum() *ConstraintValidity

func (ConstraintValidity) EnumDescriptor Uses

func (ConstraintValidity) EnumDescriptor() ([]byte, []int)

func (ConstraintValidity) String Uses

func (x ConstraintValidity) String() string

func (*ConstraintValidity) UnmarshalJSON Uses

func (x *ConstraintValidity) UnmarshalJSON(data []byte) error

type DatabaseDescriptor Uses

type DatabaseDescriptor struct {
    Name string `protobuf:"bytes,1,opt,name=name" json:"name"`
    ID   ID     `protobuf:"varint,2,opt,name=id,casttype=ID" json:"id"`
    // Last modification time of the descriptor.
    ModificationTime hlc.Timestamp        `protobuf:"bytes,4,opt,name=modification_time,json=modificationTime" json:"modification_time"`
    Version          DescriptorVersion    `protobuf:"varint,5,opt,name=version,casttype=DescriptorVersion" json:"version"`
    DrainingNames    []NameInfo           `protobuf:"bytes,6,rep,name=draining_names,json=drainingNames" json:"draining_names"`
    Privileges       *PrivilegeDescriptor `protobuf:"bytes,3,opt,name=privileges" json:"privileges,omitempty"`
    // schemas is a mapping from child schema name to ID. It is used during
    // name resolution to know without a KV lookup whether a database has a
    // child schema with a target name. Temporary schemas are not stored here.
    Schemas       map[string]DatabaseDescriptor_SchemaInfo `protobuf:"bytes,7,rep,name=schemas" json:"schemas" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
    State         DescriptorState                          `protobuf:"varint,8,opt,name=state,enum=cockroach.sql.sqlbase.DescriptorState" json:"state"`
    OfflineReason string                                   `protobuf:"bytes,9,opt,name=offline_reason,json=offlineReason" json:"offline_reason"`
}

DatabaseDescriptor represents a namespace (aka database) and is stored in a structured metadata key. The DatabaseDescriptor has a globally-unique ID shared with other Descriptors. Permissions are applied to all tables in the namespace.

func (*DatabaseDescriptor) Descriptor Uses

func (*DatabaseDescriptor) Descriptor() ([]byte, []int)

func (*DatabaseDescriptor) Equal Uses

func (this *DatabaseDescriptor) Equal(that interface{}) bool

func (*DatabaseDescriptor) GetDrainingNames Uses

func (m *DatabaseDescriptor) GetDrainingNames() []NameInfo

func (*DatabaseDescriptor) GetID Uses

func (m *DatabaseDescriptor) GetID() ID

func (*DatabaseDescriptor) GetModificationTime Uses

func (m *DatabaseDescriptor) GetModificationTime() hlc.Timestamp

func (*DatabaseDescriptor) GetName Uses

func (m *DatabaseDescriptor) GetName() string

func (*DatabaseDescriptor) GetOfflineReason Uses

func (m *DatabaseDescriptor) GetOfflineReason() string

func (*DatabaseDescriptor) GetPrivileges Uses

func (m *DatabaseDescriptor) GetPrivileges() *PrivilegeDescriptor

func (*DatabaseDescriptor) GetSchemas Uses

func (m *DatabaseDescriptor) GetSchemas() map[string]DatabaseDescriptor_SchemaInfo

func (*DatabaseDescriptor) GetState Uses

func (m *DatabaseDescriptor) GetState() DescriptorState

func (*DatabaseDescriptor) GetVersion Uses

func (m *DatabaseDescriptor) GetVersion() DescriptorVersion

func (*DatabaseDescriptor) Marshal Uses

func (m *DatabaseDescriptor) Marshal() (dAtA []byte, err error)

func (*DatabaseDescriptor) MarshalTo Uses

func (m *DatabaseDescriptor) MarshalTo(dAtA []byte) (int, error)

func (*DatabaseDescriptor) ProtoMessage Uses

func (*DatabaseDescriptor) ProtoMessage()

func (*DatabaseDescriptor) Reset Uses

func (m *DatabaseDescriptor) Reset()

func (*DatabaseDescriptor) Size Uses

func (m *DatabaseDescriptor) Size() (n int)

func (*DatabaseDescriptor) String Uses

func (m *DatabaseDescriptor) String() string

func (*DatabaseDescriptor) Unmarshal Uses

func (m *DatabaseDescriptor) Unmarshal(dAtA []byte) error

func (*DatabaseDescriptor) XXX_DiscardUnknown Uses

func (m *DatabaseDescriptor) XXX_DiscardUnknown()

func (*DatabaseDescriptor) XXX_Marshal Uses

func (m *DatabaseDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DatabaseDescriptor) XXX_Merge Uses

func (dst *DatabaseDescriptor) XXX_Merge(src proto.Message)

func (*DatabaseDescriptor) XXX_Size Uses

func (m *DatabaseDescriptor) XXX_Size() int

func (*DatabaseDescriptor) XXX_Unmarshal Uses

func (m *DatabaseDescriptor) XXX_Unmarshal(b []byte) error

type DatabaseDescriptor_SchemaInfo Uses

type DatabaseDescriptor_SchemaInfo struct {
    // ID is the ID of the schema.
    ID  ID  `protobuf:"varint,1,opt,name=id,casttype=ID" json:"id"`
    // dropped represents whether the schema is dropped or not. This field
    // is used in a similar way as the draining_names.
    Dropped bool `protobuf:"varint,2,opt,name=dropped" json:"dropped"`
}

SchemaInfo represents the state of a child user defined schema.

func (*DatabaseDescriptor_SchemaInfo) Descriptor Uses

func (*DatabaseDescriptor_SchemaInfo) Descriptor() ([]byte, []int)

func (*DatabaseDescriptor_SchemaInfo) Equal Uses

func (this *DatabaseDescriptor_SchemaInfo) Equal(that interface{}) bool

func (*DatabaseDescriptor_SchemaInfo) Marshal Uses

func (m *DatabaseDescriptor_SchemaInfo) Marshal() (dAtA []byte, err error)

func (*DatabaseDescriptor_SchemaInfo) MarshalTo Uses

func (m *DatabaseDescriptor_SchemaInfo) MarshalTo(dAtA []byte) (int, error)

func (*DatabaseDescriptor_SchemaInfo) ProtoMessage Uses

func (*DatabaseDescriptor_SchemaInfo) ProtoMessage()

func (*DatabaseDescriptor_SchemaInfo) Reset Uses

func (m *DatabaseDescriptor_SchemaInfo) Reset()

func (*DatabaseDescriptor_SchemaInfo) Size Uses

func (m *DatabaseDescriptor_SchemaInfo) Size() (n int)

func (*DatabaseDescriptor_SchemaInfo) String Uses

func (m *DatabaseDescriptor_SchemaInfo) String() string

func (*DatabaseDescriptor_SchemaInfo) Unmarshal Uses

func (m *DatabaseDescriptor_SchemaInfo) Unmarshal(dAtA []byte) error

func (*DatabaseDescriptor_SchemaInfo) XXX_DiscardUnknown Uses

func (m *DatabaseDescriptor_SchemaInfo) XXX_DiscardUnknown()

func (*DatabaseDescriptor_SchemaInfo) XXX_Marshal Uses

func (m *DatabaseDescriptor_SchemaInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DatabaseDescriptor_SchemaInfo) XXX_Merge Uses

func (dst *DatabaseDescriptor_SchemaInfo) XXX_Merge(src proto.Message)

func (*DatabaseDescriptor_SchemaInfo) XXX_Size Uses

func (m *DatabaseDescriptor_SchemaInfo) XXX_Size() int

func (*DatabaseDescriptor_SchemaInfo) XXX_Unmarshal Uses

func (m *DatabaseDescriptor_SchemaInfo) XXX_Unmarshal(b []byte) error

type DatumEncoding Uses

type DatumEncoding int32

DatumEncoding identifies the encoding used for an EncDatum.

const (
    // Indicates that the datum is encoded using the order-preserving encoding
    // used for keys (ascending order).
    DatumEncoding_ASCENDING_KEY DatumEncoding = 0
    // Indicates that the datum is encoded using the order-preserving encoding
    // used for keys (descending order).
    DatumEncoding_DESCENDING_KEY DatumEncoding = 1
    // Indicates that the datum is encoded using the encoding used for values.
    DatumEncoding_VALUE DatumEncoding = 2
)

func (DatumEncoding) Enum Uses

func (x DatumEncoding) Enum() *DatumEncoding

func (DatumEncoding) EnumDescriptor Uses

func (DatumEncoding) EnumDescriptor() ([]byte, []int)

func (DatumEncoding) String Uses

func (x DatumEncoding) String() string

func (*DatumEncoding) UnmarshalJSON Uses

func (x *DatumEncoding) UnmarshalJSON(data []byte) error

type Descriptor Uses

type Descriptor struct {
    // Types that are valid to be assigned to Union:
    //	*Descriptor_Table
    //	*Descriptor_Database
    //	*Descriptor_Type
    //	*Descriptor_Schema
    Union isDescriptor_Union `protobuf_oneof:"union"`
}

Descriptor is a union type for descriptors for tables, schemas, databases, and types.

func (*Descriptor) Descriptor Uses

func (*Descriptor) Descriptor() ([]byte, []int)

func (*Descriptor) Equal Uses

func (this *Descriptor) Equal(that interface{}) bool

func (*Descriptor) GetDatabase Uses

func (m *Descriptor) GetDatabase() *DatabaseDescriptor

func (*Descriptor) GetSchema Uses

func (m *Descriptor) GetSchema() *SchemaDescriptor

func (*Descriptor) GetTable Uses

func (m *Descriptor) GetTable() *TableDescriptor

func (*Descriptor) GetType Uses

func (m *Descriptor) GetType() *TypeDescriptor

func (*Descriptor) GetUnion Uses

func (m *Descriptor) GetUnion() isDescriptor_Union

func (*Descriptor) Marshal Uses

func (m *Descriptor) Marshal() (dAtA []byte, err error)

func (*Descriptor) MarshalTo Uses

func (m *Descriptor) MarshalTo(dAtA []byte) (int, error)

func (*Descriptor) ProtoMessage Uses

func (*Descriptor) ProtoMessage()

func (*Descriptor) Reset Uses

func (m *Descriptor) Reset()

func (*Descriptor) Size Uses

func (m *Descriptor) Size() (n int)

func (*Descriptor) String Uses

func (m *Descriptor) String() string

func (*Descriptor) Unmarshal Uses

func (m *Descriptor) Unmarshal(dAtA []byte) error

func (*Descriptor) XXX_DiscardUnknown Uses

func (m *Descriptor) XXX_DiscardUnknown()

func (*Descriptor) XXX_Marshal Uses

func (m *Descriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Descriptor) XXX_Merge Uses

func (dst *Descriptor) XXX_Merge(src proto.Message)

func (*Descriptor) XXX_OneofFuncs Uses

func (*Descriptor) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

func (*Descriptor) XXX_Size Uses

func (m *Descriptor) XXX_Size() int

func (*Descriptor) XXX_Unmarshal Uses

func (m *Descriptor) XXX_Unmarshal(b []byte) error

type DescriptorMutation Uses

type DescriptorMutation struct {
    // Types that are valid to be assigned to Descriptor_:
    //	*DescriptorMutation_Column
    //	*DescriptorMutation_Index
    //	*DescriptorMutation_Constraint
    //	*DescriptorMutation_PrimaryKeySwap
    //	*DescriptorMutation_ComputedColumnSwap
    //	*DescriptorMutation_MaterializedViewRefresh
    Descriptor_ isDescriptorMutation_Descriptor_ `protobuf_oneof:"descriptor"`
    State       DescriptorMutation_State         `protobuf:"varint,3,opt,name=state,enum=cockroach.sql.sqlbase.DescriptorMutation_State" json:"state"`
    Direction   DescriptorMutation_Direction     `protobuf:"varint,4,opt,name=direction,enum=cockroach.sql.sqlbase.DescriptorMutation_Direction" json:"direction"`
    // The mutation id used to group mutations that should be applied together.
    // This is used for situations like creating a unique column, which
    // involve adding two mutations: one for the column, and another for the
    // unique constraint index.
    MutationID MutationID `protobuf:"varint,5,opt,name=mutation_id,json=mutationId,casttype=MutationID" json:"mutation_id"`
    // Indicates that this mutation is a rollback.
    Rollback bool `protobuf:"varint,7,opt,name=rollback" json:"rollback"`
}

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. A table descriptor in the middle of a schema change will have a DescriptorMutation FIFO queue containing each column/index descriptor being added or dropped. Mutations for constraints work differently from columns and indexes; see the documentation for ConstraintToUpdate.

func (*DescriptorMutation) Descriptor Uses

func (*DescriptorMutation) Descriptor() ([]byte, []int)

func (*DescriptorMutation) Equal Uses

func (this *DescriptorMutation) Equal(that interface{}) bool

func (*DescriptorMutation) GetColumn Uses

func (m *DescriptorMutation) GetColumn() *ColumnDescriptor

func (*DescriptorMutation) GetComputedColumnSwap Uses

func (m *DescriptorMutation) GetComputedColumnSwap() *ComputedColumnSwap

func (*DescriptorMutation) GetConstraint Uses

func (m *DescriptorMutation) GetConstraint() *ConstraintToUpdate

func (*DescriptorMutation) GetDescriptor_ Uses

func (m *DescriptorMutation) GetDescriptor_() isDescriptorMutation_Descriptor_

func (*DescriptorMutation) GetIndex Uses

func (m *DescriptorMutation) GetIndex() *IndexDescriptor

func (*DescriptorMutation) GetMaterializedViewRefresh Uses

func (m *DescriptorMutation) GetMaterializedViewRefresh() *MaterializedViewRefresh

func (*DescriptorMutation) GetPrimaryKeySwap Uses

func (m *DescriptorMutation) GetPrimaryKeySwap() *PrimaryKeySwap

func (*DescriptorMutation) Marshal Uses

func (m *DescriptorMutation) Marshal() (dAtA []byte, err error)

func (*DescriptorMutation) MarshalTo Uses

func (m *DescriptorMutation) MarshalTo(dAtA []byte) (int, error)

func (*DescriptorMutation) ProtoMessage Uses

func (*DescriptorMutation) ProtoMessage()

func (*DescriptorMutation) Reset Uses

func (m *DescriptorMutation) Reset()

func (*DescriptorMutation) Size Uses

func (m *DescriptorMutation) Size() (n int)

func (*DescriptorMutation) String Uses

func (m *DescriptorMutation) String() string

func (*DescriptorMutation) Unmarshal Uses

func (m *DescriptorMutation) Unmarshal(dAtA []byte) error

func (*DescriptorMutation) XXX_DiscardUnknown Uses

func (m *DescriptorMutation) XXX_DiscardUnknown()

func (*DescriptorMutation) XXX_Marshal Uses

func (m *DescriptorMutation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DescriptorMutation) XXX_Merge Uses

func (dst *DescriptorMutation) XXX_Merge(src proto.Message)

func (*DescriptorMutation) XXX_OneofFuncs Uses

func (*DescriptorMutation) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

func (*DescriptorMutation) XXX_Size Uses

func (m *DescriptorMutation) XXX_Size() int

func (*DescriptorMutation) XXX_Unmarshal Uses

func (m *DescriptorMutation) XXX_Unmarshal(b []byte) error

type DescriptorMutation_Column Uses

type DescriptorMutation_Column struct {
    Column *ColumnDescriptor `protobuf:"bytes,1,opt,name=column,oneof"`
}

func (*DescriptorMutation_Column) Equal Uses

func (this *DescriptorMutation_Column) Equal(that interface{}) bool

func (*DescriptorMutation_Column) MarshalTo Uses

func (m *DescriptorMutation_Column) MarshalTo(dAtA []byte) (int, error)

func (*DescriptorMutation_Column) Size Uses

func (m *DescriptorMutation_Column) Size() (n int)

type DescriptorMutation_ComputedColumnSwap Uses

type DescriptorMutation_ComputedColumnSwap struct {
    ComputedColumnSwap *ComputedColumnSwap `protobuf:"bytes,10,opt,name=computedColumnSwap,oneof"`
}

func (*DescriptorMutation_ComputedColumnSwap) Equal Uses

func (this *DescriptorMutation_ComputedColumnSwap) Equal(that interface{}) bool

func (*DescriptorMutation_ComputedColumnSwap) MarshalTo Uses

func (m *DescriptorMutation_ComputedColumnSwap) MarshalTo(dAtA []byte) (int, error)

func (*DescriptorMutation_ComputedColumnSwap) Size Uses

func (m *DescriptorMutation_ComputedColumnSwap) Size() (n int)

type DescriptorMutation_Constraint Uses

type DescriptorMutation_Constraint struct {
    Constraint *ConstraintToUpdate `protobuf:"bytes,8,opt,name=constraint,oneof"`
}

func (*DescriptorMutation_Constraint) Equal Uses

func (this *DescriptorMutation_Constraint) Equal(that interface{}) bool

func (*DescriptorMutation_Constraint) MarshalTo Uses

func (m *DescriptorMutation_Constraint) MarshalTo(dAtA []byte) (int, error)

func (*DescriptorMutation_Constraint) Size Uses

func (m *DescriptorMutation_Constraint) Size() (n int)

type DescriptorMutation_Direction Uses

type DescriptorMutation_Direction int32

Direction of mutation.

const (
    // Not used.
    DescriptorMutation_NONE DescriptorMutation_Direction = 0
    // Descriptor is being added.
    DescriptorMutation_ADD DescriptorMutation_Direction = 1
    // Descriptor is being dropped.
    DescriptorMutation_DROP DescriptorMutation_Direction = 2
)

func (DescriptorMutation_Direction) Enum Uses

func (x DescriptorMutation_Direction) Enum() *DescriptorMutation_Direction

func (DescriptorMutation_Direction) EnumDescriptor Uses

func (DescriptorMutation_Direction) EnumDescriptor() ([]byte, []int)

func (DescriptorMutation_Direction) String Uses

func (x DescriptorMutation_Direction) String() string

func (*DescriptorMutation_Direction) UnmarshalJSON Uses

func (x *DescriptorMutation_Direction) UnmarshalJSON(data []byte) error

type DescriptorMutation_Index Uses

type DescriptorMutation_Index struct {
    Index *IndexDescriptor `protobuf:"bytes,2,opt,name=index,oneof"`
}

func (*DescriptorMutation_Index) Equal Uses

func (this *DescriptorMutation_Index) Equal(that interface{}) bool

func (*DescriptorMutation_Index) MarshalTo Uses

func (m *DescriptorMutation_Index) MarshalTo(dAtA []byte) (int, error)

func (*DescriptorMutation_Index) Size Uses

func (m *DescriptorMutation_Index) Size() (n int)

type DescriptorMutation_MaterializedViewRefresh Uses

type DescriptorMutation_MaterializedViewRefresh struct {
    MaterializedViewRefresh *MaterializedViewRefresh `protobuf:"bytes,11,opt,name=materializedViewRefresh,oneof"`
}

func (*DescriptorMutation_MaterializedViewRefresh) Equal Uses

func (this *DescriptorMutation_MaterializedViewRefresh) Equal(that interface{}) bool

func (*DescriptorMutation_MaterializedViewRefresh) MarshalTo Uses

func (m *DescriptorMutation_MaterializedViewRefresh) MarshalTo(dAtA []byte) (int, error)

func (*DescriptorMutation_MaterializedViewRefresh) Size Uses

func (m *DescriptorMutation_MaterializedViewRefresh) Size() (n int)

type DescriptorMutation_PrimaryKeySwap Uses

type DescriptorMutation_PrimaryKeySwap struct {
    PrimaryKeySwap *PrimaryKeySwap `protobuf:"bytes,9,opt,name=primaryKeySwap,oneof"`
}

func (*DescriptorMutation_PrimaryKeySwap) Equal Uses

func (this *DescriptorMutation_PrimaryKeySwap) Equal(that interface{}) bool

func (*DescriptorMutation_PrimaryKeySwap) MarshalTo Uses

func (m *DescriptorMutation_PrimaryKeySwap) MarshalTo(dAtA []byte) (int, error)

func (*DescriptorMutation_PrimaryKeySwap) Size Uses

func (m *DescriptorMutation_PrimaryKeySwap) Size() (n int)

type DescriptorMutation_State Uses

type DescriptorMutation_State int32

A descriptor within a mutation is unavailable for reads, writes and deletes. It is only available for implicit (internal to the database) writes and deletes depending on the state of the mutation.

const (
    // Not used.
    DescriptorMutation_UNKNOWN DescriptorMutation_State = 0
    // Operations can use this invisible descriptor to implicitly
    // delete entries.
    // Column: A descriptor in this state is invisible to
    // INSERT and UPDATE. DELETE must delete a column in this state.
    // Index: A descriptor in this state is invisible to an INSERT.
    // UPDATE must delete the old value of the index but doesn't write
    // the new value. DELETE must delete the index.
    //
    // When deleting a descriptor, all descriptor related data
    // (column or index data) can only be mass deleted once
    // all the nodes have transitioned to the DELETE_ONLY state.
    DescriptorMutation_DELETE_ONLY DescriptorMutation_State = 1
    // Operations can use this invisible descriptor to implicitly
    // write and delete entries.
    // Column: INSERT will populate this column with the default
    // value. UPDATE ignores this descriptor. DELETE must delete
    // the column.
    // Index: INSERT, UPDATE and DELETE treat this index like any
    // other index.
    //
    // When adding a descriptor, all descriptor related data
    // (column default or index data) can only be backfilled once
    // all nodes have transitioned into the DELETE_AND_WRITE_ONLY state.
    DescriptorMutation_DELETE_AND_WRITE_ONLY DescriptorMutation_State = 2
)

func (DescriptorMutation_State) Enum Uses

func (x DescriptorMutation_State) Enum() *DescriptorMutation_State

func (DescriptorMutation_State) EnumDescriptor Uses

func (DescriptorMutation_State) EnumDescriptor() ([]byte, []int)

func (DescriptorMutation_State) String Uses

func (x DescriptorMutation_State) String() string

func (*DescriptorMutation_State) UnmarshalJSON Uses

func (x *DescriptorMutation_State) UnmarshalJSON(data []byte) error

type DescriptorState Uses

type DescriptorState int32

State indicates whether a descriptor is public (i.e., normally visible, resolvable, etc.) or in some other state subject to restrictions. A non-public table descriptor cannot be leased. A schema changer observing DROP set will truncate the table and delete the descriptor. It is illegal to transition DROP to any other state.

const (
    // Not used.
    DescriptorState_PUBLIC DescriptorState = 0
    // Descriptor is being added.
    DescriptorState_ADD DescriptorState = 1
    // Descriptor is being dropped.
    DescriptorState_DROP DescriptorState = 2
    // Descriptor is offline (e.g. for bulk-ingestion). See offline_reason.
    DescriptorState_OFFLINE DescriptorState = 3
)

func GetDescriptorState Uses

func GetDescriptorState(desc *Descriptor) DescriptorState

GetDescriptorState returns the DescriptorState of the Descriptor.

func (DescriptorState) Enum Uses

func (x DescriptorState) Enum() *DescriptorState

func (DescriptorState) EnumDescriptor Uses

func (DescriptorState) EnumDescriptor() ([]byte, []int)

func (DescriptorState) String Uses

func (x DescriptorState) String() string

func (*DescriptorState) UnmarshalJSON Uses

func (x *DescriptorState) UnmarshalJSON(data []byte) error

type DescriptorVersion Uses

type DescriptorVersion uint32

DescriptorVersion is a custom type for TableDescriptor Versions.

func GetDescriptorVersion Uses

func GetDescriptorVersion(desc *Descriptor) DescriptorVersion

GetDescriptorVersion returns the Version of the descriptor.

func (DescriptorVersion) SafeValue Uses

func (DescriptorVersion) SafeValue()

SafeValue implements the redact.SafeValue interface.

type Descriptor_Database Uses

type Descriptor_Database struct {
    Database *DatabaseDescriptor `protobuf:"bytes,2,opt,name=database,oneof"`
}

func (*Descriptor_Database) Equal Uses

func (this *Descriptor_Database) Equal(that interface{}) bool

func (*Descriptor_Database) MarshalTo Uses

func (m *Descriptor_Database) MarshalTo(dAtA []byte) (int, error)

func (*Descriptor_Database) Size Uses

func (m *Descriptor_Database) Size() (n int)

type Descriptor_Schema Uses

type Descriptor_Schema struct {
    Schema *SchemaDescriptor `protobuf:"bytes,4,opt,name=schema,oneof"`
}

func (*Descriptor_Schema) Equal Uses

func (this *Descriptor_Schema) Equal(that interface{}) bool

func (*Descriptor_Schema) MarshalTo Uses

func (m *Descriptor_Schema) MarshalTo(dAtA []byte) (int, error)

func (*Descriptor_Schema) Size Uses

func (m *Descriptor_Schema) Size() (n int)

type Descriptor_Table Uses

type Descriptor_Table struct {
    Table *TableDescriptor `protobuf:"bytes,1,opt,name=table,oneof"`
}

func (*Descriptor_Table) Equal Uses

func (this *Descriptor_Table) Equal(that interface{}) bool

func (*Descriptor_Table) MarshalTo Uses

func (m *Descriptor_Table) MarshalTo(dAtA []byte) (int, error)

func (*Descriptor_Table) Size Uses

func (m *Descriptor_Table) Size() (n int)

type Descriptor_Type Uses

type Descriptor_Type struct {
    Type *TypeDescriptor `protobuf:"bytes,3,opt,name=type,oneof"`
}

func (*Descriptor_Type) Equal Uses

func (this *Descriptor_Type) Equal(that interface{}) bool

func (*Descriptor_Type) MarshalTo Uses

func (m *Descriptor_Type) MarshalTo(dAtA []byte) (int, error)

func (*Descriptor_Type) Size Uses

func (m *Descriptor_Type) Size() (n int)

type FamilyID Uses

type FamilyID uint32

FamilyID is a custom type for ColumnFamilyDescriptor IDs.

func (FamilyID) SafeValue Uses

func (FamilyID) SafeValue()

SafeValue implements the redact.SafeValue interface.

type ForeignKeyConstraint Uses

type ForeignKeyConstraint struct {
    OriginTableID       ID                         `protobuf:"varint,1,opt,name=origin_table_id,json=originTableId,casttype=ID" json:"origin_table_id"`
    OriginColumnIDs     []ColumnID                 `protobuf:"varint,2,rep,name=origin_column_ids,json=originColumnIds,casttype=ColumnID" json:"origin_column_ids,omitempty"`
    ReferencedColumnIDs []ColumnID                 `protobuf:"varint,3,rep,name=referenced_column_ids,json=referencedColumnIds,casttype=ColumnID" json:"referenced_column_ids,omitempty"`
    ReferencedTableID   ID                         `protobuf:"varint,4,opt,name=referenced_table_id,json=referencedTableId,casttype=ID" json:"referenced_table_id"`
    Name                string                     `protobuf:"bytes,5,opt,name=name" json:"name"`
    Validity            ConstraintValidity         `protobuf:"varint,6,opt,name=validity,enum=cockroach.sql.sqlbase.ConstraintValidity" json:"validity"`
    OnDelete            ForeignKeyReference_Action `protobuf:"varint,7,opt,name=on_delete,json=onDelete,enum=cockroach.sql.sqlbase.ForeignKeyReference_Action" json:"on_delete"`
    OnUpdate            ForeignKeyReference_Action `protobuf:"varint,8,opt,name=on_update,json=onUpdate,enum=cockroach.sql.sqlbase.ForeignKeyReference_Action" json:"on_update"`
    // This is only important for composite keys. For all prior matches before
    // the addition of this value, MATCH SIMPLE will be used.
    Match ForeignKeyReference_Match `protobuf:"varint,9,opt,name=match,enum=cockroach.sql.sqlbase.ForeignKeyReference_Match" json:"match"`
}

ForeignKeyConstraint is the new (as of 19.2 and VersionTopLevelForeignKeys) representation for foreign keys. It's stored on the TableDescriptor and is designed to be agnostic to which indexes are available on both the origin and referenced tables, so that the optimizer can have full freedom to choose the best possible index to satisfy constraint checks at runtime.

func (*ForeignKeyConstraint) Descriptor Uses

func (*ForeignKeyConstraint) Descriptor() ([]byte, []int)

func (*ForeignKeyConstraint) Equal Uses

func (this *ForeignKeyConstraint) Equal(that interface{}) bool

func (*ForeignKeyConstraint) Marshal Uses

func (m *ForeignKeyConstraint) Marshal() (dAtA []byte, err error)

func (*ForeignKeyConstraint) MarshalTo Uses

func (m *ForeignKeyConstraint) MarshalTo(dAtA []byte) (int, error)

func (*ForeignKeyConstraint) ProtoMessage Uses

func (*ForeignKeyConstraint) ProtoMessage()

func (*ForeignKeyConstraint) Reset Uses

func (m *ForeignKeyConstraint) Reset()

func (*ForeignKeyConstraint) Size Uses

func (m *ForeignKeyConstraint) Size() (n int)

func (*ForeignKeyConstraint) String Uses

func (m *ForeignKeyConstraint) String() string

func (*ForeignKeyConstraint) Unmarshal Uses

func (m *ForeignKeyConstraint) Unmarshal(dAtA []byte) error

func (*ForeignKeyConstraint) XXX_DiscardUnknown Uses

func (m *ForeignKeyConstraint) XXX_DiscardUnknown()

func (*ForeignKeyConstraint) XXX_Marshal Uses

func (m *ForeignKeyConstraint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ForeignKeyConstraint) XXX_Merge Uses

func (dst *ForeignKeyConstraint) XXX_Merge(src proto.Message)

func (*ForeignKeyConstraint) XXX_Size Uses

func (m *ForeignKeyConstraint) XXX_Size() int

func (*ForeignKeyConstraint) XXX_Unmarshal Uses

func (m *ForeignKeyConstraint) XXX_Unmarshal(b []byte) error

type ForeignKeyReference Uses

type ForeignKeyReference struct {
    Table    ID                 `protobuf:"varint,1,opt,name=table,casttype=ID" json:"table"`
    Index    IndexID            `protobuf:"varint,2,opt,name=index,casttype=IndexID" json:"index"`
    Name     string             `protobuf:"bytes,3,opt,name=name" json:"name"`
    Validity ConstraintValidity `protobuf:"varint,4,opt,name=validity,enum=cockroach.sql.sqlbase.ConstraintValidity" json:"validity"`
    // If this FK only uses a prefix of the columns in its index, we record how
    // many to avoid spuriously counting the additional cols as used by this FK.
    SharedPrefixLen int32                      `protobuf:"varint,5,opt,name=shared_prefix_len,json=sharedPrefixLen" json:"shared_prefix_len"`
    OnDelete        ForeignKeyReference_Action `protobuf:"varint,6,opt,name=on_delete,json=onDelete,enum=cockroach.sql.sqlbase.ForeignKeyReference_Action" json:"on_delete"`
    OnUpdate        ForeignKeyReference_Action `protobuf:"varint,7,opt,name=on_update,json=onUpdate,enum=cockroach.sql.sqlbase.ForeignKeyReference_Action" json:"on_update"`
    // This is only important for composite keys. For all prior matches before
    // the addition of this value, MATCH SIMPLE will be used.
    Match ForeignKeyReference_Match `protobuf:"varint,8,opt,name=match,enum=cockroach.sql.sqlbase.ForeignKeyReference_Match" json:"match"`
}

ForeignKeyReference is deprecated, replaced by ForeignKeyConstraint in v19.2 (though it is still possible for table descriptors on disk to have ForeignKeyReferences).

It is still used to describe interleavings (see IndexDescriptor.InterleavedBy), for which it is a poor choice: only the Table and Index fields are used, and the interleaving has nothing to do with traditional foreign key references.

func (*ForeignKeyReference) Descriptor Uses

func (*ForeignKeyReference) Descriptor() ([]byte, []int)

func (*ForeignKeyReference) Equal Uses

func (this *ForeignKeyReference) Equal(that interface{}) bool

func (ForeignKeyReference) IsSet Uses

func (f ForeignKeyReference) IsSet() bool

IsSet returns whether or not the foreign key actually references a table.

func (*ForeignKeyReference) Marshal Uses

func (m *ForeignKeyReference) Marshal() (dAtA []byte, err error)

func (*ForeignKeyReference) MarshalTo Uses

func (m *ForeignKeyReference) MarshalTo(dAtA []byte) (int, error)

func (*ForeignKeyReference) ProtoMessage Uses

func (*ForeignKeyReference) ProtoMessage()

func (*ForeignKeyReference) Reset Uses

func (m *ForeignKeyReference) Reset()

func (*ForeignKeyReference) Size Uses

func (m *ForeignKeyReference) Size() (n int)

func (*ForeignKeyReference) String Uses

func (m *ForeignKeyReference) String() string

func (*ForeignKeyReference) Unmarshal Uses

func (m *ForeignKeyReference) Unmarshal(dAtA []byte) error

func (*ForeignKeyReference) XXX_DiscardUnknown Uses

func (m *ForeignKeyReference) XXX_DiscardUnknown()

func (*ForeignKeyReference) XXX_Marshal Uses

func (m *ForeignKeyReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ForeignKeyReference) XXX_Merge Uses

func (dst *ForeignKeyReference) XXX_Merge(src proto.Message)

func (*ForeignKeyReference) XXX_Size Uses

func (m *ForeignKeyReference) XXX_Size() int

func (*ForeignKeyReference) XXX_Unmarshal Uses

func (m *ForeignKeyReference) XXX_Unmarshal(b []byte) error

type ForeignKeyReference_Action Uses

type ForeignKeyReference_Action int32
const (
    ForeignKeyReference_NO_ACTION   ForeignKeyReference_Action = 0
    ForeignKeyReference_RESTRICT    ForeignKeyReference_Action = 1
    ForeignKeyReference_SET_NULL    ForeignKeyReference_Action = 2
    ForeignKeyReference_SET_DEFAULT ForeignKeyReference_Action = 3
    ForeignKeyReference_CASCADE     ForeignKeyReference_Action = 4
)

func (ForeignKeyReference_Action) Enum Uses

func (x ForeignKeyReference_Action) Enum() *ForeignKeyReference_Action

func (ForeignKeyReference_Action) EnumDescriptor Uses

func (ForeignKeyReference_Action) EnumDescriptor() ([]byte, []int)

func (ForeignKeyReference_Action) MarshalJSON Uses

func (x ForeignKeyReference_Action) MarshalJSON() ([]byte, error)

func (ForeignKeyReference_Action) String Uses

func (x ForeignKeyReference_Action) String() string

String implements the fmt.Stringer interface.

func (*ForeignKeyReference_Action) UnmarshalJSON Uses

func (x *ForeignKeyReference_Action) UnmarshalJSON(data []byte) error

type ForeignKeyReference_Match Uses

type ForeignKeyReference_Match int32

Match is the algorithm used to compare composite keys.

const (
    ForeignKeyReference_SIMPLE  ForeignKeyReference_Match = 0
    ForeignKeyReference_FULL    ForeignKeyReference_Match = 1
    ForeignKeyReference_PARTIAL ForeignKeyReference_Match = 2
)

func (ForeignKeyReference_Match) Enum Uses

func (x ForeignKeyReference_Match) Enum() *ForeignKeyReference_Match

func (ForeignKeyReference_Match) EnumDescriptor Uses

func (ForeignKeyReference_Match) EnumDescriptor() ([]byte, []int)

func (ForeignKeyReference_Match) MarshalJSON Uses

func (x ForeignKeyReference_Match) MarshalJSON() ([]byte, error)

func (ForeignKeyReference_Match) String Uses

func (x ForeignKeyReference_Match) String() string

String implements the fmt.Stringer interface.

func (*ForeignKeyReference_Match) UnmarshalJSON Uses

func (x *ForeignKeyReference_Match) UnmarshalJSON(data []byte) error

type FormatVersion Uses

type FormatVersion uint32

FormatVersion is a custom type for TableDescriptor versions of the sql to key:value mapping. go:generate stringer -type=FormatVersion

const (

    // BaseFormatVersion corresponds to the encoding described in
    // https://www.cockroachlabs.com/blog/sql-in-cockroachdb-mapping-table-data-to-key-value-storage/.
    BaseFormatVersion FormatVersion
    // FamilyFormatVersion corresponds to the encoding described in
    // https://github.com/cockroachdb/cockroach/blob/master/docs/RFCS/20151214_sql_column_families.md
    FamilyFormatVersion
    // InterleavedFormatVersion corresponds to the encoding described in
    // https://github.com/cockroachdb/cockroach/blob/master/docs/RFCS/20160624_sql_interleaved_tables.md
    InterleavedFormatVersion
)

func (FormatVersion) String Uses

func (i FormatVersion) String() string

type ID Uses

type ID tree.ID

ID is a custom type for {Database,Table}Descriptor IDs.

const InvalidID ID = 0

InvalidID is the uninitialised descriptor id.

func GetDescriptorID Uses

func GetDescriptorID(desc *Descriptor) ID

GetDescriptorID returns the ID of the descriptor.

func (ID) SafeValue Uses

func (ID) SafeValue()

SafeValue implements the redact.SafeValue interface.

type IDs Uses

type IDs []ID

IDs is a sortable list of IDs.

func (IDs) Len Uses

func (ids IDs) Len() int

func (IDs) Less Uses

func (ids IDs) Less(i, j int) bool

func (IDs) Swap Uses

func (ids IDs) Swap(i, j int)

type IndexDescriptor Uses

type IndexDescriptor struct {
    Name    string                 `protobuf:"bytes,1,opt,name=name" json:"name"`
    ID      IndexID                `protobuf:"varint,2,opt,name=id,casttype=IndexID" json:"id"`
    Unique  bool                   `protobuf:"varint,3,opt,name=unique" json:"unique"`
    Version IndexDescriptorVersion `protobuf:"varint,18,opt,name=version,casttype=IndexDescriptorVersion" json:"version"`
    // An ordered list of column names of which the index is comprised; these
    // columns do not include any additional stored columns (which are in
    // stored_column_names). This list parallels the column_ids list.
    //
    // Note: if duplicating the storage of the column names here proves to be
    // prohibitive, we could clear this field before saving and reconstruct it
    // after loading.
    ColumnNames []string `protobuf:"bytes,4,rep,name=column_names,json=columnNames" json:"column_names,omitempty"`
    // The sort direction of each column in column_names.
    ColumnDirections []IndexDescriptor_Direction `protobuf:"varint,8,rep,name=column_directions,json=columnDirections,enum=cockroach.sql.sqlbase.IndexDescriptor_Direction" json:"column_directions,omitempty"`
    // An ordered list of column names which the index stores in addition to the
    // columns which are explicitly part of the index (STORING clause). Only used
    // for secondary indexes.
    StoreColumnNames []string `protobuf:"bytes,5,rep,name=store_column_names,json=storeColumnNames" json:"store_column_names,omitempty"`
    // An ordered list of column IDs of which the index is comprised. This list
    // parallels the column_names list and does not include any additional stored
    // columns.
    ColumnIDs []ColumnID `protobuf:"varint,6,rep,name=column_ids,json=columnIds,casttype=ColumnID" json:"column_ids,omitempty"`
    // An ordered list of IDs for the additional columns associated with the
    // index:
    //  - implicit columns, which are all the primary key columns that are not
    //    already part of the index (i.e. PrimaryIndex.column_ids - column_ids).
    //  - stored columns (the columns in store_column_names) if this index uses the
    //    old STORING encoding (key-encoded data).
    //
    // Only used for secondary indexes.
    // For non-unique indexes, these columns are appended to the key.
    // For unique indexes, these columns are stored in the value (unless the key
    // contains a NULL value: then the extra columns are appended to the key to
    // unique-ify it).
    // This distinction exists because we want to be able to insert an entry using
    // a single conditional put on the key.
    ExtraColumnIDs []ColumnID `protobuf:"varint,7,rep,name=extra_column_ids,json=extraColumnIds,casttype=ColumnID" json:"extra_column_ids,omitempty"`
    // An ordered list of column IDs that parallels store_column_names if this
    // index uses the new STORING encoding (value-encoded data, always in the KV
    // value).
    StoreColumnIDs []ColumnID `protobuf:"varint,14,rep,name=store_column_ids,json=storeColumnIds,casttype=ColumnID" json:"store_column_ids,omitempty"`
    // CompositeColumnIDs contains an ordered list of IDs of columns that appear
    // in the index and have a composite encoding. Includes IDs from both
    // column_ids and extra_column_ids.
    CompositeColumnIDs []ColumnID `protobuf:"varint,13,rep,name=composite_column_ids,json=compositeColumnIds,casttype=ColumnID" json:"composite_column_ids,omitempty"`
    // ForeignKey and ReferencedBy are deprecated and not stored from 19.2 onward.
    ForeignKey   ForeignKeyReference   `protobuf:"bytes,9,opt,name=foreign_key,json=foreignKey" json:"foreign_key"`        // Deprecated: Do not use.
    ReferencedBy []ForeignKeyReference `protobuf:"bytes,10,rep,name=referenced_by,json=referencedBy" json:"referenced_by"` // Deprecated: Do not use.
    // Interleave, if it's not the zero value, describes how this index's data is
    // interleaved into another index's data.
    Interleave InterleaveDescriptor `protobuf:"bytes,11,opt,name=interleave" json:"interleave"`
    // InterleavedBy contains a reference to every table/index that is interleaved
    // into this one.
    //
    // Note that any of these indexes can themselves be interleaved by other
    // tables but this list contains only those for which this index is a direct
    // interleave parent.
    //
    // Only the Table and Index fields of the ForeignKeyReference are used. And
    // despite the message used here, interleavings don't have to have
    // corresponding foreign key references (and whether they do or not is
    // irrelevant for this field).
    InterleavedBy []ForeignKeyReference `protobuf:"bytes,12,rep,name=interleaved_by,json=interleavedBy" json:"interleaved_by"`
    // Partitioning, if it's not the zero value, describes how this index's data
    // is partitioned into spans of keys each addressable by zone configs.
    Partitioning PartitioningDescriptor `protobuf:"bytes,15,opt,name=partitioning" json:"partitioning"`
    // Type is the type of index, inverted or forward.
    Type IndexDescriptor_Type `protobuf:"varint,16,opt,name=type,enum=cockroach.sql.sqlbase.IndexDescriptor_Type" json:"type"`
    // CreatedExplicitly specifies whether this index was created explicitly
    // (i.e. via 'CREATE INDEX' statement).
    CreatedExplicitly bool `protobuf:"varint,17,opt,name=created_explicitly,json=createdExplicitly" json:"created_explicitly"`
    // EncodingType represents what sort of k/v encoding is used to store this descriptor on disk.
    // As of now, this includes the existing secondary index encoding, or the primary index encoding.
    // N.B. This field is only recognized on secondary indexes.
    EncodingType IndexDescriptorEncodingType `protobuf:"varint,19,opt,name=encoding_type,json=encodingType,casttype=IndexDescriptorEncodingType" json:"encoding_type"`
    // Sharded, if it's not the zero value, describes how this index is sharded.
    Sharded ShardedDescriptor `protobuf:"bytes,20,opt,name=sharded" json:"sharded"`
    // Disabled is used by the DROP PRIMARY KEY command to mark
    // that this index is disabled for further use.
    Disabled bool `protobuf:"varint,21,opt,name=disabled" json:"disabled"`
    // GeoConfig, if it's not the zero value, describes configuration for
    // this geospatial inverted index.
    GeoConfig geoindex.Config `protobuf:"bytes,22,opt,name=geo_config,json=geoConfig" json:"geo_config"`
    // Predicate, if it's not empty, indicates that the index is a partial index
    // with Predicate as the expression. If Predicate is empty, the index is not
    // a partial index. Columns are referred to in the expression by their name.
    // TODO(mgartner): Update the comment to explain that columns are referenced
    // by their ID once #49766 is addressed.
    Predicate string `protobuf:"bytes,23,opt,name=predicate" json:"predicate"`
}

IndexDescriptor describes an index (primary or secondary).

Sample field values on the following table:

CREATE TABLE t (
  k1 INT NOT NULL,   // column ID: 1
  k2 INT NOT NULL,   // column ID: 2
  u INT NULL,        // column ID: 3
  v INT NULL,        // column ID: 4
  w INT NULL,        // column ID: 5
  CONSTRAINT "primary" PRIMARY KEY (k1, k2),
  INDEX k1v (k1, v) STORING (w),
  FAMILY "primary" (k1, k2, u, v, w)
)

Primary index:

name:                primary
id:                  1
unique:              true
column_names:        k1, k2
column_directions:   ASC, ASC
column_ids:          1, 2   // k1, k2

[old STORING encoding] Index k1v (k1, v) STORING (w):

name:                k1v
id:                  2
unique:              false
column_names:        k1, v
column_directions:   ASC, ASC
store_column_names:  w
column_ids:          1, 4   // k1, v
extra_column_ids:    2, 5   // k2, w

[new STORING encoding] Index k1v (k1, v) STORING (w):

name:                k1v
id:                  2
unique:              false
column_names:        k1, v
column_directions:   ASC, ASC
store_column_names:  w
column_ids:          1, 4   // k1, v
extra_column_ids:    2      // k2
store_column_ids:    5      // w

func (*IndexDescriptor) ColNamesFormat Uses

func (desc *IndexDescriptor) ColNamesFormat(ctx *tree.FmtCtx)

ColNamesFormat writes a string describing the column names and directions in this index to the given buffer.

func (*IndexDescriptor) ColNamesString Uses

func (desc *IndexDescriptor) ColNamesString() string

ColNamesString returns a string describing the column names and directions in this index.

func (*IndexDescriptor) ContainsColumnID Uses

func (desc *IndexDescriptor) ContainsColumnID(colID ColumnID) bool

ContainsColumnID returns true if the index descriptor contains the specified column ID either in its explicit column IDs, the extra column IDs, or the stored column IDs.

func (*IndexDescriptor) Descriptor Uses

func (*IndexDescriptor) Descriptor() ([]byte, []int)

func (*IndexDescriptor) Equal Uses

func (this *IndexDescriptor) Equal(that interface{}) bool

func (*IndexDescriptor) FillColumns Uses

func (desc *IndexDescriptor) FillColumns(elems tree.IndexElemList) error

FillColumns sets the column names and directions in desc.

func (*IndexDescriptor) FullColumnIDs Uses

func (desc *IndexDescriptor) FullColumnIDs() ([]ColumnID, []IndexDescriptor_Direction)

FullColumnIDs returns the index column IDs including any extra (implicit or stored (old STORING encoding)) column IDs for non-unique indexes. It also returns the direction with which each column was encoded.

func (*IndexDescriptor) GetEncodingType Uses

func (desc *IndexDescriptor) GetEncodingType(primaryIndexID IndexID) IndexDescriptorEncodingType

GetEncodingType returns the encoding type of this index. For backward compatibility reasons, this might not match what is stored in desc.EncodingType. The primary index's ID must be passed so we can check if this index is primary or secondary.

func (*IndexDescriptor) HasOldStoredColumns Uses

func (desc *IndexDescriptor) HasOldStoredColumns() bool

HasOldStoredColumns returns whether the index has stored columns in the old format (data encoded the same way as if they were in an implicit column).

func (*IndexDescriptor) IsInterleaved Uses

func (desc *IndexDescriptor) IsInterleaved() bool

IsInterleaved returns whether the index is interleaved or not.

func (*IndexDescriptor) IsPartial Uses

func (desc *IndexDescriptor) IsPartial() bool

IsPartial returns true if the index is a partial index.

func (*IndexDescriptor) IsSharded Uses

func (desc *IndexDescriptor) IsSharded() bool

IsSharded returns whether the index is hash sharded or not.

func (*IndexDescriptor) IsValidOriginIndex Uses

func (desc *IndexDescriptor) IsValidOriginIndex(originColIDs ColumnIDs) bool

IsValidOriginIndex returns whether the index can serve as an origin index for a foreign key constraint with the provided set of originColIDs.

func (*IndexDescriptor) IsValidReferencedIndex Uses

func (desc *IndexDescriptor) IsValidReferencedIndex(referencedColIDs ColumnIDs) bool

IsValidReferencedIndex returns whether the index can serve as a referenced index for a foreign key constraint with the provided set of referencedColumnIDs.

func (*IndexDescriptor) Marshal Uses

func (m *IndexDescriptor) Marshal() (dAtA []byte, err error)

func (*IndexDescriptor) MarshalTo Uses

func (m *IndexDescriptor) MarshalTo(dAtA []byte) (int, error)

func (*IndexDescriptor) ProtoMessage Uses

func (*IndexDescriptor) ProtoMessage()

func (*IndexDescriptor) Reset Uses

func (m *IndexDescriptor) Reset()

func (*IndexDescriptor) RunOverAllColumns Uses

func (desc *IndexDescriptor) RunOverAllColumns(fn func(id ColumnID) error) error

RunOverAllColumns applies its argument fn to each of the column IDs in desc. If there is an error, that error is returned immediately.

func (*IndexDescriptor) Size Uses

func (m *IndexDescriptor) Size() (n int)

func (*IndexDescriptor) String Uses

func (m *IndexDescriptor) String() string

func (*IndexDescriptor) Unmarshal Uses

func (m *IndexDescriptor) Unmarshal(dAtA []byte) error

func (*IndexDescriptor) XXX_DiscardUnknown Uses

func (m *IndexDescriptor) XXX_DiscardUnknown()

func (*IndexDescriptor) XXX_Marshal Uses

func (m *IndexDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*IndexDescriptor) XXX_Merge Uses

func (dst *IndexDescriptor) XXX_Merge(src proto.Message)

func (*IndexDescriptor) XXX_Size Uses

func (m *IndexDescriptor) XXX_Size() int

func (*IndexDescriptor) XXX_Unmarshal Uses

func (m *IndexDescriptor) XXX_Unmarshal(b []byte) error

type IndexDescriptorEncodingType Uses

type IndexDescriptorEncodingType uint32

IndexDescriptorEncodingType is a custom type to represent different encoding types for secondary indexes.

const (
    // SecondaryIndexEncoding corresponds to the standard way of encoding secondary indexes
    // as described in docs/tech-notes/encoding.md. We allow the 0 value of this type
    // to have a value so that existing descriptors are encoding using this encoding.
    SecondaryIndexEncoding IndexDescriptorEncodingType = iota
    // PrimaryIndexEncoding corresponds to when a secondary index is encoded using the
    // primary index encoding as described in docs/tech-notes/encoding.md.
    PrimaryIndexEncoding
)

type IndexDescriptorVersion Uses

type IndexDescriptorVersion uint32

IndexDescriptorVersion is a custom type for IndexDescriptor Versions.

const (
    // BaseIndexFormatVersion corresponds to the original encoding of secondary indexes that
    // don't respect table level column family definitions. We allow the 0 value of the type to
    // have a value so that existing index descriptors are denoted as having the base format.
    BaseIndexFormatVersion IndexDescriptorVersion = iota
    // SecondaryIndexFamilyFormatVersion corresponds to the encoding of secondary indexes that
    // use table level column family definitions.
    SecondaryIndexFamilyFormatVersion
)

func (IndexDescriptorVersion) SafeValue Uses

func (IndexDescriptorVersion) SafeValue()

SafeValue implements the redact.SafeValue interface.

type IndexDescriptor_Direction Uses

type IndexDescriptor_Direction int32

The direction of a column in the index.

const (
    IndexDescriptor_ASC  IndexDescriptor_Direction = 0
    IndexDescriptor_DESC IndexDescriptor_Direction = 1
)

func (IndexDescriptor_Direction) Enum Uses

func (x IndexDescriptor_Direction) Enum() *IndexDescriptor_Direction

func (IndexDescriptor_Direction) EnumDescriptor Uses

func (IndexDescriptor_Direction) EnumDescriptor() ([]byte, []int)

func (IndexDescriptor_Direction) String Uses

func (x IndexDescriptor_Direction) String() string

func (IndexDescriptor_Direction) ToEncodingDirection Uses

func (dir IndexDescriptor_Direction) ToEncodingDirection() (encoding.Direction, error)

ToEncodingDirection converts a direction from the proto to an encoding.Direction.

func (*IndexDescriptor_Direction) UnmarshalJSON Uses

func (x *IndexDescriptor_Direction) UnmarshalJSON(data []byte) error

type IndexDescriptor_Type Uses

type IndexDescriptor_Type int32

The type of the index.

const (
    IndexDescriptor_FORWARD  IndexDescriptor_Type = 0
    IndexDescriptor_INVERTED IndexDescriptor_Type = 1
)

func (IndexDescriptor_Type) Enum Uses

func (x IndexDescriptor_Type) Enum() *IndexDescriptor_Type

func (IndexDescriptor_Type) EnumDescriptor Uses

func (IndexDescriptor_Type) EnumDescriptor() ([]byte, []int)

func (IndexDescriptor_Type) String Uses

func (x IndexDescriptor_Type) String() string

func (*IndexDescriptor_Type) UnmarshalJSON Uses

func (x *IndexDescriptor_Type) UnmarshalJSON(data []byte) error

type IndexID Uses

type IndexID tree.IndexID

IndexID is a custom type for IndexDescriptor IDs.

func (IndexID) SafeValue Uses

func (IndexID) SafeValue()

SafeValue implements the redact.SafeValue interface.

type InterleaveDescriptor Uses

type InterleaveDescriptor struct {
    // Ancestors contains the nesting of interleaves in the order they appear in
    // an encoded key. This means they are always in the far-to-near ancestor
    // order (e.g. grand-grand-parent, grand-parent, parent).
    Ancestors []InterleaveDescriptor_Ancestor `protobuf:"bytes,1,rep,name=ancestors" json:"ancestors"`
}

InterleaveDescriptor represents an index (either primary or secondary) that is interleaved into another table's data.

Example: Table 1 -> /a/b Table 2 -> /a/b/c Table 3 -> /a/b/c/d

There are two components (table 2 is the parent and table 1 is the grandparent) with shared lengths 2 and 1.

func (*InterleaveDescriptor) Descriptor Uses

func (*InterleaveDescriptor) Descriptor() ([]byte, []int)

func (*InterleaveDescriptor) Equal Uses

func (this *InterleaveDescriptor) Equal(that interface{}) bool

func (*InterleaveDescriptor) Marshal Uses

func (m *InterleaveDescriptor) Marshal() (dAtA []byte, err error)

func (*InterleaveDescriptor) MarshalTo Uses

func (m *InterleaveDescriptor) MarshalTo(dAtA []byte) (int, error)

func (*InterleaveDescriptor) ProtoMessage Uses

func (*InterleaveDescriptor) ProtoMessage()

func (*InterleaveDescriptor) Reset Uses

func (m *InterleaveDescriptor) Reset()

func (*InterleaveDescriptor) Size Uses

func (m *InterleaveDescriptor) Size() (n int)

func (*InterleaveDescriptor) String Uses

func (m *InterleaveDescriptor) String() string

func (*InterleaveDescriptor) Unmarshal Uses

func (m *InterleaveDescriptor) Unmarshal(dAtA []byte) error

func (*InterleaveDescriptor) XXX_DiscardUnknown Uses

func (m *InterleaveDescriptor) XXX_DiscardUnknown()

func (*InterleaveDescriptor) XXX_Marshal Uses

func (m *InterleaveDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*InterleaveDescriptor) XXX_Merge Uses

func (dst *InterleaveDescriptor) XXX_Merge(src proto.Message)

func (*InterleaveDescriptor) XXX_Size Uses

func (m *InterleaveDescriptor) XXX_Size() int

func (*InterleaveDescriptor) XXX_Unmarshal Uses

func (m *InterleaveDescriptor) XXX_Unmarshal(b []byte) error

type InterleaveDescriptor_Ancestor Uses

type InterleaveDescriptor_Ancestor struct {
    // TableID is the ID of the table being interleaved into.
    TableID ID  `protobuf:"varint,1,opt,name=table_id,json=tableId,casttype=ID" json:"table_id"`
    // IndexID is the ID of the parent index being interleaved into.
    IndexID IndexID `protobuf:"varint,2,opt,name=index_id,json=indexId,casttype=IndexID" json:"index_id"`
    // SharedPrefixLen is how many fields are shared between a parent and child
    // being interleaved, excluding any fields shared between parent and
    // grandparent. Thus, the sum of SharedPrefixLens in the components of an
    // InterleaveDescriptor is never more than the number of fields in the index
    // being interleaved.
    // In cockroach 1.0, this value did not exist and thus a check for > 0
    // must be performed prior to its use.
    SharedPrefixLen uint32 `protobuf:"varint,3,opt,name=shared_prefix_len,json=sharedPrefixLen" json:"shared_prefix_len"`
}

func (*InterleaveDescriptor_Ancestor) Descriptor Uses

func (*InterleaveDescriptor_Ancestor) Descriptor() ([]byte, []int)

func (*InterleaveDescriptor_Ancestor) Equal Uses

func (this *InterleaveDescriptor_Ancestor) Equal(that interface{}) bool

func (*InterleaveDescriptor_Ancestor) Marshal Uses

func (m *InterleaveDescriptor_Ancestor) Marshal() (dAtA []byte, err error)

func (*InterleaveDescriptor_Ancestor) MarshalTo Uses

func (m *InterleaveDescriptor_Ancestor) MarshalTo(dAtA []byte) (int, error)

func (*InterleaveDescriptor_Ancestor) ProtoMessage Uses

func (*InterleaveDescriptor_Ancestor) ProtoMessage()

func (*InterleaveDescriptor_Ancestor) Reset Uses

func (m *InterleaveDescriptor_Ancestor) Reset()

func (*InterleaveDescriptor_Ancestor) Size Uses

func (m *InterleaveDescriptor_Ancestor) Size() (n int)

func (*InterleaveDescriptor_Ancestor) String Uses

func (m *InterleaveDescriptor_Ancestor) String() string

func (*InterleaveDescriptor_Ancestor) Unmarshal Uses

func (m *InterleaveDescriptor_Ancestor) Unmarshal(dAtA []byte) error

func (*InterleaveDescriptor_Ancestor) XXX_DiscardUnknown Uses

func (m *InterleaveDescriptor_Ancestor) XXX_DiscardUnknown()

func (*InterleaveDescriptor_Ancestor) XXX_Marshal Uses

func (m *InterleaveDescriptor_Ancestor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*InterleaveDescriptor_Ancestor) XXX_Merge Uses

func (dst *InterleaveDescriptor_Ancestor) XXX_Merge(src proto.Message)

func (*InterleaveDescriptor_Ancestor) XXX_Size Uses

func (m *InterleaveDescriptor_Ancestor) XXX_Size() int

func (*InterleaveDescriptor_Ancestor) XXX_Unmarshal Uses

func (m *InterleaveDescriptor_Ancestor) XXX_Unmarshal(b []byte) error

type JoinType Uses

type JoinType int32

JoinType is the particular type of a join (or join-like) operation. Not all values are used in all contexts.

const (
    JoinType_INNER       JoinType = 0
    JoinType_LEFT_OUTER  JoinType = 1
    JoinType_RIGHT_OUTER JoinType = 2
    JoinType_FULL_OUTER  JoinType = 3
    // 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).
    JoinType_LEFT_SEMI JoinType = 4
    // 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).
    JoinType_LEFT_ANTI JoinType = 5
    // INTERSECT_ALL is a special join-like operation that is only used for
    // INTERSECT ALL and INTERSECT operations.
    //
    // It is similar to a left semi join, except that if there are multiple left
    // rows that have the same values on the equality columns, only as many of
    // those are returned as there are matches on the right side.
    //
    // In practice, there is a one-to-one mapping between the left and right
    // columns (they are all equality columns).
    //
    // For example:
    //
    //       Left    Right    Result
    //       1       1        1
    //       1       2        2
    //       2       2        2
    //       2       3        3
    //       3       3
    //               3
    JoinType_INTERSECT_ALL JoinType = 6
    // EXCEPT_ALL is a special join-like operation that is only used for EXCEPT
    // ALL and EXCEPT operations.
    //
    // It is similar to a left anti join, except that if there are multiple left
    // rows that have the same values on the equality columns, only as many of
    // those are removed as there are matches on the right side.
    //
    // In practice, there is a one-to-one mapping between the left and right
    // columns (they are all equality columns).
    //
    // For example:
    //
    //       Left    Right    Result
    //       1       1        1
    //       1       2        2
    //       2       3        2
    //       2       3
    //       2       3
    //       3
    //       3
    //
    //
    // In practice, there is a one-to-one mapping between the left and right
    // columns (they are all equality columns).
    JoinType_EXCEPT_ALL JoinType = 7
)

func JoinTypeFromAstString Uses

func JoinTypeFromAstString(joinStr string) JoinType

JoinTypeFromAstString takes a join string as found in a SQL statement (e.g. "INNER JOIN") and returns the JoinType.

func (JoinType) Enum Uses

func (x JoinType) Enum() *JoinType

func (JoinType) EnumDescriptor Uses

func (JoinType) EnumDescriptor() ([]byte, []int)

func (JoinType) IsSetOpJoin Uses

func (j JoinType) IsSetOpJoin() bool

IsSetOpJoin returns true if this join is a set operation.

func (JoinType) ShouldIncludeRightColsInOutput Uses

func (j JoinType) ShouldIncludeRightColsInOutput() bool

ShouldIncludeRightColsInOutput returns true if this join should include the columns from the right side into the output.

func (JoinType) String Uses

func (x JoinType) String() string

func (*JoinType) UnmarshalJSON Uses

func (x *JoinType) UnmarshalJSON(data []byte) error

type MaterializedViewRefresh Uses

type MaterializedViewRefresh struct {
    // NewPrimaryIndex is the new primary index of the view to backfill into.
    // NewPrimaryIndex and NewIndexes below are copies of the existing indexes on
    // the view, but with different ID's.
    NewPrimaryIndex IndexDescriptor `protobuf:"bytes,1,opt,name=new_primary_index,json=newPrimaryIndex" json:"new_primary_index"`
    // NewIndexes are the new set of indexes to backfill the view into.
    NewIndexes []IndexDescriptor `protobuf:"bytes,2,rep,name=new_indexes,json=newIndexes" json:"new_indexes"`
    // AsOf is the timestamp to perform the view query at.
    AsOf hlc.Timestamp `protobuf:"bytes,3,opt,name=as_of,json=asOf" json:"as_of"`
    // ShouldBackfill indicates whether or not the schema changer should backfill
    // the query into the new indexes. This can be false if the `WITH NO DATA` flag
    // was specified for the `REFRESH MATERIALIZED VIEW` statement. `WITH NO DATA`
    // indicates that the user just wants the space used by the view to be reclaimed.
    ShouldBackfill bool `protobuf:"varint,4,opt,name=should_backfill,json=shouldBackfill" json:"should_backfill"`
}

MaterializedViewRefresh is a mutation corresponding to a request to refresh a materialized view. The mutation operates by backfilling the result of the view query into the indexes specified by the mutation.

func (*MaterializedViewRefresh) Descriptor Uses

func (*MaterializedViewRefresh) Descriptor() ([]byte, []int)

func (*MaterializedViewRefresh) Equal Uses

func (this *MaterializedViewRefresh) Equal(that interface{}) bool

func (*MaterializedViewRefresh) Marshal Uses

func (m *MaterializedViewRefresh) Marshal() (dAtA []byte, err error)

func (*MaterializedViewRefresh) MarshalTo Uses

func (m *MaterializedViewRefresh) MarshalTo(dAtA []byte) (int, error)

func (*MaterializedViewRefresh) ProtoMessage Uses

func (*MaterializedViewRefresh) ProtoMessage()

func (*MaterializedViewRefresh) Reset Uses

func (m *MaterializedViewRefresh) Reset()

func (*MaterializedViewRefresh) Size Uses

func (m *MaterializedViewRefresh) Size() (n int)

func (*MaterializedViewRefresh) String Uses

func (m *MaterializedViewRefresh) String() string

func (*MaterializedViewRefresh) Unmarshal Uses

func (m *MaterializedViewRefresh) Unmarshal(dAtA []byte) error

func (*MaterializedViewRefresh) XXX_DiscardUnknown Uses

func (m *MaterializedViewRefresh) XXX_DiscardUnknown()

func (*MaterializedViewRefresh) XXX_Marshal Uses

func (m *MaterializedViewRefresh) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MaterializedViewRefresh) XXX_Merge Uses

func (dst *MaterializedViewRefresh) XXX_Merge(src proto.Message)

func (*MaterializedViewRefresh) XXX_Size Uses

func (m *MaterializedViewRefresh) XXX_Size() int

func (*MaterializedViewRefresh) XXX_Unmarshal Uses

func (m *MaterializedViewRefresh) XXX_Unmarshal(b []byte) error

type MutationID Uses

type MutationID uint32

MutationID is a custom type for TableDescriptor mutations.

const InvalidMutationID MutationID = 0

InvalidMutationID is the uninitialised mutation id.

func (MutationID) SafeValue Uses

func (MutationID) SafeValue()

SafeValue implements the redact.SafeValue interface.

type NameInfo Uses

type NameInfo struct {
    // The database that the table belonged to before the rename (tables can be
    // renamed from one db to another).
    ParentID ID  `protobuf:"varint,1,opt,name=parent_id,json=parentId,casttype=ID" json:"parent_id"`
    // The schemaID of the schema the table belongs to before the rename/drop.
    // Required to correctly identify which namespace entry to reclaim.
    ParentSchemaID ID     `protobuf:"varint,3,opt,name=parent_schema_id,json=parentSchemaId,casttype=ID" json:"parent_schema_id"`
    Name           string `protobuf:"bytes,2,opt,name=name" json:"name"`
}

A table descriptor is named through a name map stored in the system.namespace table: a map from {parent_id, table_name} -> id. This name map can be cached for performance on a node in the cluster making reassigning a name complicated. In particular, since a name cannot be withdrawn across a cluster in a transaction at timestamp T, we have to worry about the following:

1. A table is dropped at T, and the name and descriptor are still cached and used by transactions at timestamps >= T. 2. A table is renamed from foo to bar at T, and both names foo and bar can be used by transactions at timestamps >= T. 3. A name foo is reassigned from one table to another at T, and the name foo can reference two different tables at timestamps >= T.

The system ensures that a name can be resolved only to a single descriptor at a timestamp thereby permitting 1 and 2, but not 3 (the name references two tables).

The transaction at T is followed by a time period when names no longer a part of the namespace are drained from the system. Once the old name is drained from the system another transaction at timestamp S is executed to release the name for future use. The interval from T to S is called the name drain interval: If the T transaction is removing the name foo then, at timestamps above S, foo can no longer be resolved.

Consider a transaction at T in which name B is dropped, a new name C is created. Name C is viable as soon as the transaction commits. When the transaction at S commits, the name B is released for reuse.

The transaction at S runs through the schema changer, with the system returning a response to the client initiating transaction T only after transaction at S is committed. So effectively the SQL transaction once it returns can be followed by SQL transactions that do not observe old name mappings.

Note: an exception to this is #19925 which needs to be fixed.

In order for transaction at S to act properly the system.namespace table entry for an old name references the descriptor who was the prior owner of the name requiring draining.

Before T: B -> Desc B

After T and before S: B -> Desc B, C -> Desc C

After S: C -> Desc C

Between T and S the name B is drained and the system is unable to assign it to another descriptor.

BEGIN; RENAME foo TO bar; CREATE foo;

will fail because CREATE foo is executed at T.

RENAME foo TO bar; CREATE foo;

will succeed because the RENAME returns after S and CREATE foo is executed after S.

The above scheme suffers from the problem that a transaction can observe the partial effect of a committed transaction during the drain interval. For instance during the drain interval a transaction can see the correct assignment for C, and the old assignments for B.

func (*NameInfo) Descriptor Uses

func (*NameInfo) Descriptor() ([]byte, []int)

func (*NameInfo) Equal Uses

func (this *NameInfo) Equal(that interface{}) bool

func (*NameInfo) Marshal Uses

func (m *NameInfo) Marshal() (dAtA []byte, err error)

func (*NameInfo) MarshalTo Uses

func (m *NameInfo) MarshalTo(dAtA []byte) (int, error)

func (*NameInfo) ProtoMessage Uses

func (*NameInfo) ProtoMessage()

func (*NameInfo) Reset Uses

func (m *NameInfo) Reset()

func (*NameInfo) Size Uses

func (m *NameInfo) Size() (n int)

func (*NameInfo) String Uses

func (m *NameInfo) String() string

func (*NameInfo) Unmarshal Uses

func (m *NameInfo) Unmarshal(dAtA []byte) error

func (*NameInfo) XXX_DiscardUnknown Uses

func (m *NameInfo) XXX_DiscardUnknown()

func (*NameInfo) XXX_Marshal Uses

func (m *NameInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*NameInfo) XXX_Merge Uses

func (dst *NameInfo) XXX_Merge(src proto.Message)

func (*NameInfo) XXX_Size Uses

func (m *NameInfo) XXX_Size() int

func (*NameInfo) XXX_Unmarshal Uses

func (m *NameInfo) XXX_Unmarshal(b []byte) error

type PartitioningDescriptor Uses

type PartitioningDescriptor struct {
    // NumColumns is how large of a prefix of the columns in an index are used in
    // the function mapping column values to partitions. If this is a
    // subpartition, this is offset to start from the end of the parent
    // partition's columns. If NumColumns is 0, then there is no partitioning.
    NumColumns uint32 `protobuf:"varint,1,opt,name=num_columns,json=numColumns" json:"num_columns"`
    // Exactly one of List or Range is required to be non-empty if NumColumns is
    // non-zero.
    List  []PartitioningDescriptor_List  `protobuf:"bytes,2,rep,name=list" json:"list"`
    Range []PartitioningDescriptor_Range `protobuf:"bytes,3,rep,name=range" json:"range"`
}

PartitioningDescriptor represents the partitioning of an index into spans of keys addressable by a zone config. The key encoding is unchanged. Each partition may optionally be itself divided into further partitions, called subpartitions.

func (*PartitioningDescriptor) Descriptor Uses

func (*PartitioningDescriptor) Descriptor() ([]byte, []int)

func (*PartitioningDescriptor) Equal Uses

func (this *PartitioningDescriptor) Equal(that interface{}) bool

func (*PartitioningDescriptor) FindPartitionByName Uses

func (desc *PartitioningDescriptor) FindPartitionByName(name string) *PartitioningDescriptor

FindPartitionByName searches this partitioning descriptor for a partition whose name is the input and returns it, or nil if no match is found.

func (*PartitioningDescriptor) Marshal Uses

func (m *PartitioningDescriptor) Marshal() (dAtA []byte, err error)

func (*PartitioningDescriptor) MarshalTo Uses

func (m *PartitioningDescriptor) MarshalTo(dAtA []byte) (int, error)

func (*PartitioningDescriptor) PartitionNames Uses

func (desc *PartitioningDescriptor) PartitionNames() []string

PartitionNames returns a slice containing the name of every partition and subpartition in an arbitrary order.

func (*PartitioningDescriptor) ProtoMessage Uses

func (*PartitioningDescriptor) ProtoMessage()

func (*PartitioningDescriptor) Reset Uses

func (m *PartitioningDescriptor) Reset()

func (*PartitioningDescriptor) Size Uses

func (m *PartitioningDescriptor) Size() (n int)

func (*PartitioningDescriptor) String Uses

func (m *PartitioningDescriptor) String() string

func (*PartitioningDescriptor) Unmarshal Uses

func (m *PartitioningDescriptor) Unmarshal(dAtA []byte) error

func (*PartitioningDescriptor) XXX_DiscardUnknown Uses

func (m *PartitioningDescriptor) XXX_DiscardUnknown()

func (*PartitioningDescriptor) XXX_Marshal Uses

func (m *PartitioningDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PartitioningDescriptor) XXX_Merge Uses

func (dst *PartitioningDescriptor) XXX_Merge(src proto.Message)

func (*PartitioningDescriptor) XXX_Size Uses

func (m *PartitioningDescriptor) XXX_Size() int

func (*PartitioningDescriptor) XXX_Unmarshal Uses

func (m *PartitioningDescriptor) XXX_Unmarshal(b []byte) error

type PartitioningDescriptor_List Uses

type PartitioningDescriptor_List struct {
    // Name is the partition name.
    Name string `protobuf:"bytes,1,opt,name=name" json:"name"`
    // Values is an unordered set of the tuples included in this partition. Each
    // tuple is encoded with the EncDatum value encoding. DEFAULT is encoded as
    // NOT NULL followed by PartitionDefaultVal encoded as a non-sorting
    // uvarint.
    Values [][]byte `protobuf:"bytes,2,rep,name=values" json:"values,omitempty"`
    // Subpartitioning represents a further partitioning of this list partition.
    Subpartitioning PartitioningDescriptor `protobuf:"bytes,3,opt,name=subpartitioning" json:"subpartitioning"`
}

List represents a list partitioning, which maps individual tuples to partitions.

func (*PartitioningDescriptor_List) Descriptor Uses

func (*PartitioningDescriptor_List) Descriptor() ([]byte, []int)

func (*PartitioningDescriptor_List) Equal Uses

func (this *PartitioningDescriptor_List) Equal(that interface{}) bool

func (*PartitioningDescriptor_List) Marshal Uses

func (m *PartitioningDescriptor_List) Marshal() (dAtA []byte, err error)

func (*PartitioningDescriptor_List) MarshalTo Uses

func (m *PartitioningDescriptor_List) MarshalTo(dAtA []byte) (int, error)

func (*PartitioningDescriptor_List) ProtoMessage Uses

func (*PartitioningDescriptor_List) ProtoMessage()

func (*PartitioningDescriptor_List) Reset Uses

func (m *PartitioningDescriptor_List) Reset()

func (*PartitioningDescriptor_List) Size Uses

func (m *PartitioningDescriptor_List) Size() (n int)

func (*PartitioningDescriptor_List) String Uses

func (m *PartitioningDescriptor_List) String() string

func (*PartitioningDescriptor_List) Unmarshal Uses

func (m *PartitioningDescriptor_List) Unmarshal(dAtA []byte) error

func (*PartitioningDescriptor_List) XXX_DiscardUnknown Uses

func (m *PartitioningDescriptor_List) XXX_DiscardUnknown()

func (*PartitioningDescriptor_List) XXX_Marshal Uses

func (m *PartitioningDescriptor_List) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PartitioningDescriptor_List) XXX_Merge Uses

func (dst *PartitioningDescriptor_List) XXX_Merge(src proto.Message)

func (*PartitioningDescriptor_List) XXX_Size Uses

func (m *PartitioningDescriptor_List) XXX_Size() int

func (*PartitioningDescriptor_List) XXX_Unmarshal Uses

func (m *PartitioningDescriptor_List) XXX_Unmarshal(b []byte) error

type PartitioningDescriptor_Range Uses

type PartitioningDescriptor_Range struct {
    // Name is the partition name.
    Name string `protobuf:"bytes,1,opt,name=name" json:"name"`
    // FromInclusive is the inclusive lower bound of this range partition. It is
    // encoded with the EncDatum value encoding. MINVALUE and MAXVALUE are
    // encoded as NOT NULL followed by a PartitionSpecialValCode encoded as a
    // non-sorting uvarint.
    FromInclusive []byte `protobuf:"bytes,3,opt,name=from_inclusive,json=fromInclusive" json:"from_inclusive,omitempty"`
    // ToExclusive is the exclusive upper bound of this range partition. It is
    // encoded in the same way as From.
    ToExclusive []byte `protobuf:"bytes,2,opt,name=to_exclusive,json=toExclusive" json:"to_exclusive,omitempty"`
}

Range represents a range partitioning, which maps ranges of tuples to partitions by specifying exclusive upper bounds. The range partitions in a PartitioningDescriptor are required to be sorted by UpperBound.

func (*PartitioningDescriptor_Range) Descriptor Uses

func (*PartitioningDescriptor_Range) Descriptor() ([]byte, []int)

func (*PartitioningDescriptor_Range) Equal Uses

func (this *PartitioningDescriptor_Range) Equal(that interface{}) bool

func (*PartitioningDescriptor_Range) Marshal Uses

func (m *PartitioningDescriptor_Range) Marshal() (dAtA []byte, err error)

func (*PartitioningDescriptor_Range) MarshalTo Uses

func (m *PartitioningDescriptor_Range) MarshalTo(dAtA []byte) (int, error)

func (*PartitioningDescriptor_Range) ProtoMessage Uses

func (*PartitioningDescriptor_Range) ProtoMessage()

func (*PartitioningDescriptor_Range) Reset Uses

func (m *PartitioningDescriptor_Range) Reset()

func (*PartitioningDescriptor_Range) Size Uses

func (m *PartitioningDescriptor_Range) Size() (n int)

func (*PartitioningDescriptor_Range) String Uses

func (m *PartitioningDescriptor_Range) String() string

func (*PartitioningDescriptor_Range) Unmarshal Uses

func (m *PartitioningDescriptor_Range) Unmarshal(dAtA []byte) error

func (*PartitioningDescriptor_Range) XXX_DiscardUnknown Uses

func (m *PartitioningDescriptor_Range) XXX_DiscardUnknown()

func (*PartitioningDescriptor_Range) XXX_Marshal Uses

func (m *PartitioningDescriptor_Range) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PartitioningDescriptor_Range) XXX_Merge Uses

func (dst *PartitioningDescriptor_Range) XXX_Merge(src proto.Message)

func (*PartitioningDescriptor_Range) XXX_Size Uses

func (m *PartitioningDescriptor_Range) XXX_Size() int

func (*PartitioningDescriptor_Range) XXX_Unmarshal Uses

func (m *PartitioningDescriptor_Range) XXX_Unmarshal(b []byte) error

type PrimaryKeySwap Uses

type PrimaryKeySwap struct {
    // old_primary_index_id is the ID of the old primary index for the table.
    OldPrimaryIndexId IndexID `protobuf:"varint,4,opt,name=old_primary_index_id,json=oldPrimaryIndexId,casttype=IndexID" json:"old_primary_index_id"`
    // new_primary_index_id is the ID of the new primary index for the table.
    NewPrimaryIndexId IndexID `protobuf:"varint,1,opt,name=new_primary_index_id,json=newPrimaryIndexId,casttype=IndexID" json:"new_primary_index_id"`
    // old_indexes and new_indexes are lists of IndexID's where the i'th index in old_indexes will be
    // swapped out with the i'th index in new_indexes.
    OldIndexes []IndexID `protobuf:"varint,2,rep,name=old_indexes,json=oldIndexes,casttype=IndexID" json:"old_indexes,omitempty"`
    NewIndexes []IndexID `protobuf:"varint,3,rep,name=new_indexes,json=newIndexes,casttype=IndexID" json:"new_indexes,omitempty"`
}

PrimaryKeySwap is a mutation corresponding to the atomic swap phase during a primary key change where old versions of indexes are exchanged for updated versions, and the table's new primary key is written into the descriptor.

func (*PrimaryKeySwap) Descriptor Uses

func (*PrimaryKeySwap) Descriptor() ([]byte, []int)

func (*PrimaryKeySwap) Equal Uses

func (this *PrimaryKeySwap) Equal(that interface{}) bool

func (*PrimaryKeySwap) Marshal Uses

func (m *PrimaryKeySwap) Marshal() (dAtA []byte, err error)

func (*PrimaryKeySwap) MarshalTo Uses

func (m *PrimaryKeySwap) MarshalTo(dAtA []byte) (int, error)

func (*PrimaryKeySwap) ProtoMessage Uses

func (*PrimaryKeySwap) ProtoMessage()

func (*PrimaryKeySwap) Reset Uses

func (m *PrimaryKeySwap) Reset()

func (*PrimaryKeySwap) Size Uses

func (m *PrimaryKeySwap) Size() (n int)

func (*PrimaryKeySwap) String Uses

func (m *PrimaryKeySwap) String() string

func (*PrimaryKeySwap) Unmarshal Uses

func (m *PrimaryKeySwap) Unmarshal(dAtA []byte) error

func (*PrimaryKeySwap) XXX_DiscardUnknown Uses

func (m *PrimaryKeySwap) XXX_DiscardUnknown()

func (*PrimaryKeySwap) XXX_Marshal Uses

func (m *PrimaryKeySwap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PrimaryKeySwap) XXX_Merge Uses

func (dst *PrimaryKeySwap) XXX_Merge(src proto.Message)

func (*PrimaryKeySwap) XXX_Size Uses

func (m *PrimaryKeySwap) XXX_Size() int

func (*PrimaryKeySwap) XXX_Unmarshal Uses

func (m *PrimaryKeySwap) XXX_Unmarshal(b []byte) error

type PrivilegeDescVersion Uses

type PrivilegeDescVersion uint32

PrivilegeDescVersion is a custom type for PrivilegeDescriptor versions. go:generate stringer -type=PrivilegeDescVersion

const (
    // InitialVersion corresponds to all descriptors created before 20.1.
    // These descriptors may not have owners explicitly set.
    InitialVersion PrivilegeDescVersion = iota

    // OwnerVersion corresponds to descriptors created 20.2 and onward.
    // These descriptors should always have owner set.
    OwnerVersion
)

func (PrivilegeDescVersion) String Uses

func (i PrivilegeDescVersion) String() string

type PrivilegeDescriptor Uses

type PrivilegeDescriptor struct {
    Users   []UserPrivileges     `protobuf:"bytes,1,rep,name=users" json:"users"`
    Owner   string               `protobuf:"bytes,2,opt,name=owner" json:"owner"`
    Version PrivilegeDescVersion `protobuf:"varint,3,opt,name=version,casttype=PrivilegeDescVersion" json:"version"`
}

PrivilegeDescriptor describes a list of users and attached privileges. The list should be sorted by user for fast access.

func NewCustomSuperuserPrivilegeDescriptor Uses

func NewCustomSuperuserPrivilegeDescriptor(priv privilege.List, owner string) *PrivilegeDescriptor

NewCustomSuperuserPrivilegeDescriptor returns a privilege descriptor for the root user and the admin role with specified privileges.

func NewDefaultPrivilegeDescriptor Uses

func NewDefaultPrivilegeDescriptor(owner string) *PrivilegeDescriptor

NewDefaultPrivilegeDescriptor returns a privilege descriptor with ALL privileges for the root user and admin role.

func NewPrivilegeDescriptor Uses

func NewPrivilegeDescriptor(user string, priv privilege.List, owner string) *PrivilegeDescriptor

NewPrivilegeDescriptor returns a privilege descriptor for the given user with the specified list of privileges.

func (PrivilegeDescriptor) AnyPrivilege Uses

func (p PrivilegeDescriptor) AnyPrivilege(user string) bool

AnyPrivilege returns true if 'user' has any privilege on this descriptor.

func (PrivilegeDescriptor) CheckPrivilege Uses

func (p PrivilegeDescriptor) CheckPrivilege(user string, priv privilege.Kind) bool

CheckPrivilege returns true if 'user' has 'privilege' on this descriptor.

func (*PrivilegeDescriptor) Descriptor Uses

func (*PrivilegeDescriptor) Descriptor() ([]byte, []int)

func (*PrivilegeDescriptor) Equal Uses

func (this *PrivilegeDescriptor) Equal(that interface{}) bool

func (*PrivilegeDescriptor) Grant Uses

func (p *PrivilegeDescriptor) Grant(user string, privList privilege.List)

Grant adds new privileges to this descriptor for a given list of users. TODO(marc): if all privileges other than ALL are set, should we collapse them into ALL?

func (*PrivilegeDescriptor) Marshal Uses

func (m *PrivilegeDescriptor) Marshal() (dAtA []byte, err error)

func (*PrivilegeDescriptor) MarshalTo Uses

func (m *PrivilegeDescriptor) MarshalTo(dAtA []byte) (int, error)

func (*PrivilegeDescriptor) ProtoMessage Uses

func (*PrivilegeDescriptor) ProtoMessage()

func (*PrivilegeDescriptor) Reset Uses

func (m *PrivilegeDescriptor) Reset()

func (*PrivilegeDescriptor) Revoke Uses

func (p *PrivilegeDescriptor) Revoke(
    user string, privList privilege.List, objectType privilege.ObjectType,
)

Revoke removes privileges from this descriptor for a given list of users.

func (*PrivilegeDescriptor) SetOwner Uses

func (p *PrivilegeDescriptor) SetOwner(owner string)

SetOwner sets the owner of the privilege descriptor to the provided string.

func (PrivilegeDescriptor) Show Uses

func (p PrivilegeDescriptor) Show(objectType privilege.ObjectType) []UserPrivilegeString

Show returns the list of {username, privileges} sorted by username. 'privileges' is a string of comma-separated sorted privilege names.

func (*PrivilegeDescriptor) Size Uses

func (m *PrivilegeDescriptor) Size() (n int)

func (*PrivilegeDescriptor) String Uses

func (m *PrivilegeDescriptor) String() string

func (*PrivilegeDescriptor) Unmarshal Uses

func (m *PrivilegeDescriptor) Unmarshal(dAtA []byte) error

func (PrivilegeDescriptor) Validate Uses

func (p PrivilegeDescriptor) Validate(id ID, objectType privilege.ObjectType) error

Validate is called when writing a database, table or type descriptor. It takes the descriptor ID which is used to determine if it belongs to a system descriptor, in which case the maximum set of allowed privileges is looked up and applied.

func (*PrivilegeDescriptor) XXX_DiscardUnknown Uses

func (m *PrivilegeDescriptor) XXX_DiscardUnknown()

func (*PrivilegeDescriptor) XXX_Marshal Uses

func (m *PrivilegeDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PrivilegeDescriptor) XXX_Merge Uses

func (dst *PrivilegeDescriptor) XXX_Merge(src proto.Message)

func (*PrivilegeDescriptor) XXX_Size Uses

func (m *PrivilegeDescriptor) XXX_Size() int

func (*PrivilegeDescriptor) XXX_Unmarshal Uses

func (m *PrivilegeDescriptor) XXX_Unmarshal(b []byte) error

type ScanLockingStrength Uses

type ScanLockingStrength int32

ScanLockingStrength controls the row-level locking mode used by scans.

Typically, SQL scans read sequential keys from the key-value layer without acquiring any locks. This means that two scans by different transactions will not conflict and cause one of the two transactions to block the other. This is usually desirable, as it increases concurrency between readers.

However, there are cases where a SQL scan would like to acquire locks on each of the keys that it reads to more carefully control concurrent access to the data that it reads. The prototypical example of this is a scan that is used to fetch the initial value of a row that its transction intends to later update. In this case, it would be beneficial to acquire a lock on the row during the initial scan instead of waiting until the mutation to acquire a lock. This prevents the row from being modified between the scan and the mutation. It also prevents situations that can lead to deadlocks.

Locking modes have differing levels of strength, growing from "weakest" to "strongest" in the order that the variants are presented in the enumeration. The "stronger" a locking mode, the more protection it provides for the lock holder but the more restrictive it is to concurrent transactions attempting to access the same keys.

The following matrix presents the compatibility of locking strengths with one another.

+-------------------+---------------+-----------+-------------------+------------+
|                   | FOR_KEY_SHARE | FOR_SHARE | FOR_NO_KEY_UPDATE | FOR_UPDATE |
+-------------------+---------------+-----------+-------------------+------------+
| FOR_KEY_SHARE     |               |           |                   |      X     |
+-------------------+---------------+-----------+-------------------+------------+
| FOR_SHARE         |               |           |         X         |      X     |
+-------------------+---------------+-----------+-------------------+------------+
| FOR_NO_KEY_UPDATE |               |     X     |         X         |      X     |
+-------------------+---------------+-----------+-------------------+------------+
| FOR_UPDATE        |       X       |     X     |         X         |      X     |
+-------------------+---------------+-----------+-------------------+------------+

A transaction can hold conflicting locks on the same row, but two different transactions can never hold conflicting locks on the same row. Once acquired, a lock is held until the end of the transaction.

const (
    // FOR_NONE represents the default - no row-level locking.
    ScanLockingStrength_FOR_NONE ScanLockingStrength = 0
    // FOR_KEY_SHARE represents the FOR KEY SHARE row-level locking mode.
    //
    // The mode behaves similarly to FOR SHARE, except that the lock is weaker:
    // SELECT FOR UPDATE is blocked, but not SELECT FOR NO KEY UPDATE. A
    // key-shared lock blocks other transactions from performing DELETE or any
    // UPDATE that changes the key values, but not other UPDATE, and neither does
    // it prevent SELECT FOR NO KEY UPDATE, SELECT FOR SHARE, or SELECT FOR KEY
    // SHARE.
    //
    // The locking mode was introduced into Postgres as an alternative to FOR
    // SHARE to improve concurrency between foreign key validation scans, which
    // acquire FOR KEY SHARE locks, and UPDATEs to existing rows, which acquire
    // FOR NO KEY UPDATE locks.
    //
    // NOTE: FOR_KEY_SHARE is currently ignored. No locks are acquired.
    ScanLockingStrength_FOR_KEY_SHARE ScanLockingStrength = 1
    // FOR_SHARE represents the FOR SHARE row-level locking mode.
    //
    // The mode behaves similarly to FOR NO KEY UPDATE, except that it acquires a
    // shared lock rather than exclusive lock on each retrieved row. A shared lock
    // blocks other transactions from performing UPDATE, DELETE, SELECT FOR UPDATE
    // or SELECT FOR NO KEY UPDATE on these rows, but it does not prevent them
    // from performing SELECT FOR SHARE or SELECT FOR KEY SHARE.
    //
    // NOTE: FOR_SHARE is currently ignored. No locks are acquired.
    ScanLockingStrength_FOR_SHARE ScanLockingStrength = 2
    // FOR_NO_KEY_UPDATE represents the FOR NO KEY UPDATE row-level locking mode.
    //
    // The mode behaves similarly to FOR UPDATE, except that the lock acquired is
    // weaker: this lock will not block SELECT FOR KEY SHARE commands that attempt
    // to acquire a lock on the same rows. This lock mode is also acquired by any
    // UPDATE that does not acquire a FOR UPDATE lock.
    //
    // The locking mode was introduced into Postgres as an alternative to FOR
    // UDPATE to improve concurrency between foreign key validation scans, which
    // acquire FOR KEY SHARE locks, and UPDATEs to existing rows, which acquire
    // FOR NO KEY UPDATE locks.
    //
    // NOTE: FOR_NO_KEY_UPDATE is currently promoted to FOR_UPDATE.
    ScanLockingStrength_FOR_NO_KEY_UPDATE ScanLockingStrength = 3
    // FOR_UPDATE represents the FOR UPDATE row-level locking mode.
    //
    // The mode causes the rows retrieved by the scan to be locked as though for
    // update. This prevents them from being locked, modified or deleted by other
    // transactions until the current transaction ends. That is, other
    // transactions that attempt UPDATE, DELETE, SELECT FOR UPDATE, SELECT FOR NO
    // KEY UPDATE, SELECT FOR SHARE or SELECT FOR KEY SHARE of these rows will be
    // blocked until the current transaction ends. Conversely, SELECT FOR UPDATE
    // will wait for a concurrent transaction that has run any of those commands
    // on the same row, and will then lock and return the updated row (or no row,
    // if the row was deleted).
    //
    // NOTE: FOR_UPDATE is currently implemented by acquiring lock.Exclusive locks
    // on each key scanned.
    ScanLockingStrength_FOR_UPDATE ScanLockingStrength = 4
)

func ToScanLockingStrength Uses

func ToScanLockingStrength(s tree.LockingStrength) ScanLockingStrength

ToScanLockingStrength converts a tree.LockingStrength to its corresponding ScanLockingStrength.

func (ScanLockingStrength) Enum Uses

func (x ScanLockingStrength) Enum() *ScanLockingStrength

func (ScanLockingStrength) EnumDescriptor Uses

func (ScanLockingStrength) EnumDescriptor() ([]byte, []int)

func (ScanLockingStrength) PrettyString Uses

func (s ScanLockingStrength) PrettyString() string

PrettyString returns the locking strength as a user-readable string.

func (ScanLockingStrength) String Uses

func (x ScanLockingStrength) String() string

func (*ScanLockingStrength) UnmarshalJSON Uses

func (x *ScanLockingStrength) UnmarshalJSON(data []byte) error

type ScanLockingWaitPolicy Uses

type ScanLockingWaitPolicy int32

LockingWaitPolicy controls the policy used for handling conflicting locks held by other active transactions when attempting to lock rows due to FOR UPDATE/SHARE clauses (i.e. it represents the NOWAIT and SKIP LOCKED options).

const (
    // BLOCK represents the default - wait for the lock to become available.
    ScanLockingWaitPolicy_BLOCK ScanLockingWaitPolicy = 0
    // SKIP represents SKIP LOCKED - skip rows that can't be locked.
    //
    // NOTE: SKIP is not currently implemented and does not make it out of the SQL
    // optimizer without throwing an error.
    ScanLockingWaitPolicy_SKIP ScanLockingWaitPolicy = 1
    // ERROR represents NOWAIT - raise an error if a row cannot be locked.
    ScanLockingWaitPolicy_ERROR ScanLockingWaitPolicy = 2
)

func ToScanLockingWaitPolicy Uses

func ToScanLockingWaitPolicy(wp tree.LockingWaitPolicy) ScanLockingWaitPolicy

ToScanLockingWaitPolicy converts a tree.LockingWaitPolicy to its corresponding ScanLockingWaitPolicy.

func (ScanLockingWaitPolicy) Enum Uses

func (x ScanLockingWaitPolicy) Enum() *ScanLockingWaitPolicy

func (ScanLockingWaitPolicy) EnumDescriptor Uses

func (ScanLockingWaitPolicy) EnumDescriptor() ([]byte, []int)

func (ScanLockingWaitPolicy) PrettyString Uses

func (wp ScanLockingWaitPolicy) PrettyString() string

PrettyString returns the locking strength as a user-readable string.

func (ScanLockingWaitPolicy) String Uses

func (x ScanLockingWaitPolicy) String() string

func (*ScanLockingWaitPolicy) UnmarshalJSON Uses

func (x *ScanLockingWaitPolicy) UnmarshalJSON(data []byte) error

type SchemaDescriptor Uses

type SchemaDescriptor struct {
    // name is the name of the schema.
    Name string `protobuf:"bytes,2,opt,name=name" json:"name"`
    // id is the schema ID, globally unique across all descriptors.
    ID            ID              `protobuf:"varint,3,opt,name=id,casttype=ID" json:"id"`
    State         DescriptorState `protobuf:"varint,8,opt,name=state,enum=cockroach.sql.sqlbase.DescriptorState" json:"state"`
    OfflineReason string          `protobuf:"bytes,9,opt,name=offline_reason,json=offlineReason" json:"offline_reason"`
    // Last modification time of the descriptor.
    ModificationTime hlc.Timestamp     `protobuf:"bytes,5,opt,name=modification_time,json=modificationTime" json:"modification_time"`
    Version          DescriptorVersion `protobuf:"varint,6,opt,name=version,casttype=DescriptorVersion" json:"version"`
    DrainingNames    []NameInfo        `protobuf:"bytes,7,rep,name=draining_names,json=drainingNames" json:"draining_names"`
    // parent_id refers to the database the schema is in.
    ParentID ID  `protobuf:"varint,1,opt,name=parent_id,json=parentId,casttype=ID" json:"parent_id"`
    // privileges contains the privileges for the schema.
    Privileges *PrivilegeDescriptor `protobuf:"bytes,4,opt,name=privileges" json:"privileges,omitempty"`
}

SchemaDescriptor represents a physical schema and is stored in a structured metadata key.

func (*SchemaDescriptor) Descriptor Uses

func (*SchemaDescriptor) Descriptor() ([]byte, []int)

func (*SchemaDescriptor) Equal Uses

func (this *SchemaDescriptor) Equal(that interface{}) bool

func (*SchemaDescriptor) GetDrainingNames Uses

func (m *SchemaDescriptor) GetDrainingNames() []NameInfo

func (*SchemaDescriptor) GetID Uses

func (m *SchemaDescriptor) GetID() ID

func (*SchemaDescriptor) GetModificationTime Uses

func (m *SchemaDescriptor) GetModificationTime() hlc.Timestamp

func (*SchemaDescriptor) GetName Uses

func (m *SchemaDescriptor) GetName() string

func (*SchemaDescriptor) GetOfflineReason Uses

func (m *SchemaDescriptor) GetOfflineReason() string

func (*SchemaDescriptor) GetParentID Uses

func (m *SchemaDescriptor) GetParentID() ID

func (*SchemaDescriptor) GetPrivileges Uses

func (m *SchemaDescriptor) GetPrivileges() *PrivilegeDescriptor

func (*SchemaDescriptor) GetState Uses

func (m *SchemaDescriptor) GetState() DescriptorState

func (*SchemaDescriptor) GetVersion Uses

func (m *SchemaDescriptor) GetVersion() DescriptorVersion

func (*SchemaDescriptor) Marshal Uses

func (m *SchemaDescriptor) Marshal() (dAtA []byte, err error)

func (*SchemaDescriptor) MarshalTo Uses

func (m *SchemaDescriptor) MarshalTo(dAtA []byte) (int, error)

func (*SchemaDescriptor) ProtoMessage Uses

func (*SchemaDescriptor) ProtoMessage()

func (*SchemaDescriptor) Reset Uses

func (m *SchemaDescriptor) Reset()

func (*SchemaDescriptor) Size Uses

func (m *SchemaDescriptor) Size() (n int)

func (*SchemaDescriptor) String Uses

func (m *SchemaDescriptor) String() string

func (*SchemaDescriptor) Unmarshal Uses

func (m *SchemaDescriptor) Unmarshal(dAtA []byte) error

func (*SchemaDescriptor) XXX_DiscardUnknown Uses

func (m *SchemaDescriptor) XXX_DiscardUnknown()

func (*SchemaDescriptor) XXX_Marshal Uses

func (m *SchemaDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SchemaDescriptor) XXX_Merge Uses

func (dst *SchemaDescriptor) XXX_Merge(src proto.Message)

func (*SchemaDescriptor) XXX_Size Uses

func (m *SchemaDescriptor) XXX_Size() int

func (*SchemaDescriptor) XXX_Unmarshal Uses

func (m *SchemaDescriptor) XXX_Unmarshal(b []byte) error

type ShardedDescriptor Uses

type ShardedDescriptor struct {
    // IsSharded indicates whether the index in question is a sharded one.
    IsSharded bool `protobuf:"varint,1,opt,name=is_sharded,json=isSharded" json:"is_sharded"`
    // Name is the name of the shard column.
    Name string `protobuf:"bytes,2,opt,name=name" json:"name"`
    // ShardBuckets indicates the number of shards this index is divided into.
    ShardBuckets int32 `protobuf:"varint,3,opt,name=shard_buckets,json=shardBuckets" json:"shard_buckets"`
    // ColumnNames lists the names of the columns used to compute the shard column's
    // values.
    ColumnNames []string `protobuf:"bytes,4,rep,name=column_names,json=columnNames" json:"column_names,omitempty"`
}

ShardedDescriptor represents an index (either primary or secondary) that is hash sharded into a user-specified number of buckets.

As as example, sample field values for the following table:

CREATE TABLE abc (

a INT PRIMARY KEY USING HASH WITH BUCKET_COUNT=10,  // column id: 1
b BYTES

);

Sharded descriptor:

name:          "a_shard"
shard_buckets: 10
column_names:  ["a"]

func (*ShardedDescriptor) Descriptor Uses

func (*ShardedDescriptor) Descriptor() ([]byte, []int)

func (*ShardedDescriptor) Equal Uses

func (this *ShardedDescriptor) Equal(that interface{}) bool

func (*ShardedDescriptor) Marshal Uses

func (m *ShardedDescriptor) Marshal() (dAtA []byte, err error)

func (*ShardedDescriptor) MarshalTo Uses

func (m *ShardedDescriptor) MarshalTo(dAtA []byte) (int, error)

func (*ShardedDescriptor) ProtoMessage Uses

func (*ShardedDescriptor) ProtoMessage()

func (*ShardedDescriptor) Reset Uses

func (m *ShardedDescriptor) Reset()

func (*ShardedDescriptor) Size Uses

func (m *ShardedDescriptor) Size() (n int)

func (*ShardedDescriptor) String Uses

func (m *ShardedDescriptor) String() string

func (*ShardedDescriptor) Unmarshal Uses

func (m *ShardedDescriptor) Unmarshal(dAtA []byte) error

func (*ShardedDescriptor) XXX_DiscardUnknown Uses

func (m *ShardedDescriptor) XXX_DiscardUnknown()

func (*ShardedDescriptor) XXX_Marshal Uses

func (m *ShardedDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ShardedDescriptor) XXX_Merge Uses

func (dst *ShardedDescriptor) XXX_Merge(src proto.Message)

func (*ShardedDescriptor) XXX_Size Uses

func (m *ShardedDescriptor) XXX_Size() int

func (*ShardedDescriptor) XXX_Unmarshal Uses

func (m *ShardedDescriptor) XXX_Unmarshal(b []byte) error

type SystemColumnKind Uses

type SystemColumnKind int32

SystemColumnKind is an enum representing the different kind of system columns that can be synthesized by the execution engine.

const (
    // Default value, unused.
    SystemColumnKind_NONE SystemColumnKind = 0
    // A system column containing the value of the MVCC timestamp associated
    // with the kv's corresponding to the row.
    SystemColumnKind_MVCCTIMESTAMP SystemColumnKind = 1
    // A system column containing the OID of the table that the row came from.
    SystemColumnKind_TABLEOID SystemColumnKind = 2
)

func (SystemColumnKind) Enum Uses

func (x SystemColumnKind) Enum() *SystemColumnKind

func (SystemColumnKind) EnumDescriptor Uses

func (SystemColumnKind) EnumDescriptor() ([]byte, []int)

func (SystemColumnKind) String Uses

func (x SystemColumnKind) String() string

func (*SystemColumnKind) UnmarshalJSON Uses

func (x *SystemColumnKind) UnmarshalJSON(data []byte) error

type TableDescriptor Uses

type TableDescriptor struct {
    // The table name. It should be normalized using NormalizeName() before
    // comparing it.
    Name string `protobuf:"bytes,1,opt,name=name" json:"name"`
    ID   ID     `protobuf:"varint,3,opt,name=id,casttype=ID" json:"id"`
    // Monotonically increasing version of the table descriptor.
    //
    // The design maintains two invariants:
    // 1. Two safe versions: A transaction at a particular timestamp is
    //    allowed to use one of two versions of a table descriptor:
    //    the one that would be read from the store at that timestamp,
    //    and the one behind it in version.
    // 2. Two leased versions: There can be valid leases on at most the 2
    //    latest versions of a table in the cluster at any time. New leases
    //    are only granted on the latest version.
    //
    // The database must maintain correctness in light of there being two
    // versions of a descriptor that can be used.
    //
    // Multiple schema change mutations can be grouped together on a
    // particular version increment.
    Version DescriptorVersion `protobuf:"varint,5,opt,name=version,casttype=DescriptorVersion" json:"version"`
    // Last modification time of the table descriptor.
    // Starting in 19.2 this field's value may sometime be zero-valued in which
    // case the MVCC timestamp of the row containing the value should be used to
    // populate it. This dance allows us to avoid observing the commit timestamp
    // for transactions which increment the descriptor version.
    // Encoded TableDescriptor structs should not be stored directly but rather
    // should live inside of a Descriptor. The Descriptor.Table() method takes an
    // hlc timestamp to ensure that this field is set properly when extracted from
    // a Descriptor.
    ModificationTime hlc.Timestamp `protobuf:"bytes,7,opt,name=modification_time,json=modificationTime" json:"modification_time"`
    // A list of draining names. The draining name entries are drained from
    // the cluster wide name caches by incrementing the version for this
    // descriptor and ensuring that there are no leases on prior
    // versions of the descriptor. This field is then cleared and the version
    // of the descriptor incremented.
    DrainingNames []NameInfo `protobuf:"bytes,21,rep,name=draining_names,json=drainingNames" json:"draining_names"`
    // ID of the parent database.
    ParentID ID  `protobuf:"varint,4,opt,name=parent_id,json=parentId,casttype=ID" json:"parent_id"`
    // ID of the parent schema. For backwards compatibility, 0 means the table is
    // scoped under the public physical schema (id 29). Because of this backward
    // compatibility issue, this field should not be accessed directly or through
    // the generated getter. Instead, use GetParentSchemaID() which is defined in
    // structured.go.
    UnexposedParentSchemaID ID                 `protobuf:"varint,40,opt,name=unexposed_parent_schema_id,json=unexposedParentSchemaId,casttype=ID" json:"unexposed_parent_schema_id"`
    Columns                 []ColumnDescriptor `protobuf:"bytes,8,rep,name=columns" json:"columns"`
    // next_column_id is used to ensure that deleted column ids are not reused.
    NextColumnID ColumnID `protobuf:"varint,9,opt,name=next_column_id,json=nextColumnId,casttype=ColumnID" json:"next_column_id"`
    // families holds information about the column families of this table.
    // This list has at least length 1, in which case all columns are stored in the same family.
    // families is stored in sorted order by family ID.
    Families []ColumnFamilyDescriptor `protobuf:"bytes,22,rep,name=families" json:"families"`
    // next_family_id is used to ensure that deleted family ids are not reused.
    NextFamilyID FamilyID        `protobuf:"varint,23,opt,name=next_family_id,json=nextFamilyId,casttype=FamilyID" json:"next_family_id"`
    PrimaryIndex IndexDescriptor `protobuf:"bytes,10,opt,name=primary_index,json=primaryIndex" json:"primary_index"`
    // indexes are all the secondary indexes.
    Indexes []IndexDescriptor `protobuf:"bytes,11,rep,name=indexes" json:"indexes"`
    // next_index_id is used to ensure that deleted index ids are not reused.
    NextIndexID IndexID              `protobuf:"varint,12,opt,name=next_index_id,json=nextIndexId,casttype=IndexID" json:"next_index_id"`
    Privileges  *PrivilegeDescriptor `protobuf:"bytes,13,opt,name=privileges" json:"privileges,omitempty"`
    // Columns or indexes being added or deleted in a FIFO order.
    Mutations []DescriptorMutation               `protobuf:"bytes,14,rep,name=mutations" json:"mutations"`
    Lease     *TableDescriptor_SchemaChangeLease `protobuf:"bytes,15,opt,name=lease" json:"lease,omitempty"` // Deprecated: Do not use.
    // An id for the next group of mutations to be applied together.
    NextMutationID MutationID `protobuf:"varint,16,opt,name=next_mutation_id,json=nextMutationId,casttype=MutationID" json:"next_mutation_id"`
    // format_version declares which sql to key:value mapping is being used to
    // represent the data in this table.
    FormatVersion FormatVersion                      `protobuf:"varint,17,opt,name=format_version,json=formatVersion,casttype=FormatVersion" json:"format_version"`
    State         DescriptorState                    `protobuf:"varint,19,opt,name=state,enum=cockroach.sql.sqlbase.DescriptorState" json:"state"`
    OfflineReason string                             `protobuf:"bytes,38,opt,name=offline_reason,json=offlineReason" json:"offline_reason"`
    Checks        []*TableDescriptor_CheckConstraint `protobuf:"bytes,20,rep,name=checks" json:"checks,omitempty"`
    // The TableDescriptor is used for views in addition to tables. Views
    // use mostly the same fields as tables, but need to track the actual
    // query from the view definition as well.
    //
    // For now we only track a string representation of the query. This prevents
    // us from easily supporting things like renames of the dependencies of a
    // view. Eventually we'll want to switch to a semantic encoding of the query
    // that relies on IDs rather than names so that we can support renames of
    // fields relied on by the query, as Postgres does.
    //
    // Note: The presence of this field is used to determine whether or not
    // a TableDescriptor represents a view.
    ViewQuery string `protobuf:"bytes,24,opt,name=view_query,json=viewQuery" json:"view_query"`
    // IsMaterializedView indicates whether this view is materialized or not.
    // A materialized view has the view query results stored durably on disk
    // as a table. The data on disk is refreshed with the REFRESH MATERIALIZED
    // VIEW command. This flag is only set when ViewQuery != "".
    IsMaterializedView bool `protobuf:"varint,41,opt,name=is_materialized_view,json=isMaterializedView" json:"is_materialized_view"`
    // The IDs of all relations that this depends on.
    // Only ever populated if this descriptor is for a view.
    DependsOn []ID `protobuf:"varint,25,rep,name=dependsOn,casttype=ID" json:"dependsOn,omitempty"`
    // All references to this table/view from other views and sequences in the system,
    // tracked down to the column/index so that we can restrict changes to them while
    // they're still being referred to.
    DependedOnBy []TableDescriptor_Reference `protobuf:"bytes,26,rep,name=dependedOnBy" json:"dependedOnBy"`
    // Mutation jobs queued for execution in a FIFO order. Remains synchronized
    // with the mutations list.
    MutationJobs []TableDescriptor_MutationJob `protobuf:"bytes,27,rep,name=mutationJobs" json:"mutationJobs"`
    // The presence of sequence_opts indicates that this descriptor is for a sequence.
    SequenceOpts *TableDescriptor_SequenceOpts `protobuf:"bytes,28,opt,name=sequence_opts,json=sequenceOpts" json:"sequence_opts,omitempty"`
    // The drop time is set when a table is truncated or dropped,
    // based on the current time in nanoseconds since the epoch.
    // Use this timestamp + GC TTL to start deleting the table's
    // contents.
    //
    // TODO(vivek): Replace with the ModificationTime. This has been
    // added only for migration purposes.
    DropTime int64 `protobuf:"varint,29,opt,name=drop_time,json=dropTime" json:"drop_time"`
    // ReplacementOf tracks prior IDs by which this table went -- e.g. when
    // TRUNCATE creates a replacement of a table and swaps it in for the the old
    // one, it should note on the new table the ID of the table it replaced. This
    // can be used when trying to track a table's history across truncatations.
    ReplacementOf TableDescriptor_Replacement `protobuf:"bytes,30,opt,name=replacement_of,json=replacementOf" json:"replacement_of"`
    AuditMode     TableDescriptor_AuditMode   `protobuf:"varint,31,opt,name=audit_mode,json=auditMode,enum=cockroach.sql.sqlbase.TableDescriptor_AuditMode" json:"audit_mode"`
    // The job id for a drop job is the id in the system.jobs table of the
    // dropping of this table.
    DropJobID int64 `protobuf:"varint,32,opt,name=drop_job_id,json=dropJobId" json:"drop_job_id"`
    // The schema elements that have been dropped and whose underlying
    // data needs to be gc-ed. These schema elements have already transitioned
    // through the drop state machine when they were in the above mutations
    // list, and can be safely deleted. The names for these schema elements
    // can be reused. This list is separate because mutations can
    // lie in this list for a long time (gc deadline) and should not block
    // the execution of other schema changes on the table.
    //
    // TODO(vivekmenezes): This is currently only used by the non-interleaved drop
    // index case. Also use for dropped interleaved indexes and columns.
    GCMutations []TableDescriptor_GCDescriptorMutation `protobuf:"bytes,33,rep,name=gc_mutations,json=gcMutations" json:"gc_mutations"`
    CreateQuery string                                 `protobuf:"bytes,34,opt,name=create_query,json=createQuery" json:"create_query"`
    // Starting in 19.2 CreateAsOfTime is initialized to zero for the first
    // version of a table and is populated from the MVCC timestamp of the read
    // like ModificationTime. See Descriptor.Table().
    // CreateAsOfSystemTime is used for CREATE TABLE ... AS ... and was
    // added in 19.1.
    CreateAsOfTime hlc.Timestamp `protobuf:"bytes,35,opt,name=create_as_of_time,json=createAsOfTime" json:"create_as_of_time"`
    // outbound_fks contains all foreign key constraints that have this table as
    // the origin table.
    OutboundFKs []ForeignKeyConstraint `protobuf:"bytes,36,rep,name=outbound_fks,json=outboundFks" json:"outbound_fks"`
    // inbound_fks contains all foreign key constraints that have this table as
    // the referenced table.
    InboundFKs []ForeignKeyConstraint `protobuf:"bytes,37,rep,name=inbound_fks,json=inboundFks" json:"inbound_fks"`
    // Temporary table support will be added to CRDB starting from 20.1. The temporary
    // flag is set to true for all temporary tables. All table descriptors created
    // before 20.1 refer to persistent tables, so lack of the flag being set implies
    // the table is persistent.
    Temporary bool `protobuf:"varint,39,opt,name=temporary" json:"temporary"`
}

A TableDescriptor represents a table or view and is stored in a structured metadata key. The TableDescriptor has a globally-unique ID, while its member {Column,Index}Descriptors have locally-unique IDs.

func TableFromDescriptor Uses

func TableFromDescriptor(desc *Descriptor, ts hlc.Timestamp) *TableDescriptor

TableFromDescriptor is a replacement for GetTable() which seeks to ensure that clients which unmarshal Descriptor structs properly set the ModificationTime on tables based on the MVCC timestamp at which the descriptor was read.

A linter should ensure that GetTable() is not called.

TODO(ajwerner): Now that all descriptors have their modification time set this way, this function should be retired and similar or better safeguards for all descriptors should be pursued.

func (*TableDescriptor) Adding Uses

func (desc *TableDescriptor) Adding() bool

Adding returns true if the table is being added.

func (*TableDescriptor) Descriptor Uses

func (*TableDescriptor) Descriptor() ([]byte, []int)

func (*TableDescriptor) Dropped Uses

func (desc *TableDescriptor) Dropped() bool

Dropped returns true if the table is being dropped.

func (*TableDescriptor) Equal Uses

func (this *TableDescriptor) Equal(that interface{}) bool

func (*TableDescriptor) GetAuditMode Uses

func (m *TableDescriptor) GetAuditMode() TableDescriptor_AuditMode

func (*TableDescriptor) GetChecks Uses

func (m *TableDescriptor) GetChecks() []*TableDescriptor_CheckConstraint

func (*TableDescriptor) GetColumns Uses

func (m *TableDescriptor) GetColumns() []ColumnDescriptor

func (*TableDescriptor) GetCreateAsOfTime Uses

func (m *TableDescriptor) GetCreateAsOfTime() hlc.Timestamp

func (*TableDescriptor) GetCreateQuery Uses

func (m *TableDescriptor) GetCreateQuery() string

func (*TableDescriptor) GetDependedOnBy Uses

func (m *TableDescriptor) GetDependedOnBy() []TableDescriptor_Reference

func (*TableDescriptor) GetDependsOn Uses

func (m *TableDescriptor) GetDependsOn() []ID

func (*TableDescriptor) GetDrainingNames Uses

func (m *TableDescriptor) GetDrainingNames() []NameInfo

func (*TableDescriptor) GetDropJobID Uses

func (m *TableDescriptor) GetDropJobID() int64

func (*TableDescriptor) GetDropTime Uses

func (m *TableDescriptor) GetDropTime() int64

func (*TableDescriptor) GetFamilies Uses

func (m *TableDescriptor) GetFamilies() []ColumnFamilyDescriptor

func (*TableDescriptor) GetFormatVersion Uses

func (m *TableDescriptor) GetFormatVersion() FormatVersion

func (*TableDescriptor) GetGCMutations Uses

func (m *TableDescriptor) GetGCMutations() []TableDescriptor_GCDescriptorMutation

func (*TableDescriptor) GetID Uses

func (m *TableDescriptor) GetID() ID

func (*TableDescriptor) GetInboundFKs Uses

func (m *TableDescriptor) GetInboundFKs() []ForeignKeyConstraint

func (*TableDescriptor) GetIndexes Uses

func (m *TableDescriptor) GetIndexes() []IndexDescriptor

func (*TableDescriptor) GetIsMaterializedView Uses

func (m *TableDescriptor) GetIsMaterializedView() bool

func (*TableDescriptor) GetLease Uses

func (m *TableDescriptor) GetLease() *TableDescriptor_SchemaChangeLease

Deprecated: Do not use.

func (*TableDescriptor) GetModificationTime Uses

func (m *TableDescriptor) GetModificationTime() hlc.Timestamp

func (*TableDescriptor) GetMutationJobs Uses

func (m *TableDescriptor) GetMutationJobs() []TableDescriptor_MutationJob

func (*TableDescriptor) GetMutations Uses

func (m *TableDescriptor) GetMutations() []DescriptorMutation

func (*TableDescriptor) GetName Uses

func (m *TableDescriptor) GetName() string

func (*TableDescriptor) GetNextColumnID Uses

func (m *TableDescriptor) GetNextColumnID() ColumnID

func (*TableDescriptor) GetNextFamilyID Uses

func (m *TableDescriptor) GetNextFamilyID() FamilyID

func (*TableDescriptor) GetNextIndexID Uses

func (m *TableDescriptor) GetNextIndexID() IndexID

func (*TableDescriptor) GetNextMutationID Uses

func (m *TableDescriptor) GetNextMutationID() MutationID

func (*TableDescriptor) GetOfflineReason Uses

func (m *TableDescriptor) GetOfflineReason() string

func (*TableDescriptor) GetOutboundFKs Uses

func (m *TableDescriptor) GetOutboundFKs() []ForeignKeyConstraint

func (*TableDescriptor) GetParentID Uses

func (m *TableDescriptor) GetParentID() ID

func (*TableDescriptor) GetPrimaryIndex Uses

func (m *TableDescriptor) GetPrimaryIndex() IndexDescriptor

func (*TableDescriptor) GetPrivileges Uses

func (m *TableDescriptor) GetPrivileges() *PrivilegeDescriptor

func (*TableDescriptor) GetReplacementOf Uses

func (m *TableDescriptor) GetReplacementOf() TableDescriptor_Replacement

func (*TableDescriptor) GetSequenceOpts Uses

func (m *TableDescriptor) GetSequenceOpts() *TableDescriptor_SequenceOpts

func (*TableDescriptor) GetState Uses

func (m *TableDescriptor) GetState() DescriptorState

func (*TableDescriptor) GetTemporary Uses

func (m *TableDescriptor) GetTemporary() bool

func (*TableDescriptor) GetUnexposedParentSchemaID Uses

func (m *TableDescriptor) GetUnexposedParentSchemaID() ID

func (*TableDescriptor) GetVersion Uses

func (m *TableDescriptor) GetVersion() DescriptorVersion

func (*TableDescriptor) GetViewQuery Uses

func (m *TableDescriptor) GetViewQuery() string

func (*TableDescriptor) IsAs Uses

func (desc *TableDescriptor) IsAs() bool

IsAs returns true if the TableDescriptor actually describes a Table resource with an As source.

func (*TableDescriptor) IsSequence Uses

func (desc *TableDescriptor) IsSequence() bool

IsSequence returns true if the TableDescriptor actually describes a Sequence resource rather than a Table.

func (*TableDescriptor) IsTable Uses

func (desc *TableDescriptor) IsTable() bool

IsTable returns true if the TableDescriptor actually describes a Table resource, as opposed to a different resource (like a View).

func (*TableDescriptor) IsView Uses

func (desc *TableDescriptor) IsView() bool

IsView returns true if the TableDescriptor actually describes a View resource rather than a Table.

func (*TableDescriptor) IsVirtualTable Uses

func (desc *TableDescriptor) IsVirtualTable() bool

IsVirtualTable returns true if the TableDescriptor describes a virtual Table (like the information_schema tables) and thus doesn't need to be physically stored.

func (*TableDescriptor) Marshal Uses

func (m *TableDescriptor) Marshal() (dAtA []byte, err error)

func (*TableDescriptor) MarshalTo Uses

func (m *TableDescriptor) MarshalTo(dAtA []byte) (int, error)

func (*TableDescriptor) MaterializedView Uses

func (desc *TableDescriptor) MaterializedView() bool

MaterializedView returns whether or not this TableDescriptor is a MaterializedView.

func (*TableDescriptor) Offline Uses

func (desc *TableDescriptor) Offline() bool

Offline returns true if the table is importing.

func (*TableDescriptor) Persistence Uses

func (desc *TableDescriptor) Persistence() tree.Persistence

Persistence returns the Persistence from the TableDescriptor.

func (*TableDescriptor) ProtoMessage Uses

func (*TableDescriptor) ProtoMessage()

func (*TableDescriptor) Public Uses

func (desc *TableDescriptor) Public() bool

Public implements the Descriptor interface.

func (*TableDescriptor) Reset Uses

func (m *TableDescriptor) Reset()

func (*TableDescriptor) Size Uses

func (m *TableDescriptor) Size() (n int)

func (*TableDescriptor) String Uses

func (m *TableDescriptor) String() string

func (*TableDescriptor) Unmarshal Uses

func (m *TableDescriptor) Unmarshal(dAtA []byte) error

func (*TableDescriptor) XXX_DiscardUnknown Uses

func (m *TableDescriptor) XXX_DiscardUnknown()

func (*TableDescriptor) XXX_Marshal Uses

func (m *TableDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TableDescriptor) XXX_Merge Uses

func (dst *TableDescriptor) XXX_Merge(src proto.Message)

func (*TableDescriptor) XXX_Size Uses

func (m *TableDescriptor) XXX_Size() int

func (*TableDescriptor) XXX_Unmarshal Uses

func (m *TableDescriptor) XXX_Unmarshal(b []byte) error

type TableDescriptor_AuditMode Uses

type TableDescriptor_AuditMode int32

AuditMode indicates which auditing actions to take when this table is used.

const (
    TableDescriptor_DISABLED  TableDescriptor_AuditMode = 0
    TableDescriptor_READWRITE TableDescriptor_AuditMode = 1
)

func (TableDescriptor_AuditMode) Enum Uses

func (x TableDescriptor_AuditMode) Enum() *TableDescriptor_AuditMode

func (TableDescriptor_AuditMode) EnumDescriptor Uses

func (TableDescriptor_AuditMode) EnumDescriptor() ([]byte, []int)

func (TableDescriptor_AuditMode) String Uses

func (x TableDescriptor_AuditMode) String() string

func (*TableDescriptor_AuditMode) UnmarshalJSON Uses

func (x *TableDescriptor_AuditMode) UnmarshalJSON(data []byte) error

type TableDescriptor_CheckConstraint Uses

type TableDescriptor_CheckConstraint struct {
    // Expr is the expression that this check constraint represents.
    // Note that it is not correct to use Expr as output to display
    // to a user. User defined types within Expr have been serialized
    // in a internal format. Instead, use one of the schemaexpr.FormatExpr*
    // functions.
    Expr     string             `protobuf:"bytes,1,opt,name=expr" json:"expr"`
    Name     string             `protobuf:"bytes,2,opt,name=name" json:"name"`
    Validity ConstraintValidity `protobuf:"varint,3,opt,name=validity,enum=cockroach.sql.sqlbase.ConstraintValidity" json:"validity"`
    // An ordered list of column IDs used by the check constraint.
    ColumnIDs           []ColumnID `protobuf:"varint,5,rep,name=column_ids,json=columnIds,casttype=ColumnID" json:"column_ids,omitempty"`
    IsNonNullConstraint bool       `protobuf:"varint,6,opt,name=is_non_null_constraint,json=isNonNullConstraint" json:"is_non_null_constraint"`
    // Whether the check constraint should show up in the result of a `SHOW CREATE
    // TABLE..` statement.
    Hidden bool `protobuf:"varint,7,opt,name=hidden" json:"hidden"`
}

func (*TableDescriptor_CheckConstraint) Descriptor Uses

func (*TableDescriptor_CheckConstraint) Descriptor() ([]byte, []int)

func (*TableDescriptor_CheckConstraint) Equal Uses

func (this *TableDescriptor_CheckConstraint) Equal(that interface{}) bool

func (*TableDescriptor_CheckConstraint) Marshal Uses

func (m *TableDescriptor_CheckConstraint) Marshal() (dAtA []byte, err error)

func (*TableDescriptor_CheckConstraint) MarshalTo Uses

func (m *TableDescriptor_CheckConstraint) MarshalTo(dAtA []byte) (int, error)

func (*TableDescriptor_CheckConstraint) ProtoMessage Uses

func (*TableDescriptor_CheckConstraint) ProtoMessage()

func (*TableDescriptor_CheckConstraint) Reset Uses

func (m *TableDescriptor_CheckConstraint) Reset()

func (*TableDescriptor_CheckConstraint) Size Uses

func (m *TableDescriptor_CheckConstraint) Size() (n int)

func (*TableDescriptor_CheckConstraint) String Uses

func (m *TableDescriptor_CheckConstraint) String() string

func (*TableDescriptor_CheckConstraint) Unmarshal Uses

func (m *TableDescriptor_CheckConstraint) Unmarshal(dAtA []byte) error

func (*TableDescriptor_CheckConstraint) XXX_DiscardUnknown Uses

func (m *TableDescriptor_CheckConstraint) XXX_DiscardUnknown()

func (*TableDescriptor_CheckConstraint) XXX_Marshal Uses

func (m *TableDescriptor_CheckConstraint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TableDescriptor_CheckConstraint) XXX_Merge Uses

func (dst *TableDescriptor_CheckConstraint) XXX_Merge(src proto.Message)

func (*TableDescriptor_CheckConstraint) XXX_Size Uses

func (m *TableDescriptor_CheckConstraint) XXX_Size() int

func (*TableDescriptor_CheckConstraint) XXX_Unmarshal Uses

func (m *TableDescriptor_CheckConstraint) XXX_Unmarshal(b []byte) error

type TableDescriptor_GCDescriptorMutation Uses

type TableDescriptor_GCDescriptorMutation struct {
    IndexID  IndexID `protobuf:"varint,1,opt,name=index_id,json=indexId,casttype=IndexID" json:"index_id"`
    DropTime int64   `protobuf:"varint,2,opt,name=drop_time,json=dropTime" json:"drop_time"` // Deprecated: Do not use.
    // The job id for a mutation job is the id in the system.jobs table of the
    // schema change job executing the mutation referenced by mutation_id.
    JobID int64 `protobuf:"varint,3,opt,name=job_id,json=jobId" json:"job_id"` // Deprecated: Do not use.
}

func (*TableDescriptor_GCDescriptorMutation) Descriptor Uses

func (*TableDescriptor_GCDescriptorMutation) Descriptor() ([]byte, []int)

func (*TableDescriptor_GCDescriptorMutation) Equal Uses

func (this *TableDescriptor_GCDescriptorMutation) Equal(that interface{}) bool

func (*TableDescriptor_GCDescriptorMutation) Marshal Uses

func (m *TableDescriptor_GCDescriptorMutation) Marshal() (dAtA []byte, err error)

func (*TableDescriptor_GCDescriptorMutation) MarshalTo Uses

func (m *TableDescriptor_GCDescriptorMutation) MarshalTo(dAtA []byte) (int, error)

func (*TableDescriptor_GCDescriptorMutation) ProtoMessage Uses

func (*TableDescriptor_GCDescriptorMutation) ProtoMessage()

func (*TableDescriptor_GCDescriptorMutation) Reset Uses

func (m *TableDescriptor_GCDescriptorMutation) Reset()

func (*TableDescriptor_GCDescriptorMutation) Size Uses

func (m *TableDescriptor_GCDescriptorMutation) Size() (n int)

func (*TableDescriptor_GCDescriptorMutation) String Uses

func (m *TableDescriptor_GCDescriptorMutation) String() string

func (*TableDescriptor_GCDescriptorMutation) Unmarshal Uses

func (m *TableDescriptor_GCDescriptorMutation) Unmarshal(dAtA []byte) error

func (*TableDescriptor_GCDescriptorMutation) XXX_DiscardUnknown Uses

func (m *TableDescriptor_GCDescriptorMutation) XXX_DiscardUnknown()

func (*TableDescriptor_GCDescriptorMutation) XXX_Marshal Uses

func (m *TableDescriptor_GCDescriptorMutation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TableDescriptor_GCDescriptorMutation) XXX_Merge Uses

func (dst *TableDescriptor_GCDescriptorMutation) XXX_Merge(src proto.Message)

func (*TableDescriptor_GCDescriptorMutation) XXX_Size Uses

func (m *TableDescriptor_GCDescriptorMutation) XXX_Size() int

func (*TableDescriptor_GCDescriptorMutation) XXX_Unmarshal Uses

func (m *TableDescriptor_GCDescriptorMutation) XXX_Unmarshal(b []byte) error

type TableDescriptor_MutationJob Uses

type TableDescriptor_MutationJob struct {
    // The mutation id of this mutation job.
    MutationID MutationID `protobuf:"varint,1,opt,name=mutation_id,json=mutationId,casttype=MutationID" json:"mutation_id"`
    // The job id for a mutation job is the id in the system.jobs table of the
    // schema change job executing the mutation referenced by mutation_id.
    JobID int64 `protobuf:"varint,2,opt,name=job_id,json=jobId" json:"job_id"`
}

func (*TableDescriptor_MutationJob) Descriptor Uses

func (*TableDescriptor_MutationJob) Descriptor() ([]byte, []int)

func (*TableDescriptor_MutationJob) Equal Uses

func (this *TableDescriptor_MutationJob) Equal(that interface{}) bool

func (*TableDescriptor_MutationJob) Marshal Uses

func (m *TableDescriptor_MutationJob) Marshal() (dAtA []byte, err error)

func (*TableDescriptor_MutationJob) MarshalTo Uses

func (m *TableDescriptor_MutationJob) MarshalTo(dAtA []byte) (int, error)

func (*TableDescriptor_MutationJob) ProtoMessage Uses

func (*TableDescriptor_MutationJob) ProtoMessage()

func (*TableDescriptor_MutationJob) Reset Uses

func (m *TableDescriptor_MutationJob) Reset()

func (*TableDescriptor_MutationJob) Size Uses

func (m *TableDescriptor_MutationJob) Size() (n int)

func (*TableDescriptor_MutationJob) String Uses

func (m *TableDescriptor_MutationJob) String() string

func (*TableDescriptor_MutationJob) Unmarshal Uses

func (m *TableDescriptor_MutationJob) Unmarshal(dAtA []byte) error

func (*TableDescriptor_MutationJob) XXX_DiscardUnknown Uses

func (m *TableDescriptor_MutationJob) XXX_DiscardUnknown()

func (*TableDescriptor_MutationJob) XXX_Marshal Uses

func (m *TableDescriptor_MutationJob) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TableDescriptor_MutationJob) XXX_Merge Uses

func (dst *TableDescriptor_MutationJob) XXX_Merge(src proto.Message)

func (*TableDescriptor_MutationJob) XXX_Size Uses

func (m *TableDescriptor_MutationJob) XXX_Size() int

func (*TableDescriptor_MutationJob) XXX_Unmarshal Uses

func (m *TableDescriptor_MutationJob) XXX_Unmarshal(b []byte) error

type TableDescriptor_Reference Uses

type TableDescriptor_Reference struct {
    // The ID of the relation that depends on this one.
    ID  ID  `protobuf:"varint,1,opt,name=id,casttype=ID" json:"id"`
    // If applicable, the ID of this table's index that is referenced by the
    // dependent relation.
    IndexID IndexID `protobuf:"varint,2,opt,name=index_id,json=indexId,casttype=IndexID" json:"index_id"`
    // The IDs of this table's columns that are referenced by the dependent
    // relation.
    ColumnIDs []ColumnID `protobuf:"varint,3,rep,name=column_ids,json=columnIds,casttype=ColumnID" json:"column_ids,omitempty"`
}

func (*TableDescriptor_Reference) Descriptor Uses

func (*TableDescriptor_Reference) Descriptor() ([]byte, []int)

func (*TableDescriptor_Reference) Equal Uses

func (this *TableDescriptor_Reference) Equal(that interface{}) bool

func (*TableDescriptor_Reference) Marshal Uses

func (m *TableDescriptor_Reference) Marshal() (dAtA []byte, err error)

func (*TableDescriptor_Reference) MarshalTo Uses

func (m *TableDescriptor_Reference) MarshalTo(dAtA []byte) (int, error)

func (*TableDescriptor_Reference) ProtoMessage Uses

func (*TableDescriptor_Reference) ProtoMessage()

func (*TableDescriptor_Reference) Reset Uses

func (m *TableDescriptor_Reference) Reset()

func (*TableDescriptor_Reference) Size Uses

func (m *TableDescriptor_Reference) Size() (n int)

func (*TableDescriptor_Reference) String Uses

func (m *TableDescriptor_Reference) String() string

func (*TableDescriptor_Reference) Unmarshal Uses

func (m *TableDescriptor_Reference) Unmarshal(dAtA []byte) error

func (*TableDescriptor_Reference) XXX_DiscardUnknown Uses

func (m *TableDescriptor_Reference) XXX_DiscardUnknown()

func (*TableDescriptor_Reference) XXX_Marshal Uses

func (m *TableDescriptor_Reference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TableDescriptor_Reference) XXX_Merge Uses

func (dst *TableDescriptor_Reference) XXX_Merge(src proto.Message)

func (*TableDescriptor_Reference) XXX_Size Uses

func (m *TableDescriptor_Reference) XXX_Size() int

func (*TableDescriptor_Reference) XXX_Unmarshal Uses

func (m *TableDescriptor_Reference) XXX_Unmarshal(b []byte) error

type TableDescriptor_Replacement Uses

type TableDescriptor_Replacement struct {
    ID  ID  `protobuf:"varint,1,opt,name=id,casttype=ID" json:"id"`
    // Time is just used for debugging purposes. It is not used in business
    // logic. It is an HLC rather than just wall time only for historical
    // reasons. Prior to 20.1 it was populated with the commit timestamp of the
    // transaction which created this replacement. In 20.1 and after it is
    // populated with the read timestamp at which the descriptor being
    // replaced was read.
    Time hlc.Timestamp `protobuf:"bytes,2,opt,name=time" json:"time"`
}

func (*TableDescriptor_Replacement) Descriptor Uses

func (*TableDescriptor_Replacement) Descriptor() ([]byte, []int)

func (*TableDescriptor_Replacement) Equal Uses

func (this *TableDescriptor_Replacement) Equal(that interface{}) bool

func (*TableDescriptor_Replacement) Marshal Uses

func (m *TableDescriptor_Replacement) Marshal() (dAtA []byte, err error)

func (*TableDescriptor_Replacement) MarshalTo Uses

func (m *TableDescriptor_Replacement) MarshalTo(dAtA []byte) (int, error)

func (*TableDescriptor_Replacement) ProtoMessage Uses

func (*TableDescriptor_Replacement) ProtoMessage()

func (*TableDescriptor_Replacement) Reset Uses

func (m *TableDescriptor_Replacement) Reset()

func (*TableDescriptor_Replacement) Size Uses

func (m *TableDescriptor_Replacement) Size() (n int)

func (*TableDescriptor_Replacement) String Uses

func (m *TableDescriptor_Replacement) String() string

func (*TableDescriptor_Replacement) Unmarshal Uses

func (m *TableDescriptor_Replacement) Unmarshal(dAtA []byte) error

func (*TableDescriptor_Replacement) XXX_DiscardUnknown Uses

func (m *TableDescriptor_Replacement) XXX_DiscardUnknown()

func (*TableDescriptor_Replacement) XXX_Marshal Uses

func (m *TableDescriptor_Replacement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TableDescriptor_Replacement) XXX_Merge Uses

func (dst *TableDescriptor_Replacement) XXX_Merge(src proto.Message)

func (*TableDescriptor_Replacement) XXX_Size Uses

func (m *TableDescriptor_Replacement) XXX_Size() int

func (*TableDescriptor_Replacement) XXX_Unmarshal Uses

func (m *TableDescriptor_Replacement) XXX_Unmarshal(b []byte) error

type TableDescriptor_SchemaChangeLease Uses

type TableDescriptor_SchemaChangeLease struct {
    NodeID github_com_cockroachdb_cockroach_pkg_roachpb.NodeID `protobuf:"varint,1,opt,name=node_id,json=nodeId,casttype=github.com/cockroachdb/cockroach/pkg/roachpb.NodeID" json:"node_id"`
    // Nanoseconds since the Unix epoch.
    ExpirationTime int64 `protobuf:"varint,2,opt,name=expiration_time,json=expirationTime" json:"expiration_time"`
}

The schema update lease. A single goroutine across a cockroach cluster can own it, and will execute pending schema changes for this table. Since the execution of a pending schema change is through transactions, it is legal for more than one goroutine to attempt to execute it. This lease reduces write contention on the schema change.

func (*TableDescriptor_SchemaChangeLease) Descriptor Uses

func (*TableDescriptor_SchemaChangeLease) Descriptor() ([]byte, []int)

func (*TableDescriptor_SchemaChangeLease) Equal Uses

func (this *TableDescriptor_SchemaChangeLease) Equal(that interface{}) bool

func (*TableDescriptor_SchemaChangeLease) Marshal Uses

func (m *TableDescriptor_SchemaChangeLease) Marshal() (dAtA []byte, err error)

func (*TableDescriptor_SchemaChangeLease) MarshalTo Uses

func (m *TableDescriptor_SchemaChangeLease) MarshalTo(dAtA []byte) (int, error)

func (*TableDescriptor_SchemaChangeLease) ProtoMessage Uses

func (*TableDescriptor_SchemaChangeLease) ProtoMessage()

func (*TableDescriptor_SchemaChangeLease) Reset Uses

func (m *TableDescriptor_SchemaChangeLease) Reset()

func (*TableDescriptor_SchemaChangeLease) Size Uses

func (m *TableDescriptor_SchemaChangeLease) Size() (n int)

func (*TableDescriptor_SchemaChangeLease) String Uses

func (m *TableDescriptor_SchemaChangeLease) String() string

func (*TableDescriptor_SchemaChangeLease) Unmarshal Uses

func (m *TableDescriptor_SchemaChangeLease) Unmarshal(dAtA []byte) error

func (*TableDescriptor_SchemaChangeLease) XXX_DiscardUnknown Uses

func (m *TableDescriptor_SchemaChangeLease) XXX_DiscardUnknown()

func (*TableDescriptor_SchemaChangeLease) XXX_Marshal Uses

func (m *TableDescriptor_SchemaChangeLease) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TableDescriptor_SchemaChangeLease) XXX_Merge Uses

func (dst *TableDescriptor_SchemaChangeLease) XXX_Merge(src proto.Message)

func (*TableDescriptor_SchemaChangeLease) XXX_Size Uses

func (m *TableDescriptor_SchemaChangeLease) XXX_Size() int

func (*TableDescriptor_SchemaChangeLease) XXX_Unmarshal Uses

func (m *TableDescriptor_SchemaChangeLease) XXX_Unmarshal(b []byte) error

type TableDescriptor_SequenceOpts Uses

type TableDescriptor_SequenceOpts struct {
    // How much to increment the sequence by when nextval() is called.
    Increment int64 `protobuf:"varint,1,opt,name=increment" json:"increment"`
    // Minimum value of the sequence.
    MinValue int64 `protobuf:"varint,2,opt,name=min_value,json=minValue" json:"min_value"`
    // Maximum value of the sequence.
    MaxValue int64 `protobuf:"varint,3,opt,name=max_value,json=maxValue" json:"max_value"`
    // Start value of the sequence.
    Start int64 `protobuf:"varint,4,opt,name=start" json:"start"`
    // Whether the sequence is virtual.
    Virtual       bool                                       `protobuf:"varint,5,opt,name=virtual" json:"virtual"`
    SequenceOwner TableDescriptor_SequenceOpts_SequenceOwner `protobuf:"bytes,6,opt,name=sequence_owner,json=sequenceOwner" json:"sequence_owner"`
}

func (*TableDescriptor_SequenceOpts) Descriptor Uses

func (*TableDescriptor_SequenceOpts) Descriptor() ([]byte, []int)

func (*TableDescriptor_SequenceOpts) Equal Uses

func (this *TableDescriptor_SequenceOpts) Equal(that interface{}) bool

func (*TableDescriptor_SequenceOpts) HasOwner Uses

func (opts *TableDescriptor_SequenceOpts) HasOwner() bool

HasOwner returns true if the sequence options indicate an owner exists.

func (*TableDescriptor_SequenceOpts) Marshal Uses

func (m *TableDescriptor_SequenceOpts) Marshal() (dAtA []byte, err error)

func (*TableDescriptor_SequenceOpts) MarshalTo Uses

func (m *TableDescriptor_SequenceOpts) MarshalTo(dAtA []byte) (int, error)

func (*TableDescriptor_SequenceOpts) ProtoMessage Uses

func (*TableDescriptor_SequenceOpts) ProtoMessage()

func (*TableDescriptor_SequenceOpts) Reset Uses

func (m *TableDescriptor_SequenceOpts) Reset()

func (*TableDescriptor_SequenceOpts) Size Uses

func (m *TableDescriptor_SequenceOpts) Size() (n int)

func (*TableDescriptor_SequenceOpts) String Uses

func (m *TableDescriptor_SequenceOpts) String() string

func (*TableDescriptor_SequenceOpts) Unmarshal Uses

func (m *TableDescriptor_SequenceOpts) Unmarshal(dAtA []byte) error

func (*TableDescriptor_SequenceOpts) XXX_DiscardUnknown Uses

func (m *TableDescriptor_SequenceOpts) XXX_DiscardUnknown()

func (*TableDescriptor_SequenceOpts) XXX_Marshal Uses

func (m *TableDescriptor_SequenceOpts) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TableDescriptor_SequenceOpts) XXX_Merge Uses

func (dst *TableDescriptor_SequenceOpts) XXX_Merge(src proto.Message)

func (*TableDescriptor_SequenceOpts) XXX_Size Uses

func (m *TableDescriptor_SequenceOpts) XXX_Size() int

func (*TableDescriptor_SequenceOpts) XXX_Unmarshal Uses

func (m *TableDescriptor_SequenceOpts) XXX_Unmarshal(b []byte) error

type TableDescriptor_SequenceOpts_SequenceOwner Uses

type TableDescriptor_SequenceOpts_SequenceOwner struct {
    // Sequence Owner's Column ID
    OwnerColumnID ColumnID `protobuf:"varint,1,opt,name=owner_column_id,json=ownerColumnId,casttype=ColumnID" json:"owner_column_id"`
    // Sequence Owner's Table ID
    OwnerTableID ID  `protobuf:"varint,2,opt,name=owner_table_id,json=ownerTableId,casttype=ID" json:"owner_table_id"`
}

func (*TableDescriptor_SequenceOpts_SequenceOwner) Descriptor Uses

func (*TableDescriptor_SequenceOpts_SequenceOwner) Descriptor() ([]byte, []int)

func (*TableDescriptor_SequenceOpts_SequenceOwner) Equal Uses

func (this *TableDescriptor_SequenceOpts_SequenceOwner) Equal(that interface{}) bool

func (*TableDescriptor_SequenceOpts_SequenceOwner) Marshal Uses

func (m *TableDescriptor_SequenceOpts_SequenceOwner) Marshal() (dAtA []byte, err error)

func (*TableDescriptor_SequenceOpts_SequenceOwner) MarshalTo Uses

func (m *TableDescriptor_SequenceOpts_SequenceOwner) MarshalTo(dAtA []byte) (int, error)

func (*TableDescriptor_SequenceOpts_SequenceOwner) ProtoMessage Uses

func (*TableDescriptor_SequenceOpts_SequenceOwner) ProtoMessage()

func (*TableDescriptor_SequenceOpts_SequenceOwner) Reset Uses

func (m *TableDescriptor_SequenceOpts_SequenceOwner) Reset()

func (*TableDescriptor_SequenceOpts_SequenceOwner) Size Uses

func (m *TableDescriptor_SequenceOpts_SequenceOwner) Size() (n int)

func (*TableDescriptor_SequenceOpts_SequenceOwner) String Uses

func (m *TableDescriptor_SequenceOpts_SequenceOwner) String() string

func (*TableDescriptor_SequenceOpts_SequenceOwner) Unmarshal Uses

func (m *TableDescriptor_SequenceOpts_SequenceOwner) Unmarshal(dAtA []byte) error

func (*TableDescriptor_SequenceOpts_SequenceOwner) XXX_DiscardUnknown Uses

func (m *TableDescriptor_SequenceOpts_SequenceOwner) XXX_DiscardUnknown()

func (*TableDescriptor_SequenceOpts_SequenceOwner) XXX_Marshal Uses

func (m *TableDescriptor_SequenceOpts_SequenceOwner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TableDescriptor_SequenceOpts_SequenceOwner) XXX_Merge Uses

func (dst *TableDescriptor_SequenceOpts_SequenceOwner) XXX_Merge(src proto.Message)

func (*TableDescriptor_SequenceOpts_SequenceOwner) XXX_Size Uses

func (m *TableDescriptor_SequenceOpts_SequenceOwner) XXX_Size() int

func (*TableDescriptor_SequenceOpts_SequenceOwner) XXX_Unmarshal Uses

func (m *TableDescriptor_SequenceOpts_SequenceOwner) XXX_Unmarshal(b []byte) error

type TypeDescriptor Uses

type TypeDescriptor struct {
    // name is the current name of this user defined type.
    Name string `protobuf:"bytes,3,opt,name=name" json:"name"`
    // id is the globally unique ID for this type.
    ID      ID                `protobuf:"varint,4,opt,name=id,casttype=ID" json:"id"`
    Version DescriptorVersion `protobuf:"varint,9,opt,name=version,casttype=DescriptorVersion" json:"version"`
    // Last modification time of the descriptor.
    ModificationTime hlc.Timestamp `protobuf:"bytes,10,opt,name=modification_time,json=modificationTime" json:"modification_time"`
    DrainingNames    []NameInfo    `protobuf:"bytes,11,rep,name=draining_names,json=drainingNames" json:"draining_names"`
    // privileges contains the privileges for the type.
    Privileges *PrivilegeDescriptor `protobuf:"bytes,14,opt,name=privileges" json:"privileges,omitempty"`
    // parent_id represents the ID of the database that this type resides in.
    ParentID ID  `protobuf:"varint,1,opt,name=parent_id,json=parentId,casttype=ID" json:"parent_id"`
    // parent_schema_id represents the ID of the schema that this type resides in.
    ParentSchemaID ID  `protobuf:"varint,2,opt,name=parent_schema_id,json=parentSchemaId,casttype=ID" json:"parent_schema_id"`
    // array_type_id is the globally unique ID for the implicitly created array
    // type for this type. It is only set when the type descriptor points to a
    // non-array type.
    ArrayTypeID   ID                  `protobuf:"varint,8,opt,name=array_type_id,json=arrayTypeId,casttype=ID" json:"array_type_id"`
    State         DescriptorState     `protobuf:"varint,13,opt,name=state,enum=cockroach.sql.sqlbase.DescriptorState" json:"state"`
    OfflineReason string              `protobuf:"bytes,15,opt,name=offline_reason,json=offlineReason" json:"offline_reason"`
    Kind          TypeDescriptor_Kind `protobuf:"varint,5,opt,name=kind,enum=cockroach.sql.sqlbase.TypeDescriptor_Kind" json:"kind"`
    // referencing_descriptor_ids is a set of descriptors that reference this type.
    ReferencingDescriptorIDs []ID `protobuf:"varint,12,rep,name=referencing_descriptor_ids,json=referencingDescriptorIds,casttype=ID" json:"referencing_descriptor_ids,omitempty"`
    // enum_members is the set of values in an enum.
    EnumMembers []TypeDescriptor_EnumMember `protobuf:"bytes,6,rep,name=enum_members,json=enumMembers" json:"enum_members"`
    // alias is the types.T that this descriptor is an alias for.
    Alias *types.T `protobuf:"bytes,7,opt,name=alias" json:"alias,omitempty"`
}

TypeDescriptor represents a user defined type and is stored in a structured metadata key. The TypeDescriptor has a globally-unique ID shared with other Descriptors.

func TypeFromDescriptor Uses

func TypeFromDescriptor(desc *Descriptor, ts hlc.Timestamp) *TypeDescriptor

TypeFromDescriptor is the same thing as TableFromDescriptor, but for types.

func (*TypeDescriptor) Descriptor Uses

func (*TypeDescriptor) Descriptor() ([]byte, []int)

func (*TypeDescriptor) Equal Uses

func (this *TypeDescriptor) Equal(that interface{}) bool

func (*TypeDescriptor) GetAlias Uses

func (m *TypeDescriptor) GetAlias() *types.T

func (*TypeDescriptor) GetArrayTypeID Uses

func (m *TypeDescriptor) GetArrayTypeID() ID

func (*TypeDescriptor) GetDrainingNames Uses

func (m *TypeDescriptor) GetDrainingNames() []NameInfo

func (*TypeDescriptor) GetEnumMembers Uses

func (m *TypeDescriptor) GetEnumMembers() []TypeDescriptor_EnumMember

func (*TypeDescriptor) GetID Uses

func (m *TypeDescriptor) GetID() ID

func (*TypeDescriptor) GetKind Uses

func (m *TypeDescriptor) GetKind() TypeDescriptor_Kind

func (*TypeDescriptor) GetModificationTime Uses

func (m *TypeDescriptor) GetModificationTime() hlc.Timestamp

func (*TypeDescriptor) GetName Uses

func (m *TypeDescriptor) GetName() string

func (*TypeDescriptor) GetOfflineReason Uses

func (m *TypeDescriptor) GetOfflineReason() string

func (*TypeDescriptor) GetParentID Uses

func (m *TypeDescriptor) GetParentID() ID

func (*TypeDescriptor) GetParentSchemaID Uses

func (m *TypeDescriptor) GetParentSchemaID() ID

func (*TypeDescriptor) GetPrivileges Uses

func (m *TypeDescriptor) GetPrivileges() *PrivilegeDescriptor

func (*TypeDescriptor) GetReferencingDescriptorIDs Uses

func (m *TypeDescriptor) GetReferencingDescriptorIDs() []ID

func (*TypeDescriptor) GetState Uses

func (m *TypeDescriptor) GetState() DescriptorState

func (*TypeDescriptor) GetVersion Uses

func (m *TypeDescriptor) GetVersion() DescriptorVersion

func (*TypeDescriptor) Marshal Uses

func (m *TypeDescriptor) Marshal() (dAtA []byte, err error)

func (*TypeDescriptor) MarshalTo Uses

func (m *TypeDescriptor) MarshalTo(dAtA []byte) (int, error)

func (*TypeDescriptor) ProtoMessage Uses

func (*TypeDescriptor) ProtoMessage()

func (*TypeDescriptor) Reset Uses

func (m *TypeDescriptor) Reset()

func (*TypeDescriptor) Size Uses

func (m *TypeDescriptor) Size() (n int)

func (*TypeDescriptor) String Uses

func (m *TypeDescriptor) String() string

func (*TypeDescriptor) Unmarshal Uses

func (m *TypeDescriptor) Unmarshal(dAtA []byte) error

func (*TypeDescriptor) XXX_DiscardUnknown Uses

func (m *TypeDescriptor) XXX_DiscardUnknown()

func (*TypeDescriptor) XXX_Marshal Uses

func (m *TypeDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TypeDescriptor) XXX_Merge Uses

func (dst *TypeDescriptor) XXX_Merge(src proto.Message)

func (*TypeDescriptor) XXX_Size Uses

func (m *TypeDescriptor) XXX_Size() int

func (*TypeDescriptor) XXX_Unmarshal Uses

func (m *TypeDescriptor) XXX_Unmarshal(b []byte) error

type TypeDescriptor_EnumMember Uses

type TypeDescriptor_EnumMember struct {
    PhysicalRepresentation []byte                               `protobuf:"bytes,1,opt,name=physical_representation,json=physicalRepresentation" json:"physical_representation,omitempty"`
    LogicalRepresentation  string                               `protobuf:"bytes,2,opt,name=logical_representation,json=logicalRepresentation" json:"logical_representation"`
    Capability             TypeDescriptor_EnumMember_Capability `protobuf:"varint,3,opt,name=capability,enum=cockroach.sql.sqlbase.TypeDescriptor_EnumMember_Capability" json:"capability"`
}

EnumMember represents a value in an enum.

func (*TypeDescriptor_EnumMember) Descriptor Uses

func (*TypeDescriptor_EnumMember) Descriptor() ([]byte, []int)

func (*TypeDescriptor_EnumMember) Equal Uses

func (this *TypeDescriptor_EnumMember) Equal(that interface{}) bool

func (*TypeDescriptor_EnumMember) Marshal Uses

func (m *TypeDescriptor_EnumMember) Marshal() (dAtA []byte, err error)

func (*TypeDescriptor_EnumMember) MarshalTo Uses

func (m *TypeDescriptor_EnumMember) MarshalTo(dAtA []byte) (int, error)

func (*TypeDescriptor_EnumMember) ProtoMessage Uses

func (*TypeDescriptor_EnumMember) ProtoMessage()

func (*TypeDescriptor_EnumMember) Reset Uses

func (m *TypeDescriptor_EnumMember) Reset()

func (*TypeDescriptor_EnumMember) Size Uses

func (m *TypeDescriptor_EnumMember) Size() (n int)

func (*TypeDescriptor_EnumMember) String Uses

func (m *TypeDescriptor_EnumMember) String() string

func (*TypeDescriptor_EnumMember) Unmarshal Uses

func (m *TypeDescriptor_EnumMember) Unmarshal(dAtA []byte) error

func (*TypeDescriptor_EnumMember) XXX_DiscardUnknown Uses

func (m *TypeDescriptor_EnumMember) XXX_DiscardUnknown()

func (*TypeDescriptor_EnumMember) XXX_Marshal Uses

func (m *TypeDescriptor_EnumMember) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TypeDescriptor_EnumMember) XXX_Merge Uses

func (dst *TypeDescriptor_EnumMember) XXX_Merge(src proto.Message)

func (*TypeDescriptor_EnumMember) XXX_Size Uses

func (m *TypeDescriptor_EnumMember) XXX_Size() int

func (*TypeDescriptor_EnumMember) XXX_Unmarshal Uses

func (m *TypeDescriptor_EnumMember) XXX_Unmarshal(b []byte) error

type TypeDescriptor_EnumMember_Capability Uses

type TypeDescriptor_EnumMember_Capability int32

Represents what operations are allowed on this ENUM member.

const (
    // A member in the ALL state can be both read and written.
    TypeDescriptor_EnumMember_ALL TypeDescriptor_EnumMember_Capability = 0
    // A member in the READ_ONLY state can be only read from the bytes
    // representation of the member. Creation of this member from the logical
    // representation is disallowed, which prevents writes of the member.
    TypeDescriptor_EnumMember_READ_ONLY TypeDescriptor_EnumMember_Capability = 1
)

func (TypeDescriptor_EnumMember_Capability) Enum Uses

func (x TypeDescriptor_EnumMember_Capability) Enum() *TypeDescriptor_EnumMember_Capability

func (TypeDescriptor_EnumMember_Capability) EnumDescriptor Uses

func (TypeDescriptor_EnumMember_Capability) EnumDescriptor() ([]byte, []int)

func (TypeDescriptor_EnumMember_Capability) String Uses

func (x TypeDescriptor_EnumMember_Capability) String() string

func (*TypeDescriptor_EnumMember_Capability) UnmarshalJSON Uses

func (x *TypeDescriptor_EnumMember_Capability) UnmarshalJSON(data []byte) error

type TypeDescriptor_Kind Uses

type TypeDescriptor_Kind int32

Represents the kind of type that this type descriptor represents.

const (
    // Represents a user defined enum type.
    TypeDescriptor_ENUM TypeDescriptor_Kind = 0
    // Represents a user defined type that is just an alias for another type.
    // As of now, it is used only internally.
    TypeDescriptor_ALIAS TypeDescriptor_Kind = 1
)

func (TypeDescriptor_Kind) Enum Uses

func (x TypeDescriptor_Kind) Enum() *TypeDescriptor_Kind

func (TypeDescriptor_Kind) EnumDescriptor Uses

func (TypeDescriptor_Kind) EnumDescriptor() ([]byte, []int)

func (TypeDescriptor_Kind) String Uses

func (x TypeDescriptor_Kind) String() string

func (*TypeDescriptor_Kind) UnmarshalJSON Uses

func (x *TypeDescriptor_Kind) UnmarshalJSON(data []byte) error

type UserPrivilegeString Uses

type UserPrivilegeString struct {
    User       string
    Privileges []string
}

UserPrivilegeString is a pair of strings describing the privileges for a given user.

func (UserPrivilegeString) PrivilegeString Uses

func (u UserPrivilegeString) PrivilegeString() string

PrivilegeString returns a string of comma-separted privilege names.

type UserPrivileges Uses

type UserPrivileges struct {
    User string `protobuf:"bytes,1,opt,name=user" json:"user"`
    // privileges is a bitfield of 1<<Privilege values.
    Privileges uint32 `protobuf:"varint,2,opt,name=privileges" json:"privileges"`
}

UserPrivileges describes the list of privileges available for a given user.

func (*UserPrivileges) Descriptor Uses

func (*UserPrivileges) Descriptor() ([]byte, []int)

func (*UserPrivileges) Equal Uses

func (this *UserPrivileges) Equal(that interface{}) bool

func (*UserPrivileges) Marshal Uses

func (m *UserPrivileges) Marshal() (dAtA []byte, err error)

func (*UserPrivileges) MarshalTo Uses

func (m *UserPrivileges) MarshalTo(dAtA []byte) (int, error)

func (*UserPrivileges) ProtoMessage Uses

func (*UserPrivileges) ProtoMessage()

func (*UserPrivileges) Reset Uses

func (m *UserPrivileges) Reset()

func (*UserPrivileges) Size Uses

func (m *UserPrivileges) Size() (n int)

func (*UserPrivileges) String Uses

func (m *UserPrivileges) String() string

func (*UserPrivileges) Unmarshal Uses

func (m *UserPrivileges) Unmarshal(dAtA []byte) error

func (*UserPrivileges) XXX_DiscardUnknown Uses

func (m *UserPrivileges) XXX_DiscardUnknown()

func (*UserPrivileges) XXX_Marshal Uses

func (m *UserPrivileges) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UserPrivileges) XXX_Merge Uses

func (dst *UserPrivileges) XXX_Merge(src proto.Message)

func (*UserPrivileges) XXX_Size Uses

func (m *UserPrivileges) XXX_Size() int

func (*UserPrivileges) XXX_Unmarshal Uses

func (m *UserPrivileges) XXX_Unmarshal(b []byte) error

Package descpb imports 25 packages (graph) and is imported by 55 packages. Updated 2020-09-23. Refresh now. Tools for package owners.