{"modulePath":"github.com/spencerkimball/cockroach","version":"v1.0.3","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package sqlbase\n\nPackage sqlbase is a generated protocol buffer package.\n\nIt is generated from these files:\n\n\tcockroach/pkg/sql/sqlbase/encoded_datum.proto\n\tcockroach/pkg/sql/sqlbase/privilege.proto\n\tcockroach/pkg/sql/sqlbase/structured.proto\n\nIt has these top-level messages:\n\n\tUserPrivileges\n\tPrivilegeDescriptor\n\tColumnType\n\tForeignKeyReference\n\tColumnDescriptor\n\tColumnFamilyDescriptor\n\tInterleaveDescriptor\n\tIndexDescriptor\n\tDescriptorMutation\n\tTableDescriptor\n\tDatabaseDescriptor\n\tDescriptor\n\n## Constants\n\n```go\nconst (\n\n\t// SizeOfDatum is the memory size of a Datum reference.\n\tSizeOfDatum = int64(unsafe.Sizeof(parser.Datum(nil)))\n\t// SizeOfDatums is the memory size of a Datum slice.\n\tSizeOfDatums = int64(unsafe.Sizeof(parser.Datums(nil)))\n)\n```\n\n```go\nconst (\n\t// CheckFKs can be passed to row writers to check fk validity.\n\tCheckFKs = true\n\t// SkipFKs can be passed to row writer to skip fk validity checks.\n\tSkipFKs = false\n)\n```\n\n```go\nconst (\n\t// RowUpdaterDefault indicates that a RowUpdater should update everything\n\t// about a row, including secondary indexes.\n\tRowUpdaterDefault rowUpdaterType = 0\n\t// RowUpdaterOnlyColumns indicates that a RowUpdater should only update the\n\t// columns of a row.\n\tRowUpdaterOnlyColumns rowUpdaterType = 1\n)\n```\n\n```go\nconst (\n\tNamespaceTableSchema = `\nCREATE TABLE system.namespace (\n  \"parentID\" INT,\n  name       STRING,\n  id         INT,\n  PRIMARY KEY (\"parentID\", name)\n);`\n\n\tDescriptorTableSchema = `\nCREATE TABLE system.descriptor (\n  id         INT PRIMARY KEY,\n  descriptor BYTES\n);`\n\n\tUsersTableSchema = `\nCREATE TABLE system.users (\n  username         STRING PRIMARY KEY,\n  \"hashedPassword\" BYTES\n);`\n\n\t// Zone settings per DB/Table.\n\tZonesTableSchema = `\nCREATE TABLE system.zones (\n  id     INT PRIMARY KEY,\n  config BYTES\n);`\n\n\tSettingsTableSchema = `\nCREATE TABLE system.settings (\n\tname              STRING    NOT NULL PRIMARY KEY,\n\tvalue             STRING    NOT NULL,\n\t\"lastUpdated\"     TIMESTAMP NOT NULL DEFAULT now(),\n\t\"valueType\"       STRING,\n\tFAMILY (name, value, \"lastUpdated\", \"valueType\")\n);`\n)\n```\nThese system tables are part of the system config.\n\n```go\nconst (\n\tLeaseTableSchema = `\nCREATE TABLE system.lease (\n  \"descID\"   INT,\n  version    INT,\n  \"nodeID\"   INT,\n  expiration TIMESTAMP,\n  PRIMARY KEY (\"descID\", version, expiration, \"nodeID\")\n);`\n\n\tEventLogTableSchema = `\nCREATE TABLE system.eventlog (\n  timestamp     TIMESTAMP  NOT NULL,\n  \"eventType\"   STRING     NOT NULL,\n  \"targetID\"    INT        NOT NULL,\n  \"reportingID\" INT        NOT NULL,\n  info          STRING,\n  \"uniqueID\"    BYTES      DEFAULT uuid_v4(),\n  PRIMARY KEY (timestamp, \"uniqueID\")\n);`\n\n\t// rangelog is currently envisioned as a wide table; many different event\n\t// types can be recorded to the table.\n\tRangeEventTableSchema = `\nCREATE TABLE system.rangelog (\n  timestamp      TIMESTAMP  NOT NULL,\n  \"rangeID\"      INT        NOT NULL,\n  \"storeID\"      INT        NOT NULL,\n  \"eventType\"    STRING     NOT NULL,\n  \"otherRangeID\" INT,\n  info           STRING,\n  \"uniqueID\"     INT        DEFAULT unique_rowid(),\n  PRIMARY KEY (timestamp, \"uniqueID\")\n);`\n\n\tUITableSchema = `\nCREATE TABLE system.ui (\n\tkey           STRING PRIMARY KEY,\n\tvalue         BYTES,\n\t\"lastUpdated\" TIMESTAMP NOT NULL\n);`\n\n\tJobsTableSchema = `\nCREATE TABLE system.jobs (\n\tid                INT       DEFAULT unique_rowid() PRIMARY KEY,\n\tstatus            STRING    NOT NULL,\n\tcreated           TIMESTAMP NOT NULL DEFAULT now(),\n\tpayload           BYTES     NOT NULL,\n\tINDEX (status, created),\n\tFAMILY (id, status, created, payload)\n);`\n)\n```\nThese system tables are not part of the system config.\n\n```go\nconst (\n\t// CodeRangeUnavailable signals that some data from the cluster cannot be\n\t// accessed (e.g. because all replicas awol).\n\t// We're using the postgres \"Internal Error\" error class \"XX\".\n\tCodeRangeUnavailable string = \"XXC00\"\n)\n```\nCockroach error extensions:\n\n```go\nconst FamilyHeuristicTargetBytes = 256\n```\nFamilyHeuristicTargetBytes is the target total byte size of columns that the current heuristic will assign to a family.\n\n```go\nconst (\n\t// PrimaryKeyIndexName is the name of the index for the primary key.\n\tPrimaryKeyIndexName = \"primary\"\n)\n```\n\n## Variables\n\n```go\nvar (\n\tErrInvalidLengthPrivilege = fmt.Errorf(\"proto: negative length found during unmarshaling\")\n\tErrIntOverflowPrivilege   = fmt.Errorf(\"proto: integer overflow\")\n)\n```\n\n```go\nvar (\n\tErrInvalidLengthStructured = fmt.Errorf(\"proto: negative length found during unmarshaling\")\n\tErrIntOverflowStructured   = fmt.Errorf(\"proto: integer overflow\")\n)\n```\n\n```go\nvar (\n\t// SystemDB is the descriptor for the system database.\n\tSystemDB = DatabaseDescriptor{\n\t\tName: \"system\",\n\t\tID:   keys.SystemDatabaseID,\n\n\t\tPrivileges: NewPrivilegeDescriptor(security.RootUser,\n\t\t\tSystemDesiredPrivileges(keys.SystemDatabaseID)),\n\t}\n\n\t// NamespaceTable is the descriptor for the namespace table.\n\tNamespaceTable = TableDescriptor{\n\t\tName:     \"namespace\",\n\t\tID:       keys.NamespaceTableID,\n\t\tParentID: 1,\n\t\tVersion:  1,\n\t\tColumns: []ColumnDescriptor{\n\t\t\t{Name: \"parentID\", ID: 1, Type: colTypeInt},\n\t\t\t{Name: \"name\", ID: 2, Type: colTypeString},\n\t\t\t{Name: \"id\", ID: 3, Type: colTypeInt, Nullable: true},\n\t\t},\n\t\tNextColumnID: 4,\n\t\tFamilies: []ColumnFamilyDescriptor{\n\t\t\t{Name: \"primary\", ID: 0, ColumnNames: []string{\"parentID\", \"name\"}, ColumnIDs: []ColumnID{1, 2}},\n\t\t\t{Name: \"fam_3_id\", ID: 3, ColumnNames: []string{\"id\"}, ColumnIDs: []ColumnID{3}, DefaultColumnID: 3},\n\t\t},\n\t\tNextFamilyID: 4,\n\t\tPrimaryIndex: IndexDescriptor{\n\t\t\tName:             \"primary\",\n\t\t\tID:               1,\n\t\t\tUnique:           true,\n\t\t\tColumnNames:      []string{\"parentID\", \"name\"},\n\t\t\tColumnDirections: []IndexDescriptor_Direction{IndexDescriptor_ASC, IndexDescriptor_ASC},\n\t\t\tColumnIDs:        []ColumnID{1, 2},\n\t\t},\n\t\tNextIndexID:    2,\n\t\tPrivileges:     NewPrivilegeDescriptor(security.RootUser, SystemDesiredPrivileges(keys.NamespaceTableID)),\n\t\tFormatVersion:  InterleavedFormatVersion,\n\t\tNextMutationID: 1,\n\t}\n\n\t// DescriptorTable is the descriptor for the descriptor table.\n\tDescriptorTable = TableDescriptor{\n\t\tName:       \"descriptor\",\n\t\tID:         keys.DescriptorTableID,\n\t\tPrivileges: NewPrivilegeDescriptor(security.RootUser, SystemDesiredPrivileges(keys.DescriptorTableID)),\n\t\tParentID:   1,\n\t\tVersion:    1,\n\t\tColumns: []ColumnDescriptor{\n\t\t\t{Name: \"id\", ID: 1, Type: colTypeInt},\n\t\t\t{Name: \"descriptor\", ID: 2, Type: colTypeBytes, Nullable: true},\n\t\t},\n\t\tNextColumnID: 3,\n\t\tFamilies: []ColumnFamilyDescriptor{\n\t\t\t{Name: \"primary\", ID: 0, ColumnNames: []string{\"id\"}, ColumnIDs: singleID1},\n\t\t\t{Name: \"fam_2_descriptor\", ID: 2, ColumnNames: []string{\"descriptor\"}, ColumnIDs: []ColumnID{2}, DefaultColumnID: 2},\n\t\t},\n\t\tPrimaryIndex:   pk(\"id\"),\n\t\tNextFamilyID:   3,\n\t\tNextIndexID:    2,\n\t\tFormatVersion:  InterleavedFormatVersion,\n\t\tNextMutationID: 1,\n\t}\n\n\t// UsersTable is the descriptor for the users table.\n\tUsersTable = TableDescriptor{\n\t\tName:     \"users\",\n\t\tID:       keys.UsersTableID,\n\t\tParentID: 1,\n\t\tVersion:  1,\n\t\tColumns: []ColumnDescriptor{\n\t\t\t{Name: \"username\", ID: 1, Type: colTypeString},\n\t\t\t{Name: \"hashedPassword\", ID: 2, Type: colTypeBytes, Nullable: true},\n\t\t},\n\t\tNextColumnID: 3,\n\t\tFamilies: []ColumnFamilyDescriptor{\n\t\t\t{Name: \"primary\", ID: 0, ColumnNames: []string{\"username\"}, ColumnIDs: singleID1},\n\t\t\t{Name: \"fam_2_hashedPassword\", ID: 2, ColumnNames: []string{\"hashedPassword\"}, ColumnIDs: []ColumnID{2}, DefaultColumnID: 2},\n\t\t},\n\t\tPrimaryIndex:   pk(\"username\"),\n\t\tNextFamilyID:   3,\n\t\tNextIndexID:    2,\n\t\tPrivileges:     NewPrivilegeDescriptor(security.RootUser, SystemDesiredPrivileges(keys.UsersTableID)),\n\t\tFormatVersion:  InterleavedFormatVersion,\n\t\tNextMutationID: 1,\n\t}\n\n\t// ZonesTable is the descriptor for the zones table.\n\tZonesTable = TableDescriptor{\n\t\tName:     \"zones\",\n\t\tID:       keys.ZonesTableID,\n\t\tParentID: 1,\n\t\tVersion:  1,\n\t\tColumns: []ColumnDescriptor{\n\t\t\t{Name: \"id\", ID: 1, Type: colTypeInt},\n\t\t\t{Name: \"config\", ID: 2, Type: colTypeBytes, Nullable: true},\n\t\t},\n\t\tNextColumnID: 3,\n\t\tFamilies: []ColumnFamilyDescriptor{\n\t\t\t{Name: \"primary\", ID: 0, ColumnNames: []string{\"id\"}, ColumnIDs: singleID1},\n\t\t\t{Name: \"fam_2_config\", ID: 2, ColumnNames: []string{\"config\"}, ColumnIDs: []ColumnID{2}, DefaultColumnID: 2},\n\t\t},\n\t\tPrimaryIndex:   pk(\"id\"),\n\t\tNextFamilyID:   3,\n\t\tNextIndexID:    2,\n\t\tPrivileges:     NewPrivilegeDescriptor(security.RootUser, SystemDesiredPrivileges(keys.ZonesTableID)),\n\t\tFormatVersion:  InterleavedFormatVersion,\n\t\tNextMutationID: 1,\n\t}\n\t// SettingsTable is the descriptor for the jobs table.\n\tSettingsTable = TableDescriptor{\n\t\tName:     \"settings\",\n\t\tID:       keys.SettingsTableID,\n\t\tParentID: 1,\n\t\tVersion:  1,\n\t\tColumns: []ColumnDescriptor{\n\t\t\t{Name: \"name\", ID: 1, Type: colTypeString},\n\t\t\t{Name: \"value\", ID: 2, Type: colTypeString},\n\t\t\t{Name: \"lastUpdated\", ID: 3, Type: colTypeTimestamp, DefaultExpr: \u0026nowString},\n\t\t\t{Name: \"valueType\", ID: 4, Type: colTypeString, Nullable: true},\n\t\t},\n\t\tNextColumnID: 5,\n\t\tFamilies: []ColumnFamilyDescriptor{\n\t\t\t{\n\t\t\t\tName:        \"fam_0_name_value_lastUpdated_valueType\",\n\t\t\t\tID:          0,\n\t\t\t\tColumnNames: []string{\"name\", \"value\", \"lastUpdated\", \"valueType\"},\n\t\t\t\tColumnIDs:   []ColumnID{1, 2, 3, 4},\n\t\t\t},\n\t\t},\n\t\tNextFamilyID:   1,\n\t\tPrimaryIndex:   pk(\"name\"),\n\t\tNextIndexID:    2,\n\t\tPrivileges:     NewPrivilegeDescriptor(security.RootUser, SystemDesiredPrivileges(keys.SettingsTableID)),\n\t\tFormatVersion:  InterleavedFormatVersion,\n\t\tNextMutationID: 1,\n\t}\n)\n```\nThese system config TableDescriptor literals should match the descriptor that would be produced by evaluating one of the above \\`CREATE TABLE\\` statements. See the \\`TestSystemTableLiterals\\` which checks that they do indeed match, and has suggestions on writing and maintaining them.\n\n```go\nvar (\n\t// LeaseTable is the descriptor for the leases table.\n\tLeaseTable = TableDescriptor{\n\t\tName:     \"lease\",\n\t\tID:       keys.LeaseTableID,\n\t\tParentID: 1,\n\t\tVersion:  1,\n\t\tColumns: []ColumnDescriptor{\n\t\t\t{Name: \"descID\", ID: 1, Type: colTypeInt},\n\t\t\t{Name: \"version\", ID: 2, Type: colTypeInt},\n\t\t\t{Name: \"nodeID\", ID: 3, Type: colTypeInt},\n\t\t\t{Name: \"expiration\", ID: 4, Type: colTypeTimestamp},\n\t\t},\n\t\tNextColumnID: 5,\n\t\tFamilies: []ColumnFamilyDescriptor{\n\t\t\t{Name: \"primary\", ID: 0, ColumnNames: []string{\"descID\", \"version\", \"nodeID\", \"expiration\"}, ColumnIDs: []ColumnID{1, 2, 3, 4}},\n\t\t},\n\t\tPrimaryIndex: IndexDescriptor{\n\t\t\tName:             \"primary\",\n\t\t\tID:               1,\n\t\t\tUnique:           true,\n\t\t\tColumnNames:      []string{\"descID\", \"version\", \"expiration\", \"nodeID\"},\n\t\t\tColumnDirections: []IndexDescriptor_Direction{IndexDescriptor_ASC, IndexDescriptor_ASC, IndexDescriptor_ASC, IndexDescriptor_ASC},\n\t\t\tColumnIDs:        []ColumnID{1, 2, 4, 3},\n\t\t},\n\t\tNextFamilyID:   1,\n\t\tNextIndexID:    2,\n\t\tPrivileges:     NewPrivilegeDescriptor(security.RootUser, SystemDesiredPrivileges(keys.LeaseTableID)),\n\t\tFormatVersion:  InterleavedFormatVersion,\n\t\tNextMutationID: 1,\n\t}\n\n\t// EventLogTable is the descriptor for the event log table.\n\tEventLogTable = TableDescriptor{\n\t\tName:     \"eventlog\",\n\t\tID:       keys.EventLogTableID,\n\t\tParentID: 1,\n\t\tVersion:  1,\n\t\tColumns: []ColumnDescriptor{\n\t\t\t{Name: \"timestamp\", ID: 1, Type: colTypeTimestamp},\n\t\t\t{Name: \"eventType\", ID: 2, Type: colTypeString},\n\t\t\t{Name: \"targetID\", ID: 3, Type: colTypeInt},\n\t\t\t{Name: \"reportingID\", ID: 4, Type: colTypeInt},\n\t\t\t{Name: \"info\", ID: 5, Type: colTypeString, Nullable: true},\n\t\t\t{Name: \"uniqueID\", ID: 6, Type: colTypeBytes, DefaultExpr: \u0026uuidV4String},\n\t\t},\n\t\tNextColumnID: 7,\n\t\tFamilies: []ColumnFamilyDescriptor{\n\t\t\t{Name: \"primary\", ID: 0, ColumnNames: []string{\"timestamp\", \"uniqueID\"}, ColumnIDs: []ColumnID{1, 6}},\n\t\t\t{Name: \"fam_2_eventType\", ID: 2, ColumnNames: []string{\"eventType\"}, ColumnIDs: []ColumnID{2}, DefaultColumnID: 2},\n\t\t\t{Name: \"fam_3_targetID\", ID: 3, ColumnNames: []string{\"targetID\"}, ColumnIDs: []ColumnID{3}, DefaultColumnID: 3},\n\t\t\t{Name: \"fam_4_reportingID\", ID: 4, ColumnNames: []string{\"reportingID\"}, ColumnIDs: []ColumnID{4}, DefaultColumnID: 4},\n\t\t\t{Name: \"fam_5_info\", ID: 5, ColumnNames: []string{\"info\"}, ColumnIDs: []ColumnID{5}, DefaultColumnID: 5},\n\t\t},\n\t\tPrimaryIndex: IndexDescriptor{\n\t\t\tName:             \"primary\",\n\t\t\tID:               1,\n\t\t\tUnique:           true,\n\t\t\tColumnNames:      []string{\"timestamp\", \"uniqueID\"},\n\t\t\tColumnDirections: []IndexDescriptor_Direction{IndexDescriptor_ASC, IndexDescriptor_ASC},\n\t\t\tColumnIDs:        []ColumnID{1, 6},\n\t\t},\n\t\tNextFamilyID:   6,\n\t\tNextIndexID:    2,\n\t\tPrivileges:     NewPrivilegeDescriptor(security.RootUser, SystemDesiredPrivileges(keys.EventLogTableID)),\n\t\tFormatVersion:  InterleavedFormatVersion,\n\t\tNextMutationID: 1,\n\t}\n\n\t// RangeEventTable is the descriptor for the range log table.\n\tRangeEventTable = TableDescriptor{\n\t\tName:     \"rangelog\",\n\t\tID:       keys.RangeEventTableID,\n\t\tParentID: 1,\n\t\tVersion:  1,\n\t\tColumns: []ColumnDescriptor{\n\t\t\t{Name: \"timestamp\", ID: 1, Type: colTypeTimestamp},\n\t\t\t{Name: \"rangeID\", ID: 2, Type: colTypeInt},\n\t\t\t{Name: \"storeID\", ID: 3, Type: colTypeInt},\n\t\t\t{Name: \"eventType\", ID: 4, Type: colTypeString},\n\t\t\t{Name: \"otherRangeID\", ID: 5, Type: colTypeInt, Nullable: true},\n\t\t\t{Name: \"info\", ID: 6, Type: colTypeString, Nullable: true},\n\t\t\t{Name: \"uniqueID\", ID: 7, Type: colTypeInt, DefaultExpr: \u0026uniqueRowIDString},\n\t\t},\n\t\tNextColumnID: 8,\n\t\tFamilies: []ColumnFamilyDescriptor{\n\t\t\t{Name: \"primary\", ID: 0, ColumnNames: []string{\"timestamp\", \"uniqueID\"}, ColumnIDs: []ColumnID{1, 7}},\n\t\t\t{Name: \"fam_2_rangeID\", ID: 2, ColumnNames: []string{\"rangeID\"}, ColumnIDs: []ColumnID{2}, DefaultColumnID: 2},\n\t\t\t{Name: \"fam_3_storeID\", ID: 3, ColumnNames: []string{\"storeID\"}, ColumnIDs: []ColumnID{3}, DefaultColumnID: 3},\n\t\t\t{Name: \"fam_4_eventType\", ID: 4, ColumnNames: []string{\"eventType\"}, ColumnIDs: []ColumnID{4}, DefaultColumnID: 4},\n\t\t\t{Name: \"fam_5_otherRangeID\", ID: 5, ColumnNames: []string{\"otherRangeID\"}, ColumnIDs: []ColumnID{5}, DefaultColumnID: 5},\n\t\t\t{Name: \"fam_6_info\", ID: 6, ColumnNames: []string{\"info\"}, ColumnIDs: []ColumnID{6}, DefaultColumnID: 6},\n\t\t},\n\t\tPrimaryIndex: IndexDescriptor{\n\t\t\tName:             \"primary\",\n\t\t\tID:               1,\n\t\t\tUnique:           true,\n\t\t\tColumnNames:      []string{\"timestamp\", \"uniqueID\"},\n\t\t\tColumnDirections: []IndexDescriptor_Direction{IndexDescriptor_ASC, IndexDescriptor_ASC},\n\t\t\tColumnIDs:        []ColumnID{1, 7},\n\t\t},\n\t\tNextFamilyID:   7,\n\t\tNextIndexID:    2,\n\t\tPrivileges:     NewPrivilegeDescriptor(security.RootUser, SystemDesiredPrivileges(keys.RangeEventTableID)),\n\t\tFormatVersion:  InterleavedFormatVersion,\n\t\tNextMutationID: 1,\n\t}\n\n\t// UITable is the descriptor for the ui table.\n\tUITable = TableDescriptor{\n\t\tName:     \"ui\",\n\t\tID:       keys.UITableID,\n\t\tParentID: 1,\n\t\tVersion:  1,\n\t\tColumns: []ColumnDescriptor{\n\t\t\t{Name: \"key\", ID: 1, Type: colTypeString},\n\t\t\t{Name: \"value\", ID: 2, Type: colTypeBytes, Nullable: true},\n\t\t\t{Name: \"lastUpdated\", ID: 3, Type: ColumnType{Kind: ColumnType_TIMESTAMP}},\n\t\t},\n\t\tNextColumnID: 4,\n\t\tFamilies: []ColumnFamilyDescriptor{\n\t\t\t{Name: \"primary\", ID: 0, ColumnNames: []string{\"key\"}, ColumnIDs: singleID1},\n\t\t\t{Name: \"fam_2_value\", ID: 2, ColumnNames: []string{\"value\"}, ColumnIDs: []ColumnID{2}, DefaultColumnID: 2},\n\t\t\t{Name: \"fam_3_lastUpdated\", ID: 3, ColumnNames: []string{\"lastUpdated\"}, ColumnIDs: []ColumnID{3}, DefaultColumnID: 3},\n\t\t},\n\t\tNextFamilyID:   4,\n\t\tPrimaryIndex:   pk(\"key\"),\n\t\tNextIndexID:    2,\n\t\tPrivileges:     NewPrivilegeDescriptor(security.RootUser, SystemDesiredPrivileges(keys.UITableID)),\n\t\tFormatVersion:  InterleavedFormatVersion,\n\t\tNextMutationID: 1,\n\t}\n\n\t// JobsTable is the descriptor for the jobs table.\n\tJobsTable = TableDescriptor{\n\t\tName:     \"jobs\",\n\t\tID:       keys.JobsTableID,\n\t\tParentID: 1,\n\t\tVersion:  1,\n\t\tColumns: []ColumnDescriptor{\n\t\t\t{Name: \"id\", ID: 1, Type: colTypeInt, DefaultExpr: \u0026uniqueRowIDString},\n\t\t\t{Name: \"status\", ID: 2, Type: colTypeString},\n\t\t\t{Name: \"created\", ID: 3, Type: colTypeTimestamp, DefaultExpr: \u0026nowString},\n\t\t\t{Name: \"payload\", ID: 4, Type: colTypeBytes},\n\t\t},\n\t\tNextColumnID: 5,\n\t\tFamilies: []ColumnFamilyDescriptor{\n\t\t\t{\n\t\t\t\tName:        \"fam_0_id_status_created_payload\",\n\t\t\t\tID:          0,\n\t\t\t\tColumnNames: []string{\"id\", \"status\", \"created\", \"payload\"},\n\t\t\t\tColumnIDs:   []ColumnID{1, 2, 3, 4},\n\t\t\t},\n\t\t},\n\t\tNextFamilyID: 1,\n\t\tPrimaryIndex: pk(\"id\"),\n\t\tIndexes: []IndexDescriptor{\n\t\t\t{\n\t\t\t\tName:             \"jobs_status_created_idx\",\n\t\t\t\tID:               2,\n\t\t\t\tUnique:           false,\n\t\t\t\tColumnNames:      []string{\"status\", \"created\"},\n\t\t\t\tColumnDirections: []IndexDescriptor_Direction{IndexDescriptor_ASC, IndexDescriptor_ASC},\n\t\t\t\tColumnIDs:        []ColumnID{2, 3},\n\t\t\t\tExtraColumnIDs:   []ColumnID{1},\n\t\t\t},\n\t\t},\n\t\tNextIndexID:    3,\n\t\tPrivileges:     NewPrivilegeDescriptor(security.RootUser, SystemDesiredPrivileges(keys.JobsTableID)),\n\t\tFormatVersion:  InterleavedFormatVersion,\n\t\tNextMutationID: 1,\n\t}\n)\n```\nThese system TableDescriptor literals should match the descriptor that would be produced by evaluating one of the above \\`CREATE TABLE\\` statements for system tables that are not system config tables. See the \\`TestSystemTableLiterals\\` which checks that they do indeed match, and has suggestions on writing and maintaining them.\n\n```go\nvar ColumnType_Kind_name = map[int32]string{\n\t0:   \"BOOL\",\n\t1:   \"INT\",\n\t2:   \"FLOAT\",\n\t3:   \"DECIMAL\",\n\t4:   \"DATE\",\n\t5:   \"TIMESTAMP\",\n\t6:   \"INTERVAL\",\n\t7:   \"STRING\",\n\t8:   \"BYTES\",\n\t9:   \"TIMESTAMPTZ\",\n\t10:  \"COLLATEDSTRING\",\n\t11:  \"NAME\",\n\t12:  \"OID\",\n\t13:  \"NULL\",\n\t100: \"INT_ARRAY\",\n\t200: \"INT2VECTOR\",\n}\n```\n\n```go\nvar ColumnType_Kind_value = map[string]int32{\n\t\"BOOL\":           0,\n\t\"INT\":            1,\n\t\"FLOAT\":          2,\n\t\"DECIMAL\":        3,\n\t\"DATE\":           4,\n\t\"TIMESTAMP\":      5,\n\t\"INTERVAL\":       6,\n\t\"STRING\":         7,\n\t\"BYTES\":          8,\n\t\"TIMESTAMPTZ\":    9,\n\t\"COLLATEDSTRING\": 10,\n\t\"NAME\":           11,\n\t\"OID\":            12,\n\t\"NULL\":           13,\n\t\"INT_ARRAY\":      100,\n\t\"INT2VECTOR\":     200,\n}\n```\n\n```go\nvar ConstraintValidity_name = map[int32]string{\n\t0: \"Validated\",\n\t1: \"Unvalidated\",\n}\n```\n\n```go\nvar ConstraintValidity_value = map[string]int32{\n\t\"Validated\":   0,\n\t\"Unvalidated\": 1,\n}\n```\n\n```go\nvar DatumEncoding_name = map[int32]string{\n\t0: \"ASCENDING_KEY\",\n\t1: \"DESCENDING_KEY\",\n\t2: \"VALUE\",\n}\n```\n\n```go\nvar DatumEncoding_value = map[string]int32{\n\t\"ASCENDING_KEY\":  0,\n\t\"DESCENDING_KEY\": 1,\n\t\"VALUE\":          2,\n}\n```\n\n```go\nvar DefaultSearchPath = parser.SearchPath{\"pg_catalog\"}\n```\nDefaultSearchPath is the search path used by virgin sessions.\n\n```go\nvar DescriptorMutation_Direction_name = map[int32]string{\n\t0: \"NONE\",\n\t1: \"ADD\",\n\t2: \"DROP\",\n}\n```\n\n```go\nvar DescriptorMutation_Direction_value = map[string]int32{\n\t\"NONE\": 0,\n\t\"ADD\":  1,\n\t\"DROP\": 2,\n}\n```\n\n```go\nvar DescriptorMutation_State_name = map[int32]string{\n\t0: \"UNKNOWN\",\n\t1: \"DELETE_ONLY\",\n\t2: \"WRITE_ONLY\",\n}\n```\n\n```go\nvar DescriptorMutation_State_value = map[string]int32{\n\t\"UNKNOWN\":     0,\n\t\"DELETE_ONLY\": 1,\n\t\"WRITE_ONLY\":  2,\n}\n```\n\n```go\nvar ErrDescriptorNotFound = errors.New(\"descriptor not found\")\n```\nErrDescriptorNotFound is returned by GetTableDescFromID to signal that a descriptor could not be found with the given id.\n\n```go\nvar ErrMissingColumns = errors.New(\"table must contain at least 1 column\")\n```\nErrMissingColumns indicates a table with no columns.\n\n```go\nvar ErrMissingPrimaryKey = errors.New(\"table must contain a primary key\")\n```\nErrMissingPrimaryKey indicates a table with no primary key.\n\n```go\nvar IndexDescriptor_Direction_name = map[int32]string{\n\t0: \"ASC\",\n\t1: \"DESC\",\n}\n```\n\n```go\nvar IndexDescriptor_Direction_value = map[string]int32{\n\t\"ASC\":  0,\n\t\"DESC\": 1,\n}\n```\n\n```go\nvar SystemAllowedPrivileges = map[ID]privilege.Lists{\n\tkeys.SystemDatabaseID:  {privilege.ReadData},\n\tkeys.NamespaceTableID:  {privilege.ReadData},\n\tkeys.DescriptorTableID: {privilege.ReadData},\n\tkeys.UsersTableID:      {privilege.ReadWriteData},\n\tkeys.ZonesTableID:      {privilege.ReadWriteData},\n\n\tkeys.SettingsTableID:   {privilege.ReadWriteData, privilege.ReadData},\n\tkeys.LeaseTableID:      {privilege.ReadWriteData, {privilege.ALL}},\n\tkeys.EventLogTableID:   {privilege.ReadWriteData, {privilege.ALL}},\n\tkeys.RangeEventTableID: {privilege.ReadWriteData, {privilege.ALL}},\n\tkeys.UITableID:         {privilege.ReadWriteData, {privilege.ALL}},\n\n\tkeys.JobsTableID: {privilege.ReadWriteData},\n}\n```\nSystemAllowedPrivileges describes the allowable privilege lists for each system object. The root user must have the privileges of exactly one of those privilege lists. No user may have more privileges than the root user.\n\nSome system objects were created with different privileges in previous versions of the system. These privileges are no longer \"desired\" but must still be \"allowed,\" or this version and the previous version with different privileges will be unable to coexist in the same cluster because one version will think it has invalid table descriptors.\n\nThe currently-desired privileges (i.e., the privileges with which the object will be created in fresh clusters) must be listed first in the mapped value, followed by previously-desirable but still allowable privileges in any order.\n\nIf we supported backwards-incompatible migrations, pruning allowed privileges would require a two-step migration process. First, a new version that allows both must be deployed to all nodes, after which a a migration to upgrade from the old privileges to the new privileges can be run. Only then can a version that removes the old allowed versions be deployed. TODO(benesch): Once we support backwards-incompatible migrations, prune old allowed privileges.\n\n```go\nvar TableDescriptor_State_name = map[int32]string{\n\t0: \"PUBLIC\",\n\t1: \"ADD\",\n\t2: \"DROP\",\n}\n```\n\n```go\nvar TableDescriptor_State_value = map[string]int32{\n\t\"PUBLIC\": 0,\n\t\"ADD\":    1,\n\t\"DROP\":   2,\n}\n```\n\n## Functions\n\n```go\nfunc CheckColumnType(col ColumnDescriptor, typ parser.Type, pmap *parser.PlaceholderInfo) error\n```\nCheckColumnType verifies that a given value is compatible with the type requested by the column. If the value is a placeholder, the type of the placeholder gets populated.\n\n```go\nfunc CheckValueWidth(col ColumnDescriptor, val parser.Datum) error\n```\nCheckValueWidth checks that the width (for strings, byte arrays, and bit string) and scale (for decimals) of the value fits the specified column type. Used by INSERT and UPDATE.\n\n```go\nfunc ColIDtoRowIndexFromCols(cols []ColumnDescriptor) map[ColumnID]int\n```\nColIDtoRowIndexFromCols groups a slice of ColumnDescriptors by their ID field, returning a map from ID to ColumnDescriptor. It assumes there are no duplicate descriptors in the input.\n\n```go\nfunc ColumnsSelectors(cols []ColumnDescriptor) parser.SelectExprs\n```\nColumnsSelectors generates Select expressions for cols.\n\n```go\nfunc CompareDatums(\n\tordering ColumnOrdering, evalCtx *parser.EvalContext, lhs, rhs parser.Datums,\n) int\n```\nCompareDatums compares two datum rows according to a column ordering. Returns:\n\n  - 0 if lhs and rhs are equal on the ordering columns;\n  - less than 0 if lhs comes first;\n  - greater than 0 if rhs comes first.\n\n```go\nfunc ConvertBatchError(tableDesc *TableDescriptor, b *client.Batch) error\n```\nConvertBatchError returns a user friendly constraint violation error.\n\n```go\nfunc DecodeIndexKey(\n\ta *DatumAlloc,\n\tdesc *TableDescriptor,\n\tindexID IndexID,\n\tvals []EncDatum,\n\tcolDirs []encoding.Direction,\n\tkey []byte,\n) ([]byte, bool, error)\n```\nDecodeIndexKey decodes the values that are a part of the specified index key. ValTypes is a slice returned from makeKeyVals. The remaining bytes in the index key are returned which will either be an encoded column ID for the primary key index, the primary key suffix for non-unique secondary indexes or unique secondary indexes containing NULL or empty. If the given descriptor does not match the key, false is returned with no error.\n\n```go\nfunc DecodeKeyVals(\n\ta *DatumAlloc, vals []EncDatum, directions []encoding.Direction, key []byte,\n) ([]byte, error)\n```\nDecodeKeyVals decodes the values that are part of the key. The decoded values are stored in the vals. If this slice is nil, the direction used will default to encoding.Ascending.\n\n```go\nfunc DecodeTableIDIndexID(key []byte) ([]byte, ID, IndexID, error)\n```\nDecodeTableIDIndexID decodes a table id followed by an index id.\n\n```go\nfunc DecodeTableKey(\n\ta *DatumAlloc, valType parser.Type, key []byte, dir encoding.Direction,\n) (parser.Datum, []byte, error)\n```\nDecodeTableKey decodes a table key/value.\n\n```go\nfunc DecodeTableValue(a *DatumAlloc, valType parser.Type, b []byte) (parser.Datum, []byte, error)\n```\nDecodeTableValue decodes a value encoded by EncodeTableValue.\n\n```go\nfunc EncDatumRowToDatums(datums parser.Datums, row EncDatumRow, da *DatumAlloc) error\n```\nEncDatumRowToDatums converts a given EncDatumRow to a Datums.\n\n```go\nfunc EncodeColumns(\n\tcolumnIDs []ColumnID,\n\tdirections directions,\n\tcolMap map[ColumnID]int,\n\tvalues []parser.Datum,\n\tkeyPrefix []byte,\n) (key []byte, containsNull bool, err error)\n```\nEncodeColumns is a version of EncodePartialIndexKey that takes ColumnIDs and directions explicitly. WARNING: unlike EncodePartialIndexKey, EncodeColumns appends directly to keyPrefix.\n\n```go\nfunc EncodeDatum(b []byte, d parser.Datum) ([]byte, error)\n```\nEncodeDatum encodes a datum (order-preserving encoding, suitable for keys).\n\n```go\nfunc EncodeDatums(b []byte, d parser.Datums) ([]byte, error)\n```\nEncodeDatums encodes a Datums (order-preserving).\n\n```go\nfunc EncodeIndexKey(\n\ttableDesc *TableDescriptor,\n\tindex *IndexDescriptor,\n\tcolMap map[ColumnID]int,\n\tvalues []parser.Datum,\n\tkeyPrefix []byte,\n) (key []byte, containsNull bool, err error)\n```\nEncodeIndexKey creates a key by concatenating keyPrefix with the encodings of the columns in the index.\n\nIf a table or index is interleaved, \\`encoding.encodedNullDesc\\` is used in place of the family id (a varint) to signal the next component of the key. An example of one level of interleaving (a parent): /\\\u003cparent\\_table\\_id\u003e/\\\u003cparent\\_index\\_id\u003e/\\\u003cfield\\_1\u003e/\\\u003cfield\\_2\u003e/NullDesc/\\\u003ctable\\_id\u003e/\\\u003cindex\\_id\u003e/\\\u003cfield\\_3\u003e/\\\u003cfamily\u003e\n\nReturns the key and whether any of the encoded values were NULLs.\n\nNote that ExtraColumnIDs are not encoded, so the result isn't always a full index key.\n\n```go\nfunc EncodePartialIndexKey(\n\ttableDesc *TableDescriptor,\n\tindex *IndexDescriptor,\n\tnumCols int,\n\tcolMap map[ColumnID]int,\n\tvalues []parser.Datum,\n\tkeyPrefix []byte,\n) (key []byte, containsNull bool, err error)\n```\nEncodePartialIndexKey encodes a partial index key; only the first numCols of index.ColumnIDs are encoded.\n\n```go\nfunc EncodeSecondaryIndexes(\n\ttableDesc *TableDescriptor,\n\tindexes []IndexDescriptor,\n\tcolMap map[ColumnID]int,\n\tvalues []parser.Datum,\n\tsecondaryIndexEntries []IndexEntry,\n) error\n```\nEncodeSecondaryIndexes encodes key/values for the secondary indexes. colMap maps ColumnIDs to indices in \\`values\\`. secondaryIndexEntries is the return value (passed as a parameter so the caller can reuse between rows) and is expected to be the same length as indexes.\n\n```go\nfunc EncodeTableKey(b []byte, val parser.Datum, dir encoding.Direction) ([]byte, error)\n```\nEncodeTableKey encodes \\`val\\` into \\`b\\` and returns the new buffer. The encoded value is guaranteed to be lexicographically sortable, but not guaranteed to be round-trippable during decoding.\n\n```go\nfunc EncodeTableValue(appendTo []byte, colID ColumnID, val parser.Datum) ([]byte, error)\n```\nEncodeTableValue encodes \\`val\\` into \\`appendTo\\` using DatumEncoding\\_VALUE and returns the new buffer. The encoded value is guaranteed to round trip and decode exactly to its input, but is not guaranteed to be lexicographically sortable.\n\n```go\nfunc ExtractIndexKey(\n\ta *DatumAlloc, tableDesc *TableDescriptor, entry client.KeyValue,\n) (roachpb.Key, error)\n```\nExtractIndexKey constructs the index (primary) key for a row from any index key/value entry, including secondary indexes.\n\nDon't use this function in the scan \"hot path\".\n\n```go\nfunc FixedOffsetTimeZoneToLocation(offset int, origRepr string) *time.Location\n```\nFixedOffsetTimeZoneToLocation creates a time.Location with a set offset and with a name that can be marshalled by crdb between nodes.\n\n```go\nfunc HasCompositeKeyEncoding(kind ColumnType_Kind) bool\n```\nHasCompositeKeyEncoding returns true if key columns of the given kind can have a composite encoding. For such types, it can be decided on a case-by-base basis whether a given Datum requires the composite encoding.\n\n```go\nfunc IsPermanentSchemaChangeError(err error) bool\n```\nIsPermanentSchemaChangeError returns true if the error results in a permanent failure of a schema change.\n\n```go\nfunc IsReservedID(id ID) bool\n```\nIsReservedID returns whether this ID is for any system object.\n\n```go\nfunc IsSystemConfigID(id ID) bool\n```\nIsSystemConfigID returns whether this ID is for a system config object.\n\n```go\nfunc IsUndefinedDatabaseError(err error) bool\n```\nIsUndefinedDatabaseError returns true if the error is for an undefined database.\n\n```go\nfunc IsUndefinedTableError(err error) bool\n```\nIsUndefinedTableError returns true if the error is for an undefined table.\n\n```go\nfunc IsUniquenessConstraintViolationError(err error) bool\n```\nIsUniquenessConstraintViolationError returns true if the error is for a uniqueness constraint violation.\n\n```go\nfunc MakeAllDescsMetadataKey() roachpb.Key\n```\nMakeAllDescsMetadataKey returns the key for all descriptors.\n\n```go\nfunc MakeColumnDefDescs(\n\td *parser.ColumnTableDef, searchPath parser.SearchPath, evalCtx *parser.EvalContext,\n) (*ColumnDescriptor, *IndexDescriptor, error)\n```\nMakeColumnDefDescs creates the column descriptor for a column, as well as the index descriptor if the column is a primary key or unique. The search path is used for name resolution for DEFAULT expressions.\n\n```go\nfunc MakeDefaultExprs(\n\tcols []ColumnDescriptor, parse *parser.Parser, evalCtx *parser.EvalContext,\n) ([]parser.TypedExpr, error)\n```\nMakeDefaultExprs returns a slice of the default expressions for the slice of input column descriptors, or nil if none of the input column descriptors have default expressions.\n\n```go\nfunc MakeDescMetadataKey(descID ID) roachpb.Key\n```\nMakeDescMetadataKey returns the key for the descriptor.\n\n```go\nfunc MakeIndexKeyPrefix(desc *TableDescriptor, indexID IndexID) []byte\n```\nMakeIndexKeyPrefix returns the key prefix used for the index's data. If you need the corresponding Span, prefer desc.IndexSpan(indexID) or desc.PrimaryIndexSpan().\n\n```go\nfunc MakeKeyFromEncDatums(\n\tvalues EncDatumRow,\n\ttableDesc *TableDescriptor,\n\tindex *IndexDescriptor,\n\tkeyPrefix []byte,\n\talloc *DatumAlloc,\n) (roachpb.Key, error)\n```\nMakeKeyFromEncDatums creates a key by concatenating keyPrefix with the encodings of the given EncDatum values. The values correspond to index.ColumnIDs.\n\nIf a table or index is interleaved, \\`encoding.encodedNullDesc\\` is used in place of the family id (a varint) to signal the next component of the key. An example of one level of interleaving (a parent): /\\\u003cparent\\_table\\_id\u003e/\\\u003cparent\\_index\\_id\u003e/\\\u003cfield\\_1\u003e/\\\u003cfield\\_2\u003e/NullDesc/\\\u003ctable\\_id\u003e/\\\u003cindex\\_id\u003e/\\\u003cfield\\_3\u003e/\\\u003cfamily\u003e\n\nNote that ExtraColumnIDs are not encoded, so the result isn't always a full index key.\n\n```go\nfunc MakeNameMetadataKey(parentID ID, name string) roachpb.Key\n```\nMakeNameMetadataKey returns the key for the name. Pass name == \"\" in order to generate the prefix key to use to scan over all of the names for the specified parentID.\n\n```go\nfunc MakePrimaryIndexKey(desc *TableDescriptor, vals ...interface{}) (roachpb.Key, error)\n```\nMakePrimaryIndexKey creates a key prefix that corresponds to a table row (in the primary index); it is intended for tests.\n\nThe value types must match the primary key columns (or a prefix of them); supported types are: - Datum\n\n  - bool (converts to DBool)\n  - int (converts to DInt)\n  - string (converts to DString)\n\n```go\nfunc MakeZoneKey(id ID) roachpb.Key\n```\nMakeZoneKey returns the key for 'id's entry in the system.zones table.\n\n```go\nfunc MarshalColumnValue(col ColumnDescriptor, val parser.Datum) (roachpb.Value, error)\n```\nMarshalColumnValue returns a Go primitive value equivalent of val, of the type expected by col. If val's type is incompatible with col, or if col's type is not yet implemented, an error is returned.\n\n```go\nfunc NewDatabaseAlreadyExistsError(name string) error\n```\nNewDatabaseAlreadyExistsError creates an error for a preexisting database.\n\n```go\nfunc NewDependentObjectError(msg string) error\n```\nNewDependentObjectError creates a dependent object error.\n\n```go\nfunc NewDependentObjectErrorWithHint(msg string, hint string) error\n```\nNewDependentObjectErrorWithHint creates a dependent object error with a hint\n\n```go\nfunc NewInvalidSchemaDefinitionError(err error) error\n```\nNewInvalidSchemaDefinitionError creates an error for an invalid schema definition such as a schema definition that doesn't parse.\n\n```go\nfunc NewNonNullViolationError(columnName string) error\n```\nNewNonNullViolationError creates an error for a violation of a non-NULL constraint.\n\n```go\nfunc NewRangeUnavailableError(\n\trangeID roachpb.RangeID, origErr error, nodeIDs ...roachpb.NodeID,\n) error\n```\nNewRangeUnavailableError creates an unavailable range error.\n\n```go\nfunc NewRelationAlreadyExistsError(name string) error\n```\nNewRelationAlreadyExistsError creates an error for a preexisting relation.\n\n```go\nfunc NewRetryError(cause error) error\n```\nNewRetryError creates an error signifying that the transaction can be retried. It signals to the user that the SQL txn entered the RESTART\\_WAIT state after a serialization error, and that a ROLLBACK TO SAVEPOINT COCKROACH\\_RESTART statement should be issued.\n\n```go\nfunc NewStatementCompletionUnknownError(err *roachpb.AmbiguousResultError) error\n```\nNewStatementCompletionUnknownError creates an error with the corresponding pg code. This is used to inform the client that it's unknown whether a statement succeeded or not. Of particular interest to clients is when this error is returned for a statement outside of a transaction or for a COMMIT/RELEASE SAVEPOINT - there manual inspection may be necessary to check whether the statement/transaction committed. When this is returned for other transactional statements, the transaction has been rolled back (like it is for any errors).\n\nNOTE(andrei): When introducing this error, I haven't verified the exact conditions under which Postgres returns this code, nor its relationship to code CodeTransactionResolutionUnknownError. I couldn't find good documentation on these codes.\n\n```go\nfunc NewSyntaxError(msg string) error\n```\nNewSyntaxError creates a syntax error.\n\n```go\nfunc NewTransactionAbortedError(customMsg string) error\n```\nNewTransactionAbortedError creates an error for trying to run a command in the context of transaction that's already aborted.\n\n```go\nfunc NewTransactionCommittedError() error\n```\nNewTransactionCommittedError creates an error that signals that the SQL txn is in the COMMIT\\_WAIT state and that only a COMMIT statement will be accepted.\n\n```go\nfunc NewUndefinedDatabaseError(name string) error\n```\nNewUndefinedDatabaseError creates an error that represents a missing database.\n\n```go\nfunc NewUndefinedTableError(name string) error\n```\nNewUndefinedTableError creates an error that represents a missing database table.\n\n```go\nfunc NewUndefinedViewError(name string) error\n```\nNewUndefinedViewError creates an error that represents a missing database view.\n\n```go\nfunc NewUniquenessConstraintViolationError(index *IndexDescriptor, vals []parser.Datum) error\n```\nNewUniquenessConstraintViolationError creates an error that represents a violation of a UNIQUE constraint.\n\n```go\nfunc NewWindowingError(in string) error\n```\nNewWindowingError creates a windowing error.\n\n```go\nfunc NewWrongObjectTypeError(name, desiredObjType string) error\n```\nNewWrongObjectTypeError creates a wrong object type error.\n\n```go\nfunc ParseFixedOffsetTimeZone(location string) (offset int, origRepr string, success bool)\n```\nParseFixedOffsetTimeZone takes the string representation of a time.Location created by FixedOffsetTimeZoneToLocation and parses it to the offset and the original representation specified by the user. The bool returned is true if parsing was successful.\n\nThe strings produced by FixedOffsetTimeZoneToLocation look like \"\\\u003cfixedOffsetPrefix\u003e\\\u003coffset\u003e (\\\u003corigRepr\u003e)\".\n\n```go\nfunc PrettyKey(key roachpb.Key, skip int) string\n```\nPrettyKey pretty-prints the specified key, skipping over the first \\`skip\\` fields. The pretty printed key looks like:\n\n\t/Table/\u003ctableID\u003e/\u003cindexID\u003e/...\n\nWe always strip off the /Table prefix and then \\`skip\\` more fields. Note that this assumes that the fields themselves do not contain '/', but that is currently true for the fields we care about stripping (the table and index ID).\n\n```go\nfunc PrettySpan(span roachpb.Span, skip int) string\n```\nPrettySpan returns a human-readable representation of a span.\n\n```go\nfunc PrettySpans(spans []roachpb.Span, skip int) string\n```\nPrettySpans returns a human-readable description of the spans.\n\n```go\nfunc RandCollationLocale(rng *rand.Rand) *string\n```\nRandCollationLocale returns a random element of collationLocales.\n\n```go\nfunc RandDatum(rng *rand.Rand, typ ColumnType, null bool) parser.Datum\n```\nRandDatum generates a random Datum of the given type. If null is true, the datum can be DNull. Note that if typ.Kind is ColumnType\\_NULL, the datum will always be DNull, regardless of the null flag.\n\n```go\nfunc RandEncDatumSlices(rng *rand.Rand, numSets, numValsPerSet int) [][]EncDatum\n```\nRandEncDatumSlices generates EncDatum slices, each slice with values of the same random type.\n\n```go\nfunc RunFilter(filter parser.TypedExpr, evalCtx *parser.EvalContext) (bool, error)\n```\nRunFilter runs a filter expression and returns whether the filter passes.\n\n```go\nfunc SanitizeVarFreeExpr(\n\texpr parser.Expr, expectedType parser.Type, context string, searchPath parser.SearchPath,\n) (parser.TypedExpr, error)\n```\nSanitizeVarFreeExpr verifies that an expression is valid, has the correct type and contains no variable expressions. It returns the type-checked and constant-folded expression.\n\n```go\nfunc SetKVBatchSize(val int64) func()\n```\nSetKVBatchSize changes the kvFetcher batch size, and returns a function that restores it.\n\n```go\nfunc SystemDesiredPrivileges(id ID) privilege.List\n```\nSystemDesiredPrivileges returns the desired privilege list (i.e., the privilege list with which the object should be created with in a fresh cluster) for a given system object ID. This function panics if id does not exist in the SystemAllowedPrivileges map and should only be used in contexts where id is guaranteed to exist.\n\n```go\nfunc TimeZoneStringToLocation(location string) (*time.Location, error)\n```\nTimeZoneStringToLocation transforms a string into a time.Location. It supports the usual locations and also time zones with fixed offsets created by FixedOffsetTimeZoneToLocation().\n\n```go\nfunc UnmarshalColumnValue(\n\ta *DatumAlloc, typ ColumnType, value *roachpb.Value,\n) (parser.Datum, error)\n```\nUnmarshalColumnValue decodes the value from a key-value pair using the type expected by the column. An error is returned if the value's type does not match the column's type.\n\n## Types\n\n```go\ntype ColTypeInfo struct {\n\t// contains filtered or unexported fields\n}\n```\nColTypeInfo is a type that allows multiple representations of column type information (to avoid conversions and allocations).\n\n```go\nfunc ColTypeInfoFromColTypes(colTypes []ColumnType) ColTypeInfo\n```\nColTypeInfoFromColTypes creates a ColTypeInfo from \\[]ColumnType.\n\n```go\nfunc ColTypeInfoFromResCols(resCols ResultColumns) ColTypeInfo\n```\nColTypeInfoFromResCols creates a ColTypeInfo from ResultColumns.\n\n```go\nfunc (ti ColTypeInfo) NumColumns() int\n```\nNumColumns returns the number of columns in the type.\n\n```go\nfunc (ti ColTypeInfo) Type(idx int) parser.Type\n```\nType returns the datum type of the i-th column.\n\n```go\ntype ColumnDescriptor struct {\n\tName     string     `protobuf:\"bytes,1,opt,name=name\" json:\"name\"`\n\tID       ColumnID   `protobuf:\"varint,2,opt,name=id,casttype=ColumnID\" json:\"id\"`\n\tType     ColumnType `protobuf:\"bytes,3,opt,name=type\" json:\"type\"`\n\tNullable bool       `protobuf:\"varint,4,opt,name=nullable\" json:\"nullable\"`\n\t// Default expression to use to populate the column on insert if no\n\t// value is provided.\n\tDefaultExpr *string `protobuf:\"bytes,5,opt,name=default_expr,json=defaultExpr\" json:\"default_expr,omitempty\"`\n\tHidden      bool    `protobuf:\"varint,6,opt,name=hidden\" json:\"hidden\"`\n}\n```\n\n```go\nfunc (*ColumnDescriptor) Descriptor() ([]byte, []int)\n```\n\n```go\nfunc (m *ColumnDescriptor) Marshal() (dAtA []byte, err error)\n```\n\n```go\nfunc (m *ColumnDescriptor) MarshalTo(dAtA []byte) (int, error)\n```\n\n```go\nfunc (*ColumnDescriptor) ProtoMessage()\n```\n\n```go\nfunc (m *ColumnDescriptor) Reset()\n```\n\n```go\nfunc (m *ColumnDescriptor) Size() (n int)\n```\n\n```go\nfunc (m *ColumnDescriptor) String() string\n```\n\n```go\nfunc (m *ColumnDescriptor) Unmarshal(dAtA []byte) error\n```\n\n```go\ntype ColumnFamilyDescriptor struct {\n\tName string   `protobuf:\"bytes,1,opt,name=name\" json:\"name\"`\n\tID   FamilyID `protobuf:\"varint,2,opt,name=id,casttype=FamilyID\" json:\"id\"`\n\t// A list of column names of which the family is comprised. This list\n\t// parallels the column_ids list. If duplicating the storage of the column\n\t// names here proves to be prohibitive, we could clear this field before\n\t// saving and reconstruct it after loading.\n\tColumnNames []string `protobuf:\"bytes,3,rep,name=column_names,json=columnNames\" json:\"column_names,omitempty\"`\n\t// A list of column ids of which the family is comprised. This list parallels\n\t// the column_names list.\n\tColumnIDs []ColumnID `protobuf:\"varint,4,rep,name=column_ids,json=columnIds,casttype=ColumnID\" json:\"column_ids,omitempty\"`\n\t// If nonzero, the column involved in the single column optimization.\n\t//\n\t// Families store colums in a ValueType_TUPLE as repeated \u003ccolid\u003e\u003cdata\u003e\n\t// entries. As a space optimization and for backward compatibility, a single\n\t// column is written without the columnid prefix. Because more columns could\n\t// be added, it would be ambiguous which column was stored when read back in,\n\t// so this field supplies it.\n\tDefaultColumnID ColumnID `protobuf:\"varint,5,opt,name=default_column_id,json=defaultColumnId,casttype=ColumnID\" json:\"default_column_id\"`\n}\n```\nColumnFamilyDescriptor is set of columns stored together in one kv entry.\n\n```go\nfunc (*ColumnFamilyDescriptor) Descriptor() ([]byte, []int)\n```\n\n```go\nfunc (m *ColumnFamilyDescriptor) Marshal() (dAtA []byte, err error)\n```\n\n```go\nfunc (m *ColumnFamilyDescriptor) MarshalTo(dAtA []byte) (int, error)\n```\n\n```go\nfunc (*ColumnFamilyDescriptor) ProtoMessage()\n```\n\n```go\nfunc (m *ColumnFamilyDescriptor) Reset()\n```\n\n```go\nfunc (m *ColumnFamilyDescriptor) Size() (n int)\n```\n\n```go\nfunc (m *ColumnFamilyDescriptor) String() string\n```\n\n```go\nfunc (m *ColumnFamilyDescriptor) Unmarshal(dAtA []byte) error\n```\n\n```go\ntype ColumnID parser.ColumnID\n```\nColumnID is a custom type for ColumnDescriptor IDs.\n\n```go\ntype ColumnOrderInfo struct {\n\tColIdx    int\n\tDirection encoding.Direction\n}\n```\nColumnOrderInfo describes a column (as an index) and a desired order direction.\n\n```go\ntype ColumnOrdering []ColumnOrderInfo\n```\nColumnOrdering is used to describe a desired column ordering. For example,\n\n\t[]ColumnOrderInfo{ {3, true}, {1, false} }\n\nrepresents an ordering first by column 3 (descending), then by column 1 (ascending).\n\n```go\nfunc (a ColumnOrdering) IsPrefixOf(b ColumnOrdering) bool\n```\nIsPrefixOf returns true if the receiver ordering matches a prefix of the given ordering. In this case, rows with an order conforming to b automatically conform to a.\n\n```go\ntype ColumnType struct {\n\tKind ColumnType_Kind `protobuf:\"varint,1,opt,name=kind,enum=cockroach.sql.sqlbase.ColumnType_Kind\" json:\"kind\"`\n\t// BIT, INT, FLOAT, DECIMAL, CHAR and BINARY\n\tWidth int32 `protobuf:\"varint,2,opt,name=width\" json:\"width\"`\n\t// FLOAT and DECIMAL.\n\tPrecision int32 `protobuf:\"varint,3,opt,name=precision\" json:\"precision\"`\n\t// The length of each dimension in the array. A dimension of -1 means that\n\t// no bound was specified for that dimension.\n\tArrayDimensions []int32 `protobuf:\"varint,4,rep,name=array_dimensions,json=arrayDimensions\" json:\"array_dimensions,omitempty\"`\n\t// Collated STRING, CHAR, and VARCHAR\n\tLocale *string `protobuf:\"bytes,5,opt,name=locale\" json:\"locale,omitempty\"`\n}\n```\n\n```go\nfunc DatumTypeToColumnType(ptyp parser.Type) ColumnType\n```\nDatumTypeToColumnType converts a parser Type to a ColumnType.\n\n```go\nfunc RandColumnType(rng *rand.Rand) ColumnType\n```\nRandColumnType returns a random ColumnType\\_Kind value.\n\n```go\nfunc (*ColumnType) Descriptor() ([]byte, []int)\n```\n\n```go\nfunc (m *ColumnType) Marshal() (dAtA []byte, err error)\n```\n\n```go\nfunc (m *ColumnType) MarshalTo(dAtA []byte) (int, error)\n```\n\n```go\nfunc (c *ColumnType) MaxCharacterLength() (int32, bool)\n```\nMaxCharacterLength returns the declared maximum length of characters if the ColumnType is a character or bit string data type. Returns false if the data type is not a character or bit string, or if the string's length is not bounded.\n\n```go\nfunc (c *ColumnType) MaxOctetLength() (int32, bool)\n```\nMaxOctetLength returns the maximum the maximum possible length in octets of a datum if the ColumnType is a character string. Returns false if the data type is not a character string, or if the string's length is not bounded.\n\n```go\nfunc (c *ColumnType) NumericPrecision() (int32, bool)\n```\nNumericPrecision returns the declared or implicit precision of numeric data types. Returns false if the data type is not numeric, or if the precision of the numeric type is not bounded.\n\n```go\nfunc (c *ColumnType) NumericScale() (int32, bool)\n```\nNumericScale returns the declared or implicit precision of exact numeric data types. Returns false if the data type is not an exact numeric, or if the scale of the exact numeric type is not bounded.\n\n```go\nfunc (*ColumnType) ProtoMessage()\n```\n\n```go\nfunc (m *ColumnType) Reset()\n```\n\n```go\nfunc (c *ColumnType) SQLString() string\n```\nSQLString returns the SQL string corresponding to the type.\n\n```go\nfunc (m *ColumnType) Size() (n int)\n```\n\n```go\nfunc (m *ColumnType) String() string\n```\n\n```go\nfunc (c *ColumnType) ToDatumType() parser.Type\n```\nToDatumType converts the ColumnType to the correct type, or nil if there is no correspondence.\n\n```go\nfunc (m *ColumnType) Unmarshal(dAtA []byte) error\n```\n\n```go\ntype ColumnType_Kind int32\n```\nThese mirror the types supported by the sql/parser. See sql/parser/col\\_types.go.\n\n```go\nconst (\n\tColumnType_BOOL           ColumnType_Kind = 0\n\tColumnType_INT            ColumnType_Kind = 1\n\tColumnType_FLOAT          ColumnType_Kind = 2\n\tColumnType_DECIMAL        ColumnType_Kind = 3\n\tColumnType_DATE           ColumnType_Kind = 4\n\tColumnType_TIMESTAMP      ColumnType_Kind = 5\n\tColumnType_INTERVAL       ColumnType_Kind = 6\n\tColumnType_STRING         ColumnType_Kind = 7\n\tColumnType_BYTES          ColumnType_Kind = 8\n\tColumnType_TIMESTAMPTZ    ColumnType_Kind = 9\n\tColumnType_COLLATEDSTRING ColumnType_Kind = 10\n\tColumnType_NAME           ColumnType_Kind = 11\n\tColumnType_OID            ColumnType_Kind = 12\n\t// NULL is not supported as a table column type, however it can be\n\t// transferred through distsql streams.\n\tColumnType_NULL ColumnType_Kind = 13\n\t// Array and vector types.\n\t//\n\t// TODO(cuongdo): Fix this before allowing persistence of array/vector types\n\t// It would be cleaner if when array_dimensions are specified, Kind is\n\t// simply the parameterized type of the array. However, because Kind is used\n\t// to determine type information elsewhere, it isn't possible to take the\n\t// cleaner approach without an extensive refactoring.\n\tColumnType_INT_ARRAY  ColumnType_Kind = 100\n\tColumnType_INT2VECTOR ColumnType_Kind = 200\n)\n```\n\n```go\nfunc (x ColumnType_Kind) Enum() *ColumnType_Kind\n```\n\n```go\nfunc (ColumnType_Kind) EnumDescriptor() ([]byte, []int)\n```\n\n```go\nfunc (x ColumnType_Kind) String() string\n```\n\n```go\nfunc (x *ColumnType_Kind) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype ConstraintDetail struct {\n\tKind        ConstraintType\n\tColumns     []string\n\tDetails     string\n\tUnvalidated bool\n\n\t// Only populated for FK, PK, and Unique Constraints.\n\tIndex *IndexDescriptor\n\n\t// Only populated for FK Constraints.\n\tFK              *ForeignKeyReference\n\tReferencedTable *TableDescriptor\n\tReferencedIndex *IndexDescriptor\n\n\t// Only populated for Check Constraints.\n\tCheckConstraint *TableDescriptor_CheckConstraint\n}\n```\nConstraintDetail describes a constraint.\n\n```go\ntype ConstraintType string\n```\nConstraintType is used to identify the type of a constraint.\n\n```go\nconst (\n\t// ConstraintTypePK identifies a PRIMARY KEY constraint.\n\tConstraintTypePK ConstraintType = \"PRIMARY KEY\"\n\t// ConstraintTypeFK identifies a FOREIGN KEY constraint.\n\tConstraintTypeFK ConstraintType = \"FOREIGN KEY\"\n\t// ConstraintTypeUnique identifies a FOREIGN constraint.\n\tConstraintTypeUnique ConstraintType = \"UNIQUE\"\n\t// ConstraintTypeCheck identifies a CHECK constraint.\n\tConstraintTypeCheck ConstraintType = \"CHECK\"\n)\n```\n\n```go\ntype ConstraintValidity int32\n```\n\n```go\nconst (\n\tConstraintValidity_Validated   ConstraintValidity = 0\n\tConstraintValidity_Unvalidated ConstraintValidity = 1\n)\n```\n\n```go\nfunc (x ConstraintValidity) Enum() *ConstraintValidity\n```\n\n```go\nfunc (ConstraintValidity) EnumDescriptor() ([]byte, []int)\n```\n\n```go\nfunc (x ConstraintValidity) String() string\n```\n\n```go\nfunc (x *ConstraintValidity) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype DatabaseDescriptor struct {\n\tName       string               `protobuf:\"bytes,1,opt,name=name\" json:\"name\"`\n\tID         ID                   `protobuf:\"varint,2,opt,name=id,casttype=ID\" json:\"id\"`\n\tPrivileges *PrivilegeDescriptor `protobuf:\"bytes,3,opt,name=privileges\" json:\"privileges,omitempty\"`\n}\n```\nDatabaseDescriptor represents a namespace (aka database) and is stored in a structured metadata key. The DatabaseDescriptor has a globally-unique ID shared with the TableDescriptor ID. Permissions are applied to all tables in the namespace.\n\n```go\nfunc GetDatabaseDescFromID(\n\tctx context.Context, txn *client.Txn, id ID,\n) (*DatabaseDescriptor, error)\n```\nGetDatabaseDescFromID retrieves the database descriptor for the database ID passed in using an existing txn. Returns an error if the descriptor doesn't exist or if it exists and is not a database.\n\n```go\nfunc (*DatabaseDescriptor) Descriptor() ([]byte, []int)\n```\n\n```go\nfunc (m *DatabaseDescriptor) GetID() ID\n```\n\n```go\nfunc (m *DatabaseDescriptor) GetName() string\n```\n\n```go\nfunc (m *DatabaseDescriptor) GetPrivileges() *PrivilegeDescriptor\n```\n\n```go\nfunc (m *DatabaseDescriptor) Marshal() (dAtA []byte, err error)\n```\n\n```go\nfunc (m *DatabaseDescriptor) MarshalTo(dAtA []byte) (int, error)\n```\n\n```go\nfunc (*DatabaseDescriptor) ProtoMessage()\n```\n\n```go\nfunc (m *DatabaseDescriptor) Reset()\n```\n\n```go\nfunc (desc *DatabaseDescriptor) SetID(id ID)\n```\nSetID implements the DescriptorProto interface.\n\n```go\nfunc (desc *DatabaseDescriptor) SetName(name string)\n```\nSetName implements the DescriptorProto interface.\n\n```go\nfunc (m *DatabaseDescriptor) Size() (n int)\n```\n\n```go\nfunc (m *DatabaseDescriptor) String() string\n```\n\n```go\nfunc (desc *DatabaseDescriptor) TypeName() string\n```\nTypeName returns the plain type of this descriptor.\n\n```go\nfunc (m *DatabaseDescriptor) Unmarshal(dAtA []byte) error\n```\n\n```go\nfunc (desc *DatabaseDescriptor) Validate() error\n```\nValidate validates that the database descriptor is well formed. Checks include validate the database name, and verifying that there is at least one read and write user.\n\n```go\ntype DatumAlloc struct {\n\t// contains filtered or unexported fields\n}\n```\nDatumAlloc provides batch allocation of datum pointers, amortizing the cost of the allocations.\n\n```go\nfunc (a *DatumAlloc) NewDBytes(v parser.DBytes) *parser.DBytes\n```\nNewDBytes allocates a DBytes.\n\n```go\nfunc (a *DatumAlloc) NewDDate(v parser.DDate) *parser.DDate\n```\nNewDDate allocates a DDate.\n\n```go\nfunc (a *DatumAlloc) NewDDecimal(v parser.DDecimal) *parser.DDecimal\n```\nNewDDecimal allocates a DDecimal.\n\n```go\nfunc (a *DatumAlloc) NewDFloat(v parser.DFloat) *parser.DFloat\n```\nNewDFloat allocates a DFloat.\n\n```go\nfunc (a *DatumAlloc) NewDInt(v parser.DInt) *parser.DInt\n```\nNewDInt allocates a DInt.\n\n```go\nfunc (a *DatumAlloc) NewDInterval(v parser.DInterval) *parser.DInterval\n```\nNewDInterval allocates a DInterval.\n\n```go\nfunc (a *DatumAlloc) NewDName(v parser.DString) parser.Datum\n```\nNewDName allocates a DName.\n\n```go\nfunc (a *DatumAlloc) NewDOid(v parser.DOid) parser.Datum\n```\nNewDOid allocates a DOid.\n\n```go\nfunc (a *DatumAlloc) NewDString(v parser.DString) *parser.DString\n```\nNewDString allocates a DString.\n\n```go\nfunc (a *DatumAlloc) NewDTimestamp(v parser.DTimestamp) *parser.DTimestamp\n```\nNewDTimestamp allocates a DTimestamp.\n\n```go\nfunc (a *DatumAlloc) NewDTimestampTZ(v parser.DTimestampTZ) *parser.DTimestampTZ\n```\nNewDTimestampTZ allocates a DTimestampTZ.\n\n```go\ntype DatumEncoding int32\n```\nDatumEncoding identifies the encoding used for an EncDatum.\n\n```go\nconst (\n\t// Indicates that the datum is encoded using the order-preserving encoding\n\t// used for keys (ascending order).\n\tDatumEncoding_ASCENDING_KEY DatumEncoding = 0\n\t// Indicates that the datum is encoded using the order-preserving encoding\n\t// used for keys (descending order).\n\tDatumEncoding_DESCENDING_KEY DatumEncoding = 1\n\t// Indicates that the datum is encoded using the encoding used for values.\n\tDatumEncoding_VALUE DatumEncoding = 2\n)\n```\n\n```go\nfunc RandDatumEncoding(rng *rand.Rand) DatumEncoding\n```\nRandDatumEncoding returns a random DatumEncoding value.\n\n```go\nfunc (x DatumEncoding) Enum() *DatumEncoding\n```\n\n```go\nfunc (DatumEncoding) EnumDescriptor() ([]byte, []int)\n```\n\n```go\nfunc (x DatumEncoding) String() string\n```\n\n```go\nfunc (x *DatumEncoding) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype Descriptor struct {\n\t// Types that are valid to be assigned to Union:\n\t//\t*Descriptor_Table\n\t//\t*Descriptor_Database\n\tUnion isDescriptor_Union `protobuf_oneof:\"union\"`\n}\n```\nDescriptor is a union type holding either a table or database descriptor.\n\n```go\nfunc WrapDescriptor(descriptor DescriptorProto) *Descriptor\n```\nWrapDescriptor fills in a Descriptor.\n\n```go\nfunc (*Descriptor) Descriptor() ([]byte, []int)\n```\n\n```go\nfunc (m *Descriptor) GetDatabase() *DatabaseDescriptor\n```\n\n```go\nfunc (desc *Descriptor) GetID() ID\n```\nGetID returns the ID of the descriptor.\n\n```go\nfunc (desc *Descriptor) GetName() string\n```\nGetName returns the Name of the descriptor.\n\n```go\nfunc (m *Descriptor) GetTable() *TableDescriptor\n```\n\n```go\nfunc (m *Descriptor) GetUnion() isDescriptor_Union\n```\n\n```go\nfunc (m *Descriptor) Marshal() (dAtA []byte, err error)\n```\n\n```go\nfunc (m *Descriptor) MarshalTo(dAtA []byte) (int, error)\n```\n\n```go\nfunc (*Descriptor) ProtoMessage()\n```\n\n```go\nfunc (m *Descriptor) Reset()\n```\n\n```go\nfunc (m *Descriptor) Size() (n int)\n```\n\n```go\nfunc (m *Descriptor) String() string\n```\n\n```go\nfunc (m *Descriptor) Unmarshal(dAtA []byte) error\n```\n\n```go\nfunc (*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{})\n```\nXXX\\_OneofFuncs is for the internal use of the proto package.\n\n```go\ntype DescriptorKey interface {\n\tKey() roachpb.Key\n\tName() string\n}\n```\nDescriptorKey is the interface implemented by both databaseKey and tableKey. It is used to easily get the descriptor key and plain name.\n\n```go\ntype DescriptorMutation struct {\n\t// Types that are valid to be assigned to Descriptor_:\n\t//\t*DescriptorMutation_Column\n\t//\t*DescriptorMutation_Index\n\tDescriptor_ isDescriptorMutation_Descriptor_ `protobuf_oneof:\"descriptor\"`\n\tState       DescriptorMutation_State         `protobuf:\"varint,3,opt,name=state,enum=cockroach.sql.sqlbase.DescriptorMutation_State\" json:\"state\"`\n\tDirection   DescriptorMutation_Direction     `protobuf:\"varint,4,opt,name=direction,enum=cockroach.sql.sqlbase.DescriptorMutation_Direction\" json:\"direction\"`\n\t// The mutation id used to group mutations that should be applied together.\n\t// This is used for situations like creating a unique column, which\n\t// involve adding two mutations: one for the column, and another for the\n\t// unique constraint index.\n\tMutationID MutationID `protobuf:\"varint,5,opt,name=mutation_id,json=mutationId,casttype=MutationID\" json:\"mutation_id\"`\n\t// A schema change can involve running multiple processors backfilling\n\t// or deleting data. They occasionally checkpoint Spans so that the\n\t// processing can resume in the event of a node failure. The spans are\n\t// non-overlapping contiguous areas of the KV space that still need to\n\t// be processed.\n\tResumeSpans []cockroach_roachpb1.Span `protobuf:\"bytes,6,rep,name=resume_spans,json=resumeSpans\" json:\"resume_spans\"`\n}\n```\nA 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.\n\n```go\nfunc (*DescriptorMutation) Descriptor() ([]byte, []int)\n```\n\n```go\nfunc (m *DescriptorMutation) GetColumn() *ColumnDescriptor\n```\n\n```go\nfunc (m *DescriptorMutation) GetDescriptor_() isDescriptorMutation_Descriptor_\n```\n\n```go\nfunc (m *DescriptorMutation) GetIndex() *IndexDescriptor\n```\n\n```go\nfunc (m *DescriptorMutation) Marshal() (dAtA []byte, err error)\n```\n\n```go\nfunc (m *DescriptorMutation) MarshalTo(dAtA []byte) (int, error)\n```\n\n```go\nfunc (*DescriptorMutation) ProtoMessage()\n```\n\n```go\nfunc (m *DescriptorMutation) Reset()\n```\n\n```go\nfunc (m *DescriptorMutation) Size() (n int)\n```\n\n```go\nfunc (m *DescriptorMutation) String() string\n```\n\n```go\nfunc (m *DescriptorMutation) Unmarshal(dAtA []byte) error\n```\n\n```go\nfunc (*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{})\n```\nXXX\\_OneofFuncs is for the internal use of the proto package.\n\n```go\ntype DescriptorMutation_Column struct {\n\tColumn *ColumnDescriptor `protobuf:\"bytes,1,opt,name=column,oneof\"`\n}\n```\n\n```go\nfunc (m *DescriptorMutation_Column) MarshalTo(dAtA []byte) (int, error)\n```\n\n```go\nfunc (m *DescriptorMutation_Column) Size() (n int)\n```\n\n```go\ntype DescriptorMutation_Direction int32\n```\nDirection of mutation.\n\n```go\nconst (\n\t// Not used.\n\tDescriptorMutation_NONE DescriptorMutation_Direction = 0\n\t// Descriptor is being added.\n\tDescriptorMutation_ADD DescriptorMutation_Direction = 1\n\t// Descriptor is being dropped.\n\tDescriptorMutation_DROP DescriptorMutation_Direction = 2\n)\n```\n\n```go\nfunc (x DescriptorMutation_Direction) Enum() *DescriptorMutation_Direction\n```\n\n```go\nfunc (DescriptorMutation_Direction) EnumDescriptor() ([]byte, []int)\n```\n\n```go\nfunc (x DescriptorMutation_Direction) String() string\n```\n\n```go\nfunc (x *DescriptorMutation_Direction) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype DescriptorMutation_Index struct {\n\tIndex *IndexDescriptor `protobuf:\"bytes,2,opt,name=index,oneof\"`\n}\n```\n\n```go\nfunc (m *DescriptorMutation_Index) MarshalTo(dAtA []byte) (int, error)\n```\n\n```go\nfunc (m *DescriptorMutation_Index) Size() (n int)\n```\n\n```go\ntype DescriptorMutation_State int32\n```\nA 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.\n\n```go\nconst (\n\t// Not used.\n\tDescriptorMutation_UNKNOWN DescriptorMutation_State = 0\n\t// Operations can use this invisible descriptor to implicitly\n\t// delete entries.\n\t// Column: A descriptor in this state is invisible to\n\t// INSERT and UPDATE. DELETE must delete a column in this state.\n\t// Index: A descriptor in this state is invisible to an INSERT.\n\t// UPDATE must delete the old value of the index but doesn't write\n\t// the new value. DELETE must delete the index.\n\t//\n\t// When deleting a descriptor, all descriptor related data\n\t// (column or index data) can only be mass deleted once\n\t// all the nodes have transitioned to the DELETE_ONLY state.\n\tDescriptorMutation_DELETE_ONLY DescriptorMutation_State = 1\n\t// Operations can use this invisible descriptor to implicitly\n\t// write and delete entries.\n\t// Column: INSERT will populate this column with the default\n\t// value. UPDATE ignores this descriptor. DELETE must delete\n\t// the column.\n\t// Index: INSERT, UPDATE and DELETE treat this index like any\n\t// other index.\n\t//\n\t// When adding a descriptor, all descriptor related data\n\t// (column default or index data) can only be backfilled once\n\t// all nodes have transitioned into the WRITE_ONLY state.\n\tDescriptorMutation_WRITE_ONLY DescriptorMutation_State = 2\n)\n```\n\n```go\nfunc (x DescriptorMutation_State) Enum() *DescriptorMutation_State\n```\n\n```go\nfunc (DescriptorMutation_State) EnumDescriptor() ([]byte, []int)\n```\n\n```go\nfunc (x DescriptorMutation_State) String() string\n```\n\n```go\nfunc (x *DescriptorMutation_State) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype DescriptorProto interface {\n\tproto.Message\n\tGetPrivileges() *PrivilegeDescriptor\n\tGetID() ID\n\tSetID(ID)\n\tTypeName() string\n\tGetName() string\n\tSetName(string)\n}\n```\nDescriptorProto is the interface implemented by both DatabaseDescriptor and TableDescriptor. TODO(marc): this is getting rather large.\n\n```go\ntype DescriptorStatus int\n```\nDescriptorStatus is the status for a descriptor.\n\n```go\nconst (\n\n\t// DescriptorAbsent for a descriptor that doesn't exist.\n\tDescriptorAbsent DescriptorStatus\n\t// DescriptorIncomplete for a descriptor that is a part of a\n\t// schema change, and is still being processed.\n\tDescriptorIncomplete\n\t// DescriptorActive for a descriptor that is completely active\n\t// for read/write and delete operations.\n\tDescriptorActive\n)\n```\n\n```go\ntype DescriptorVersion uint32\n```\nDescriptorVersion is a custom type for TableDescriptor Versions.\n\n```go\ntype Descriptor_Database struct {\n\tDatabase *DatabaseDescriptor `protobuf:\"bytes,2,opt,name=database,oneof\"`\n}\n```\n\n```go\nfunc (m *Descriptor_Database) MarshalTo(dAtA []byte) (int, error)\n```\n\n```go\nfunc (m *Descriptor_Database) Size() (n int)\n```\n\n```go\ntype Descriptor_Table struct {\n\tTable *TableDescriptor `protobuf:\"bytes,1,opt,name=table,oneof\"`\n}\n```\n\n```go\nfunc (m *Descriptor_Table) MarshalTo(dAtA []byte) (int, error)\n```\n\n```go\nfunc (m *Descriptor_Table) Size() (n int)\n```\n\n```go\ntype EncDatum struct {\n\tType ColumnType\n\n\t// Decoded datum.\n\tDatum parser.Datum\n\t// contains filtered or unexported fields\n}\n```\nEncDatum represents a datum that is \"backed\" by an encoding and/or by a parser.Datum. It allows \"passing through\" a Datum without decoding and reencoding.\n\n```go\nfunc DatumToEncDatum(ctyp ColumnType, d parser.Datum) EncDatum\n```\nDatumToEncDatum initializes an EncDatum with the given Datum.\n\n```go\nfunc EncDatumFromBuffer(typ ColumnType, enc DatumEncoding, buf []byte) (EncDatum, []byte, error)\n```\nEncDatumFromBuffer initializes an EncDatum with an encoding that is possibly followed by other data. Similar to EncDatumFromEncoded, except that this function figures out where the encoding stops and returns a slice for the rest of the buffer.\n\n```go\nfunc EncDatumFromEncoded(typ ColumnType, enc DatumEncoding, encoded []byte) EncDatum\n```\nEncDatumFromEncoded initializes an EncDatum with the given encoded value. The encoded value is stored as a shallow copy, so the caller must make sure the slice is not modified for the lifetime of the EncDatum. SetEncoded wipes the underlying Datum.\n\n```go\nfunc MakeEncodedKeyVals(desc *TableDescriptor, columnIDs []ColumnID) ([]EncDatum, error)\n```\nMakeEncodedKeyVals returns a slice of EncDatums with the correct types for the given columns.\n\n```go\nfunc RandEncDatum(rng *rand.Rand) EncDatum\n```\nRandEncDatum generates a random EncDatum (of a random type).\n\n```go\nfunc RandEncDatumSlice(rng *rand.Rand, numVals int) []EncDatum\n```\nRandEncDatumSlice generates a slice of random EncDatum values of the same random type.\n\n```go\nfunc (ed *EncDatum) Compare(\n\ta *DatumAlloc, evalCtx *parser.EvalContext, rhs *EncDatum,\n) (int, error)\n```\nCompare returns:\n\n\t-1 if the receiver is less than rhs,\n\t0  if the receiver is equal to rhs,\n\t+1 if the receiver is greater than rhs.\n\n```go\nfunc (ed *EncDatum) Encode(a *DatumAlloc, enc DatumEncoding, appendTo []byte) ([]byte, error)\n```\nEncode appends the encoded datum to the given slice using the requested encoding. Note: DatumEncoding\\_VALUE encodings are not unique because they can contain a column ID so they should not be used to test for equality.\n\n```go\nfunc (ed *EncDatum) Encoding() (DatumEncoding, bool)\n```\nEncoding returns the encoding that is already available (the latter indicated by the bool return value).\n\n```go\nfunc (ed *EncDatum) EnsureDecoded(a *DatumAlloc) error\n```\nEnsureDecoded ensures that the Datum field is set (decoding if it is not).\n\n```go\nfunc (ed *EncDatum) IsNull() bool\n```\nIsNull returns true if the EncDatum value is NULL. Equivalent to checking if ed.Datum is DNull after calling EnsureDecoded.\n\n```go\nfunc (ed *EncDatum) IsUnset() bool\n```\nIsUnset returns true if SetEncoded or SetDatum were not called.\n\n```go\nfunc (ed *EncDatum) String() string\n```\n\n```go\nfunc (ed *EncDatum) UnsetDatum()\n```\nUnsetDatum ensures subsequent IsUnset() calls return false.\n\n```go\ntype EncDatumRow []EncDatum\n```\nEncDatumRow is a row of EncDatums.\n\n```go\nfunc (r EncDatumRow) Compare(\n\ta *DatumAlloc, ordering ColumnOrdering, evalCtx *parser.EvalContext, rhs EncDatumRow,\n) (int, error)\n```\nCompare returns the relative ordering of two EncDatumRows according to a ColumnOrdering:\n\n\t-1 if the receiver comes before the rhs in the ordering,\n\t+1 if the receiver comes after the rhs in the ordering,\n\t0 if the relative order does not matter (i.e. the two rows have the same\n\t  values for the columns in the ordering).\n\nNote that a return value of 0 does not (in general) imply that the rows are equal; for example, rows \\[1 1 5] and \\[1 1 6] when compared against ordering {{0, asc}, {1, asc}} (i.e. ordered by first column and then by second column).\n\n```go\nfunc (r EncDatumRow) CompareToDatums(\n\ta *DatumAlloc, ordering ColumnOrdering, evalCtx *parser.EvalContext, rhs parser.Datums,\n) (int, error)\n```\nCompareToDatums is a version of Compare which compares against decoded Datums.\n\n```go\nfunc (r EncDatumRow) String() string\n```\n\n```go\ntype EncDatumRowAlloc struct {\n\t// contains filtered or unexported fields\n}\n```\nEncDatumRowAlloc is a helper that speeds up allocation of EncDatumRows (preferably of the same length).\n\n```go\nfunc (a *EncDatumRowAlloc) AllocRow(cols int) EncDatumRow\n```\nAllocRow allocates an EncDatumRow with the given number of columns.\n\n```go\nfunc (a *EncDatumRowAlloc) CopyRow(row EncDatumRow) EncDatumRow\n```\nCopyRow allocates an EncDatumRow and copies the given row to it.\n\n```go\ntype EncDatumRows []EncDatumRow\n```\nEncDatumRows is a slice of EncDatumRows.\n\n```go\nfunc (r EncDatumRows) String() string\n```\n\n```go\ntype FKCheck int\n```\nFKCheck indicates a kind of FK check (delete, insert, or both).\n\n```go\nconst (\n\t// CheckDeletes checks if rows reference a changed value.\n\tCheckDeletes FKCheck = iota\n\t// CheckInserts checks if a new/changed value references an existing row.\n\tCheckInserts\n\t// CheckUpdates checks all references (CheckDeletes+CheckInserts).\n\tCheckUpdates\n)\n```\n\n```go\ntype FamilyID uint32\n```\nFamilyID is a custom type for ColumnFamilyDescriptor IDs.\n\n```go\ntype FkSpanCollector interface {\n\tCollectSpans() (reads roachpb.Spans, writes roachpb.Spans)\n}\n```\nFkSpanCollector can collect the spans that foreign key validation will touch.\n\n```go\ntype ForeignKeyReference struct {\n\tTable    ID                 `protobuf:\"varint,1,opt,name=table,casttype=ID\" json:\"table\"`\n\tIndex    IndexID            `protobuf:\"varint,2,opt,name=index,casttype=IndexID\" json:\"index\"`\n\tName     string             `protobuf:\"bytes,3,opt,name=name\" json:\"name\"`\n\tValidity ConstraintValidity `protobuf:\"varint,4,opt,name=validity,enum=cockroach.sql.sqlbase.ConstraintValidity\" json:\"validity\"`\n\t// If this FK only uses a prefix of the columns in its index, we record how\n\t// many to avoid spuriously counting the additional cols as used by this FK.\n\tSharedPrefixLen int32 `protobuf:\"varint,5,opt,name=shared_prefix_len,json=sharedPrefixLen\" json:\"shared_prefix_len\"`\n}\n```\n\n```go\nfunc (*ForeignKeyReference) Descriptor() ([]byte, []int)\n```\n\n```go\nfunc (f ForeignKeyReference) IsSet() bool\n```\nIsSet returns whether or not the foreign key actually references a table.\n\n```go\nfunc (m *ForeignKeyReference) Marshal() (dAtA []byte, err error)\n```\n\n```go\nfunc (m *ForeignKeyReference) MarshalTo(dAtA []byte) (int, error)\n```\n\n```go\nfunc (*ForeignKeyReference) ProtoMessage()\n```\n\n```go\nfunc (m *ForeignKeyReference) Reset()\n```\n\n```go\nfunc (m *ForeignKeyReference) Size() (n int)\n```\n\n```go\nfunc (m *ForeignKeyReference) String() string\n```\n\n```go\nfunc (m *ForeignKeyReference) Unmarshal(dAtA []byte) error\n```\n\n```go\ntype FormatVersion uint32\n```\nFormatVersion is a custom type for TableDescriptor versions of the sql to key:value mapping.\n\n```go\nconst (\n\n\t// BaseFormatVersion corresponds to the encoding described in\n\t// https://www.cockroachlabs.com/blog/sql-in-cockroachdb-mapping-table-data-to-key-value-storage/.\n\tBaseFormatVersion FormatVersion\n\t// FamilyFormatVersion corresponds to the encoding described in\n\t// https://github.com/cockroachdb/cockroach/blob/master/docs/RFCS/sql_column_families.md\n\tFamilyFormatVersion\n\t// InterleavedFormatVersion corresponds to the encoding described in\n\t// https://github.com/cockroachdb/cockroach/blob/master/docs/RFCS/sql_interleaved_tables.md\n\tInterleavedFormatVersion\n)\n```\n\n```go\nfunc (i FormatVersion) String() string\n```\n\n```go\ntype ID parser.ID\n```\nID is a custom type for {Database,Table}Descriptor IDs.\n\n```go\ntype IDs []ID\n```\nIDs is a sortable list of IDs.\n\n```go\nfunc (ids IDs) Len() int\n```\n\n```go\nfunc (ids IDs) Less(i, j int) bool\n```\n\n```go\nfunc (ids IDs) Swap(i, j int)\n```\n\n```go\ntype IndexDescriptor struct {\n\tName   string  `protobuf:\"bytes,1,opt,name=name\" json:\"name\"`\n\tID     IndexID `protobuf:\"varint,2,opt,name=id,casttype=IndexID\" json:\"id\"`\n\tUnique bool    `protobuf:\"varint,3,opt,name=unique\" json:\"unique\"`\n\t// An ordered list of column names of which the index is comprised; these\n\t// columns do not include any additional stored columns (which are in\n\t// stored_column_names). This list parallels the column_ids list.\n\t//\n\t// Note: if duplicating the storage of the column names here proves to be\n\t// prohibitive, we could clear this field before saving and reconstruct it\n\t// after loading.\n\tColumnNames []string `protobuf:\"bytes,4,rep,name=column_names,json=columnNames\" json:\"column_names,omitempty\"`\n\t// The sort direction of each column in column_names.\n\tColumnDirections []IndexDescriptor_Direction `protobuf:\"varint,8,rep,name=column_directions,json=columnDirections,enum=cockroach.sql.sqlbase.IndexDescriptor_Direction\" json:\"column_directions,omitempty\"`\n\t// An ordered list of column names which the index stores in addition to the\n\t// columns which are explicitly part of the index (STORING clause). Only used\n\t// for secondary indexes.\n\tStoreColumnNames []string `protobuf:\"bytes,5,rep,name=store_column_names,json=storeColumnNames\" json:\"store_column_names,omitempty\"`\n\t// An ordered list of column IDs of which the index is comprised. This list\n\t// parallels the column_names list and does not include any additional stored\n\t// columns.\n\tColumnIDs []ColumnID `protobuf:\"varint,6,rep,name=column_ids,json=columnIds,casttype=ColumnID\" json:\"column_ids,omitempty\"`\n\t// An ordered list of IDs for the additional columns associated with the\n\t// index:\n\t//  - implicit columns, which are all the primary key columns that are not\n\t//    already part of the index (i.e. PrimaryIndex.column_ids - column_ids).\n\t//  - stored columns (the columns in store_column_names) if this index uses the\n\t//    old STORING encoding (key-encoded data).\n\t//\n\t// Only used for secondary indexes.\n\t// For non-unique indexes, these columns are appended to the key.\n\t// For unique indexes, these columns are stored in the value.\n\t// This distinction exists because we want to be able to insert an entry using\n\t// a single conditional put on the key.\n\tExtraColumnIDs []ColumnID `protobuf:\"varint,7,rep,name=extra_column_ids,json=extraColumnIds,casttype=ColumnID\" json:\"extra_column_ids,omitempty\"`\n\t// An ordered list of column IDs that parallels store_column_names if this\n\t// index uses the new STORING encoding (value-encoded data, always in the KV\n\t// value).\n\tStoreColumnIDs []ColumnID `protobuf:\"varint,14,rep,name=store_column_ids,json=storeColumnIds,casttype=ColumnID\" json:\"store_column_ids,omitempty\"`\n\t// CompositeColumnIDs contains an ordered list of IDs of columns that appear\n\t// in the index and have a composite encoding. Includes IDs from both\n\t// column_ids and extra_column_ids.\n\tCompositeColumnIDs []ColumnID            `protobuf:\"varint,13,rep,name=composite_column_ids,json=compositeColumnIds,casttype=ColumnID\" json:\"composite_column_ids,omitempty\"`\n\tForeignKey         ForeignKeyReference   `protobuf:\"bytes,9,opt,name=foreign_key,json=foreignKey\" json:\"foreign_key\"`\n\tReferencedBy       []ForeignKeyReference `protobuf:\"bytes,10,rep,name=referenced_by,json=referencedBy\" json:\"referenced_by\"`\n\t// Interleave, if it's not the zero value, describes how this index's data is\n\t// interleaved into another index's data.\n\tInterleave InterleaveDescriptor `protobuf:\"bytes,11,opt,name=interleave\" json:\"interleave\"`\n\t// InterleavedBy contains a reference to every table/index that is interleaved\n\t// into this one.\n\tInterleavedBy []ForeignKeyReference `protobuf:\"bytes,12,rep,name=interleaved_by,json=interleavedBy\" json:\"interleaved_by\"`\n}\n```\nIndexDescriptor describes an index (primary or secondary).\n\nSample field values on the following table:\n\n\tCREATE TABLE t (\n\t  k1 INT NOT NULL,   // column ID: 1\n\t  k2 INT NOT NULL,   // column ID: 2\n\t  u INT NULL,        // column ID: 3\n\t  v INT NULL,        // column ID: 4\n\t  w INT NULL,        // column ID: 5\n\t  CONSTRAINT \"primary\" PRIMARY KEY (k1, k2),\n\t  INDEX k1v (k1, v) STORING (w),\n\t  FAMILY \"primary\" (k1, k2, u, v, w)\n\t)\n\nPrimary index:\n\n\tname:                primary\n\tid:                  1\n\tunique:              true\n\tcolumn_names:        k1, k2\n\tcolumn_directions:   ASC, ASC\n\tcolumn_ids:          1, 2   // k1, k2\n\n\\[old STORING encoding] Index k1v (k1, v) STORING (w):\n\n\tname:                k1v\n\tid:                  2\n\tunique:              false\n\tcolumn_names:        k1, v\n\tcolumn_directions:   ASC, ASC\n\tstore_column_names:  w\n\tcolumn_ids:          1, 4   // k1, v\n\textra_column_ids:    2, 5   // k2, w\n\n\\[new STORING encoding] Index k1v (k1, v) STORING (w):\n\n\tname:                k1v\n\tid:                  2\n\tunique:              false\n\tcolumn_names:        k1, v\n\tcolumn_directions:   ASC, ASC\n\tstore_column_names:  w\n\tcolumn_ids:          1, 4   // k1, v\n\textra_column_ids:    2      // k2\n\tstore_column_ids:    5      // w\n\n```go\nfunc (desc *IndexDescriptor) ContainsColumnID(colID ColumnID) bool\n```\nContainsColumnID 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.\n\n```go\nfunc (*IndexDescriptor) Descriptor() ([]byte, []int)\n```\n\n```go\nfunc (desc *IndexDescriptor) FillColumns(elems parser.IndexElemList) error\n```\nFillColumns sets the column names and directions in desc.\n\n```go\nfunc (desc *IndexDescriptor) FullColumnIDs() ([]ColumnID, []encoding.Direction)\n```\nFullColumnIDs 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.\n\n```go\nfunc (desc *IndexDescriptor) HasOldStoredColumns() bool\n```\nHasOldStoredColumns returns whether the index has stored columns in the old format (data encoded the same way as if they were in an implicit column).\n\n```go\nfunc (m *IndexDescriptor) Marshal() (dAtA []byte, err error)\n```\n\n```go\nfunc (m *IndexDescriptor) MarshalTo(dAtA []byte) (int, error)\n```\n\n```go\nfunc (*IndexDescriptor) ProtoMessage()\n```\n\n```go\nfunc (m *IndexDescriptor) Reset()\n```\n\n```go\nfunc (desc *IndexDescriptor) RunOverAllColumns(fn func(id ColumnID) error) error\n```\nRunOverAllColumns applies its argument fn to each of the column IDs in desc. If there is an error, that error is returned immediately.\n\n```go\nfunc (m *IndexDescriptor) Size() (n int)\n```\n\n```go\nfunc (m *IndexDescriptor) String() string\n```\n\n```go\nfunc (m *IndexDescriptor) Unmarshal(dAtA []byte) error\n```\n\n```go\ntype IndexDescriptor_Direction int32\n```\nThe direction of a column in the index.\n\n```go\nconst (\n\tIndexDescriptor_ASC  IndexDescriptor_Direction = 0\n\tIndexDescriptor_DESC IndexDescriptor_Direction = 1\n)\n```\n\n```go\nfunc (x IndexDescriptor_Direction) Enum() *IndexDescriptor_Direction\n```\n\n```go\nfunc (IndexDescriptor_Direction) EnumDescriptor() ([]byte, []int)\n```\n\n```go\nfunc (x IndexDescriptor_Direction) String() string\n```\n\n```go\nfunc (dir IndexDescriptor_Direction) ToEncodingDirection() (encoding.Direction, error)\n```\nToEncodingDirection converts a direction from the proto to an encoding.Direction.\n\n```go\nfunc (x *IndexDescriptor_Direction) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype IndexEntry struct {\n\tKey   roachpb.Key\n\tValue roachpb.Value\n}\n```\nIndexEntry represents an encoded key/value for an index entry.\n\n```go\nfunc EncodeSecondaryIndex(\n\ttableDesc *TableDescriptor,\n\tsecondaryIndex *IndexDescriptor,\n\tcolMap map[ColumnID]int,\n\tvalues []parser.Datum,\n) (IndexEntry, error)\n```\nEncodeSecondaryIndex encodes key/values for a secondary index. colMap maps ColumnIDs to indices in \\`values\\`.\n\n```go\ntype IndexID parser.IndexID\n```\nIndexID is a custom type for IndexDescriptor IDs.\n\n```go\nfunc DecodeIndexKeyPrefix(\n\ta *DatumAlloc, desc *TableDescriptor, key []byte,\n) (indexID IndexID, remaining []byte, err error)\n```\nDecodeIndexKeyPrefix decodes the prefix of an index key and returns the index id and a slice for the rest of the key.\n\nDon't use this function in the scan \"hot path\".\n\n```go\ntype InterleaveDescriptor struct {\n\t// Ancestors contains the nesting of interleaves in the order they appear in\n\t// an encoded key. This means they are always in the far-to-near ancestor\n\t// order (e.g. grand-grand-parent, grand-parent, parent).\n\tAncestors []InterleaveDescriptor_Ancestor `protobuf:\"bytes,1,rep,name=ancestors\" json:\"ancestors\"`\n}\n```\nInterleaveDescriptor represents an index (either primary or secondary) that is interleaved into another table's data.\n\nExample: Table 1 -\u003e /a/b Table 2 -\u003e /a/b/c Table 3 -\u003e /a/b/c/d\n\nThere are two components (table 2 is the parent and table 1 is the grandparent) with shared lengths 2 and 1.\n\n```go\nfunc (*InterleaveDescriptor) Descriptor() ([]byte, []int)\n```\n\n```go\nfunc (m *InterleaveDescriptor) Marshal() (dAtA []byte, err error)\n```\n\n```go\nfunc (m *InterleaveDescriptor) MarshalTo(dAtA []byte) (int, error)\n```\n\n```go\nfunc (*InterleaveDescriptor) ProtoMessage()\n```\n\n```go\nfunc (m *InterleaveDescriptor) Reset()\n```\n\n```go\nfunc (m *InterleaveDescriptor) Size() (n int)\n```\n\n```go\nfunc (m *InterleaveDescriptor) String() string\n```\n\n```go\nfunc (m *InterleaveDescriptor) Unmarshal(dAtA []byte) error\n```\n\n```go\ntype InterleaveDescriptor_Ancestor struct {\n\t// TableID the ID of the table being interleaved into.\n\tTableID ID `protobuf:\"varint,1,opt,name=table_id,json=tableId,casttype=ID\" json:\"table_id\"`\n\t// IndexID is the ID of the parent index being interleaved into.\n\tIndexID IndexID `protobuf:\"varint,2,opt,name=index_id,json=indexId,casttype=IndexID\" json:\"index_id\"`\n\t// SharedPrefixLen is how many fields are shared between a parent and child\n\t// being interleaved, excluding any fields shared between parent and\n\t// grandparent. Thus, the sum of SharedPrefixLens in the components of an\n\t// InterleaveDescriptor is always strictly less than the number of fields\n\t// in the index being interleaved.\n\tSharedPrefixLen uint32 `protobuf:\"varint,3,opt,name=shared_prefix_len,json=sharedPrefixLen\" json:\"shared_prefix_len\"`\n}\n```\n\n```go\nfunc (*InterleaveDescriptor_Ancestor) Descriptor() ([]byte, []int)\n```\n\n```go\nfunc (m *InterleaveDescriptor_Ancestor) Marshal() (dAtA []byte, err error)\n```\n\n```go\nfunc (m *InterleaveDescriptor_Ancestor) MarshalTo(dAtA []byte) (int, error)\n```\n\n```go\nfunc (*InterleaveDescriptor_Ancestor) ProtoMessage()\n```\n\n```go\nfunc (m *InterleaveDescriptor_Ancestor) Reset()\n```\n\n```go\nfunc (m *InterleaveDescriptor_Ancestor) Size() (n int)\n```\n\n```go\nfunc (m *InterleaveDescriptor_Ancestor) String() string\n```\n\n```go\nfunc (m *InterleaveDescriptor_Ancestor) Unmarshal(dAtA []byte) error\n```\n\n```go\ntype MetadataSchema struct {\n\t// contains filtered or unexported fields\n}\n```\nMetadataSchema is used to construct the initial sql schema for a new CockroachDB cluster being bootstrapped. Tables and databases must be installed on the underlying persistent storage before a cockroach store can start running correctly, thus requiring this special initialization.\n\n```go\nfunc MakeMetadataSchema() MetadataSchema\n```\nMakeMetadataSchema constructs a new MetadataSchema value which constructs the \"system\" database.\n\n```go\nfunc (ms *MetadataSchema) AddConfigDescriptor(parentID ID, desc DescriptorProto)\n```\nAddConfigDescriptor adds a new descriptor to the system schema. Used only for SystemConfig tables and databases.\n\n```go\nfunc (ms *MetadataSchema) AddDescriptor(parentID ID, desc DescriptorProto)\n```\nAddDescriptor adds a new non-config descriptor to the system schema.\n\n```go\nfunc (ms MetadataSchema) GetInitialValues() []roachpb.KeyValue\n```\nGetInitialValues returns the set of initial K/V values which should be added to a bootstrapping CockroachDB cluster in order to create the tables contained in the schema.\n\n```go\nfunc (ms MetadataSchema) InitialRangeCount() int\n```\nInitialRangeCount returns the number of ranges that would be installed if this metadata schema were installed on a fresh cluster and nothing else. Most clusters will have additional ranges installed by migrations, so this function should be used when only a lower bound, and not an exact count, is needed. See server.ExpectedInitialRangeCount() for a count that includes migrations.\n\n```go\nfunc (ms MetadataSchema) SystemConfigDescriptorCount() int\n```\nSystemConfigDescriptorCount returns the number of config descriptors that will be created by this schema. This value is needed to automate certain tests.\n\n```go\nfunc (ms MetadataSchema) SystemDescriptorCount() int\n```\nSystemDescriptorCount returns the number of descriptors that will be created by this schema. This value is needed to automate certain tests.\n\n```go\ntype MutationID uint32\n```\nMutationID is custom type for TableDescriptor mutations.\n\n```go\nconst InvalidMutationID MutationID = 0\n```\nInvalidMutationID is the uninitialised mutation id.\n\n```go\ntype PrivilegeDescriptor struct {\n\tUsers []UserPrivileges `protobuf:\"bytes,1,rep,name=users\" json:\"users\"`\n}\n```\nPrivilegeDescriptor describes a list of users and attached privileges. The list should be sorted by user for fast access.\n\n```go\nfunc NewDefaultPrivilegeDescriptor() *PrivilegeDescriptor\n```\nNewDefaultPrivilegeDescriptor returns a privilege descriptor with ALL privileges for the root user.\n\n```go\nfunc NewPrivilegeDescriptor(user string, priv privilege.List) *PrivilegeDescriptor\n```\nNewPrivilegeDescriptor returns a privilege descriptor for the given user with the specified list of privileges.\n\n```go\nfunc (p PrivilegeDescriptor) AnyPrivilege(user string) bool\n```\nAnyPrivilege returns true if 'user' has any privilege on this descriptor.\n\n```go\nfunc (p PrivilegeDescriptor) CheckPrivilege(user string, priv privilege.Kind) bool\n```\nCheckPrivilege returns true if 'user' has 'privilege' on this descriptor.\n\n```go\nfunc (*PrivilegeDescriptor) Descriptor() ([]byte, []int)\n```\n\n```go\nfunc (p *PrivilegeDescriptor) Grant(user string, privList privilege.List)\n```\nGrant 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?\n\n```go\nfunc (m *PrivilegeDescriptor) Marshal() (dAtA []byte, err error)\n```\n\n```go\nfunc (m *PrivilegeDescriptor) MarshalTo(dAtA []byte) (int, error)\n```\n\n```go\nfunc (*PrivilegeDescriptor) ProtoMessage()\n```\n\n```go\nfunc (m *PrivilegeDescriptor) Reset()\n```\n\n```go\nfunc (p *PrivilegeDescriptor) Revoke(user string, privList privilege.List)\n```\nRevoke removes privileges from this descriptor for a given list of users.\n\n```go\nfunc (p PrivilegeDescriptor) Show() []UserPrivilegeString\n```\nShow returns the list of {username, privileges} sorted by username. 'privileges' is a string of comma-separated sorted privilege names.\n\n```go\nfunc (m *PrivilegeDescriptor) Size() (n int)\n```\n\n```go\nfunc (m *PrivilegeDescriptor) String() string\n```\n\n```go\nfunc (m *PrivilegeDescriptor) Unmarshal(dAtA []byte) error\n```\n\n```go\nfunc (p PrivilegeDescriptor) Validate(id ID) error\n```\nValidate is called when writing a database or table 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.\n\n```go\ntype ResultColumn struct {\n\tName string\n\tTyp  parser.Type\n\n\t// If set, this is an implicit column; used internally.\n\tHidden bool\n\n\t// If set, a value won't be produced for this column; used internally.\n\tOmitted bool\n}\n```\nResultColumn contains the name and type of a SQL \"cell\".\n\n```go\ntype ResultColumns []ResultColumn\n```\nResultColumns is the type used throughout the sql module to describe the column types of a table.\n\n```go\nfunc ResultColumnsFromColDescs(colDescs []ColumnDescriptor) ResultColumns\n```\nResultColumnsFromColDescs converts ColumnDescriptors to ResultColumns.\n\n```go\ntype RowContainer struct {\n\t// contains filtered or unexported fields\n}\n```\nRowContainer is a container for rows of Datums which tracks the approximate amount of memory allocated for row data. Rows must be added using AddRow(); once the work is done the Close() method must be called to release the allocated memory.\n\nTODO(knz): this does not currently track the amount of memory used for the outer array of Datums references.\n\n```go\nfunc MakeRowContainer(acc mon.BoundAccount, ti ColTypeInfo, rowCapacity int) RowContainer\n```\nMakeRowContainer is the non-pointer version of NewRowContainer, suitable to avoid unnecessary indirections when RowContainer is already part of an on-heap structure.\n\n```go\nfunc NewRowContainer(acc mon.BoundAccount, ti ColTypeInfo, rowCapacity int) *RowContainer\n```\nNewRowContainer allocates a new row container.\n\nThe acc argument indicates where to register memory allocations by this row container. Should probably be created by Session.makeBoundAccount() or Session.TxnState.makeBoundAccount().\n\nThe rowCapacity argument indicates how many rows are to be expected; it is used to pre-allocate the outer array of row references, in the fashion of Go's capacity argument to the make() function.\n\nNote that we could, but do not (yet), report the size of the row container itself to the monitor in this constructor. This is because the various planNodes are not (yet) equipped to call Close() upon encountering errors in their constructor (all nodes initializing a RowContainer there) and SetLimitHint() (for sortNode which initializes a RowContainer there). This would be rather error-prone to implement consistently and hellishly difficult to test properly.  The trade-off is that very large table schemas or column selections could cause unchecked and potentially dangerous memory growth.\n\n```go\nfunc (c *RowContainer) AddRow(ctx context.Context, row parser.Datums) (parser.Datums, error)\n```\nAddRow attempts to insert a new row in the RowContainer. The row slice is not used directly: the Datum values inside the Datums are copied to internal storage. Returns an error if the allocation was denied by the MemoryMonitor.\n\n```go\nfunc (c *RowContainer) At(i int) parser.Datums\n```\nAt accesses a row at a specific index.\n\n```go\nfunc (c *RowContainer) Clear(ctx context.Context)\n```\nClear resets the container and releases the associated memory. This allows the RowContainer to be reused.\n\n```go\nfunc (c *RowContainer) Close(ctx context.Context)\n```\nClose releases the memory associated with the RowContainer.\n\n```go\nfunc (c *RowContainer) Len() int\n```\nLen reports the number of rows currently held in this RowContainer.\n\n```go\nfunc (c *RowContainer) PopFirst()\n```\nPopFirst discards the first row in the RowContainer.\n\n```go\nfunc (c *RowContainer) Replace(ctx context.Context, i int, newRow parser.Datums) error\n```\nReplace substitutes one row for another. This does query the MemoryMonitor to determine whether the new row fits the allowance.\n\n```go\nfunc (c *RowContainer) Swap(i, j int)\n```\nSwap exchanges two rows. Used for sorting.\n\n```go\ntype RowDeleter struct {\n\tHelper               rowHelper\n\tFetchCols            []ColumnDescriptor\n\tFetchColIDtoRowIndex map[ColumnID]int\n\tFks                  fkDeleteHelper\n\t// contains filtered or unexported fields\n}\n```\nRowDeleter abstracts the key/value operations for deleting table rows.\n\n```go\nfunc MakeRowDeleter(\n\ttxn *client.Txn,\n\ttableDesc *TableDescriptor,\n\tfkTables TableLookupsByID,\n\trequestedCols []ColumnDescriptor,\n\tcheckFKs bool,\n) (RowDeleter, error)\n```\nMakeRowDeleter creates a RowDeleter for the given table.\n\nThe returned RowDeleter contains a FetchCols field that defines the expectation of which values are passed as values to DeleteRow. Any column passed in requestedCols will be included in FetchCols.\n\n```go\nfunc (rd *RowDeleter) DeleteIndexRow(\n\tctx context.Context, b *client.Batch, idx *IndexDescriptor, values []parser.Datum,\n) error\n```\nDeleteIndexRow adds to the batch the kv operations necessary to delete a table row from the given index.\n\n```go\nfunc (rd *RowDeleter) DeleteRow(ctx context.Context, b *client.Batch, values []parser.Datum) error\n```\nDeleteRow adds to the batch the kv operations necessary to delete a table row with the given values.\n\n```go\ntype RowFetcher struct {\n\t// contains filtered or unexported fields\n}\n```\nRowFetcher handles fetching kvs and forming table rows. Usage:\n\n\tvar rf RowFetcher\n\terr := rf.Init(..)\n\t// Handle err\n\terr := rf.StartScan(..)\n\t// Handle err\n\tfor {\n\t   row, err := rf.NextRow()\n\t   // Handle err\n\t   if row == nil {\n\t      // Done\n\t      break\n\t   }\n\t   // Process row\n\t}\n\n```go\nfunc (rf *RowFetcher) GetRangeInfo() []roachpb.RangeInfo\n```\nGetRangeInfo returns information about the ranges where the rows came from. The RangeInfo's are deduped and not ordered.\n\n```go\nfunc (rf *RowFetcher) Init(\n\tdesc *TableDescriptor,\n\tcolIdxMap map[ColumnID]int,\n\tindex *IndexDescriptor,\n\treverse, isSecondaryIndex bool,\n\tcols []ColumnDescriptor,\n\tvalNeededForCol []bool,\n\treturnRangeInfo bool,\n) error\n```\nInit sets up a RowFetcher for a given table and index. If we are using a non-primary index, valNeededForCol can only be true for the columns in the index.\n\n```go\nfunc (rf *RowFetcher) Key() roachpb.Key\n```\nKey returns the next key (the key that follows the last returned row). Key returns nil when there are no more rows.\n\n```go\nfunc (rf *RowFetcher) NextKey(ctx context.Context) (rowDone bool, err error)\n```\nNextKey retrieves the next key/value and sets kv/kvEnd. Returns whether a row has been completed. TODO(andrei): change to return error\n\n```go\nfunc (rf *RowFetcher) NextKeyDebug(\n\tctx context.Context,\n) (prettyKey string, prettyValue string, row EncDatumRow, err error)\n```\nNextKeyDebug processes one key at a time and returns a pretty printed key and value. If we completed a row, the row is returned as well (see nextRow). If there are no more keys, prettyKey is \"\".\n\n```go\nfunc (rf *RowFetcher) NextRow(ctx context.Context) (EncDatumRow, error)\n```\nNextRow processes keys until we complete one row, which is returned as an EncDatumRow. The row contains one value per table column, regardless of the index used; values that are not needed (as per valNeededForCol) are nil. The EncDatumRow should not be modified and is only valid until the next call. When there are no more rows, the EncDatumRow is nil.\n\n```go\nfunc (rf *RowFetcher) NextRowDecoded(ctx context.Context) (parser.Datums, error)\n```\nNextRowDecoded calls NextRow and decodes the EncDatumRow into a Datums. The Datums should not be modified and is only valid until the next call. When there are no more rows, the Datums is nil.\n\n```go\nfunc (rf *RowFetcher) ProcessKV(\n\tkv client.KeyValue, debugStrings bool,\n) (prettyKey string, prettyValue string, err error)\n```\nProcessKV processes the given key/value, setting values in the row accordingly. If debugStrings is true, returns pretty printed key and value information in prettyKey/prettyValue (otherwise they are empty strings).\n\n```go\nfunc (rf *RowFetcher) ReadIndexKey(k roachpb.Key) (remaining []byte, ok bool, err error)\n```\nReadIndexKey decodes an index key for the fetcher's table.\n\n```go\nfunc (rf *RowFetcher) StartScan(\n\tctx context.Context, txn *client.Txn, spans roachpb.Spans, limitBatches bool, limitHint int64,\n) error\n```\nStartScan initializes and starts the key-value scan. Can be used multiple times.\n\n```go\ntype RowInserter struct {\n\tHelper                rowHelper\n\tInsertCols            []ColumnDescriptor\n\tInsertColIDtoRowIndex map[ColumnID]int\n\tFks                   fkInsertHelper\n\t// contains filtered or unexported fields\n}\n```\nRowInserter abstracts the key/value operations for inserting table rows.\n\n```go\nfunc MakeRowInserter(\n\ttxn *client.Txn,\n\ttableDesc *TableDescriptor,\n\tfkTables TableLookupsByID,\n\tinsertCols []ColumnDescriptor,\n\tcheckFKs bool,\n) (RowInserter, error)\n```\nMakeRowInserter creates a RowInserter for the given table.\n\nInsertCols must contain every column in the primary key.\n\n```go\nfunc (ri *RowInserter) InsertRow(\n\tctx context.Context, b puter, values []parser.Datum, ignoreConflicts bool,\n) error\n```\nInsertRow adds to the batch the kv operations necessary to insert a table row with the given values.\n\n```go\ntype RowUpdater struct {\n\tHelper               rowHelper\n\tFetchCols            []ColumnDescriptor\n\tFetchColIDtoRowIndex map[ColumnID]int\n\tUpdateCols           []ColumnDescriptor\n\n\tFks fkUpdateHelper\n\t// contains filtered or unexported fields\n}\n```\nRowUpdater abstracts the key/value operations for updating table rows.\n\n```go\nfunc MakeRowUpdater(\n\ttxn *client.Txn,\n\ttableDesc *TableDescriptor,\n\tfkTables TableLookupsByID,\n\tupdateCols []ColumnDescriptor,\n\trequestedCols []ColumnDescriptor,\n\tupdateType rowUpdaterType,\n) (RowUpdater, error)\n```\nMakeRowUpdater creates a RowUpdater for the given table.\n\nUpdateCols are the columns being updated and correspond to the updateValues that will be passed to UpdateRow.\n\nThe returned RowUpdater contains a FetchCols field that defines the expectation of which values are passed as oldValues to UpdateRow. Any column passed in requestedCols will be included in FetchCols.\n\n```go\nfunc (ru *RowUpdater) IsColumnOnlyUpdate() bool\n```\nIsColumnOnlyUpdate returns true if this RowUpdater is only updating column data (in contrast to updating the primary key or other indexes).\n\n```go\nfunc (ru *RowUpdater) UpdateRow(\n\tctx context.Context, b *client.Batch, oldValues []parser.Datum, updateValues []parser.Datum,\n) ([]parser.Datum, error)\n```\nUpdateRow adds to the batch the kv operations necessary to update a table row with the given values.\n\nThe row corresponding to oldValues is updated with the ones in updateValues. Note that updateValues only contains the ones that are changing.\n\nThe return value is only good until the next call to UpdateRow.\n\n```go\ntype TableDescriptor struct {\n\t// The table name. It should be normalized using sqlbase.NormalizeName()\n\t// before comparing it.\n\tName string `protobuf:\"bytes,1,opt,name=name\" json:\"name\"`\n\tID   ID     `protobuf:\"varint,3,opt,name=id,casttype=ID\" json:\"id\"`\n\t// ID of the parent database.\n\tParentID ID `protobuf:\"varint,4,opt,name=parent_id,json=parentId,casttype=ID\" json:\"parent_id\"`\n\t// Monotonically increasing version of the table descriptor.\n\t//\n\t// Invariants:\n\t// 1. not more than two subsequent versions of the table\n\t// descriptor can be leased. This is to make the system\n\t// easy to reason about, by permiting mutation state\n\t// changes (reflected in the next version), only when the existing\n\t// state (reflected in the current version) is present on all\n\t// outstanding unexpired leases.\n\t// 2. A schema change command (ALTER, RENAME, etc) never directly\n\t// increments the version. This allows the command to execute without\n\t// waiting for the entire cluster to converge to a single version\n\t// preventing weird deadlock situations. For instance, a transaction\n\t// with a schema change command might use a descriptor lease that is\n\t// at version: v - 1, and therefore deadlock when it tries to wait\n\t// for version: v, in the process of incrementing it to v + 1.\n\t// Therefore, a schema change command never increments the version,\n\t// and instead, sets the up_version boolean to notify the schema\n\t// changer execution engine that runs a future transaction to\n\t// increment the version.\n\t//\n\t// The schema change commands must therefore make *safe* modifications\n\t// to the table descriptor, such as scheduling long running schema\n\t// changes through mutations for future execution, or making simple\n\t// schema changes like RENAME that only modify the table descriptor in a\n\t// single transaction.\n\t//\n\t// Multiple schema changes in the same transaction set up_version.\n\t// The actual schema change execution that follows a schema change\n\t// command sees the up_version boolean set, and increments the\n\t// table version after ensuring that there are no unexpired leases\n\t// for version - 1. The schema change execution must increment\n\t// the version before executing future state changes, to ensure\n\t// that the scheduled mutations made by the original commands are\n\t// visible on all leases. Multiple schema change mutations can be\n\t// grouped together on a particular version increment.\n\t//\n\t// If schema change commands are safe to run without incrementing\n\t// the version, why do it later on? We increment the version\n\t// to ensure that all the nodes renew their leases with the new version\n\t// and get to see what the schema change command has done quickly.\n\tVersion DescriptorVersion `protobuf:\"varint,5,opt,name=version,casttype=DescriptorVersion\" json:\"version\"`\n\t// See comment above.\n\tUpVersion bool `protobuf:\"varint,6,opt,name=up_version,json=upVersion\" json:\"up_version\"`\n\t// Last modification time of the table descriptor.\n\tModificationTime cockroach_util_hlc.Timestamp `protobuf:\"bytes,7,opt,name=modification_time,json=modificationTime\" json:\"modification_time\"`\n\tColumns          []ColumnDescriptor           `protobuf:\"bytes,8,rep,name=columns\" json:\"columns\"`\n\t// next_column_id is used to ensure that deleted column ids are not reused.\n\tNextColumnID ColumnID                 `protobuf:\"varint,9,opt,name=next_column_id,json=nextColumnId,casttype=ColumnID\" json:\"next_column_id\"`\n\tFamilies     []ColumnFamilyDescriptor `protobuf:\"bytes,22,rep,name=families\" json:\"families\"`\n\t// next_family_id is used to ensure that deleted family ids are not reused.\n\tNextFamilyID FamilyID        `protobuf:\"varint,23,opt,name=next_family_id,json=nextFamilyId,casttype=FamilyID\" json:\"next_family_id\"`\n\tPrimaryIndex IndexDescriptor `protobuf:\"bytes,10,opt,name=primary_index,json=primaryIndex\" json:\"primary_index\"`\n\t// indexes are all the secondary indexes.\n\tIndexes []IndexDescriptor `protobuf:\"bytes,11,rep,name=indexes\" json:\"indexes\"`\n\t// next_index_id is used to ensure that deleted index ids are not reused.\n\tNextIndexID IndexID              `protobuf:\"varint,12,opt,name=next_index_id,json=nextIndexId,casttype=IndexID\" json:\"next_index_id\"`\n\tPrivileges  *PrivilegeDescriptor `protobuf:\"bytes,13,opt,name=privileges\" json:\"privileges,omitempty\"`\n\t// Columns or indexes being added or deleted in a FIFO order.\n\tMutations []DescriptorMutation               `protobuf:\"bytes,14,rep,name=mutations\" json:\"mutations\"`\n\tLease     *TableDescriptor_SchemaChangeLease `protobuf:\"bytes,15,opt,name=lease\" json:\"lease,omitempty\"`\n\t// An id for the next group of mutations to be applied together.\n\tNextMutationID MutationID `protobuf:\"varint,16,opt,name=next_mutation_id,json=nextMutationId,casttype=MutationID\" json:\"next_mutation_id\"`\n\t// format_version declares which sql to key:value mapping is being used to\n\t// represent the data in this table.\n\tFormatVersion FormatVersion                      `protobuf:\"varint,17,opt,name=format_version,json=formatVersion,casttype=FormatVersion\" json:\"format_version\"`\n\tState         TableDescriptor_State              `protobuf:\"varint,19,opt,name=state,enum=cockroach.sql.sqlbase.TableDescriptor_State\" json:\"state\"`\n\tChecks        []*TableDescriptor_CheckConstraint `protobuf:\"bytes,20,rep,name=checks\" json:\"checks,omitempty\"`\n\t// This array is populated if the descriptor was renamed. If the descriptor is\n\t// renamed multiple times before the schema chage is processed, there will be\n\t// one element for each rename.\n\t// When this is detected in a schema change, the records for the old names are\n\t// deleted and this field is cleared.\n\tRenames []TableDescriptor_RenameInfo `protobuf:\"bytes,21,rep,name=renames\" json:\"renames\"`\n\t// The TableDescriptor is used for views in addition to tables. Views\n\t// use mostly the same fields as tables, but need to track the actual\n\t// query from the view definition as well.\n\t//\n\t// For now we only track a string representation of the query. This prevents\n\t// us from easily supporting things like renames of the dependencies of a\n\t// view. Eventually we'll want to switch to a semantic encoding of the query\n\t// that relies on IDs rather than names so that we can support renames of\n\t// fields relied on by the query, as Postgres does.\n\t//\n\t// Note: The presence of this field is used to determine whether or not\n\t// a TableDescriptor represents a view.\n\tViewQuery string `protobuf:\"bytes,24,opt,name=view_query,json=viewQuery\" json:\"view_query\"`\n\t// The IDs of all relations that this depends on.\n\t// Only ever populated if this descriptor is for a view.\n\tDependsOn []ID `protobuf:\"varint,25,rep,name=dependsOn,casttype=ID\" json:\"dependsOn,omitempty\"`\n\t// All references to this table/view from other views in the system, tracked\n\t// down to the column/index so that we can restrict changes to them while\n\t// they're still being referred to.\n\tDependedOnBy []TableDescriptor_Reference `protobuf:\"bytes,26,rep,name=dependedOnBy\" json:\"dependedOnBy\"`\n}\n```\nA 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.\n\n```go\nfunc GetTableDescFromID(ctx context.Context, txn *client.Txn, id ID) (*TableDescriptor, error)\n```\nGetTableDescFromID retrieves the table descriptor for the table ID passed in using an existing txn. Returns an error if the descriptor doesn't exist or if it exists and is not a table.\n\n```go\nfunc GetTableDescriptor(kvDB *client.DB, database string, table string) *TableDescriptor\n```\nGetTableDescriptor retrieves a table descriptor directly from the KV layer.\n\n```go\nfunc (desc *TableDescriptor) AddColumn(col ColumnDescriptor)\n```\nAddColumn adds a column to the table.\n\n```go\nfunc (desc *TableDescriptor) AddColumnMutation(\n\tc ColumnDescriptor, direction DescriptorMutation_Direction,\n)\n```\nAddColumnMutation adds a column mutation to desc.Mutations.\n\n```go\nfunc (desc *TableDescriptor) AddColumnToFamilyMaybeCreate(\n\tcol string, family string, create bool, ifNotExists bool,\n) error\n```\nAddColumnToFamilyMaybeCreate adds the specified column to the specified family. If it doesn't exist and create is true, creates it. If it does exist adds it unless \"strict\" create (\\`true\\` for create but \\`false\\` for ifNotExists) is specified.\n\nAllocateIDs must be called before the TableDesciptor will be valid.\n\n```go\nfunc (desc *TableDescriptor) AddFamily(fam ColumnFamilyDescriptor)\n```\nAddFamily adds a family to the table.\n\n```go\nfunc (desc *TableDescriptor) AddIndex(idx IndexDescriptor, primary bool) error\n```\nAddIndex adds an index to the table.\n\n```go\nfunc (desc *TableDescriptor) AddIndexMutation(\n\tidx IndexDescriptor, direction DescriptorMutation_Direction,\n)\n```\nAddIndexMutation adds an index mutation to desc.Mutations.\n\n```go\nfunc (desc *TableDescriptor) Adding() bool\n```\nAdding returns true if the table is being added.\n\n```go\nfunc (desc *TableDescriptor) AllIndexSpans() roachpb.Spans\n```\nAllIndexSpans returns the Spans for each index in the table, including those being added in the mutations.\n\n```go\nfunc (desc *TableDescriptor) AllNonDropIndexes() []IndexDescriptor\n```\nAllNonDropIndexes returns all the indexes, including those being added in the mutations.\n\n```go\nfunc (desc *TableDescriptor) AllocateIDs() error\n```\nAllocateIDs allocates column, family, and index ids for any column, family, or index which has an ID of 0.\n\n```go\nfunc (desc TableDescriptor) CheckUniqueConstraints() error\n```\nCheckUniqueConstraints returns a non-nil error if a descriptor contains two constraints with the same name.\n\n```go\nfunc (*TableDescriptor) Descriptor() ([]byte, []int)\n```\n\n```go\nfunc (desc *TableDescriptor) Dropped() bool\n```\nDropped returns true if the table is being dropped.\n\n```go\nfunc (desc *TableDescriptor) FinalizeMutation() (MutationID, error)\n```\nFinalizeMutation returns the id that has been used by mutations appended with addMutation() since the last time this function was called. Future mutations will use a new ID.\n\n```go\nfunc (desc *TableDescriptor) FindActiveColumnByID(id ColumnID) (*ColumnDescriptor, error)\n```\nFindActiveColumnByID finds the active column with specified ID.\n\n```go\nfunc (desc *TableDescriptor) FindActiveColumnByName(name parser.Name) (ColumnDescriptor, error)\n```\nFindActiveColumnByName calls FindActiveColumnByNormalizedName on a normalized argument.\n\n```go\nfunc (desc *TableDescriptor) FindActiveColumnByNormalizedName(\n\tnormName string,\n) (ColumnDescriptor, error)\n```\nFindActiveColumnByNormalizedName finds an active column with the specified normalized name.\n\n```go\nfunc (desc *TableDescriptor) FindActiveColumnsByNames(\n\tnames parser.NameList,\n) ([]ColumnDescriptor, error)\n```\nFindActiveColumnsByNames finds all requested columns (in the requested order) or returns an error.\n\n```go\nfunc (desc *TableDescriptor) FindColumnByID(id ColumnID) (*ColumnDescriptor, error)\n```\nFindColumnByID finds the column with specified ID.\n\n```go\nfunc (desc *TableDescriptor) FindColumnByName(name parser.Name) (DescriptorStatus, int, error)\n```\nFindColumnByName calls FindColumnByNormalizedName with a normalized argument.\n\n```go\nfunc (desc *TableDescriptor) FindColumnByNormalizedName(\n\tnormName string,\n) (DescriptorStatus, int, error)\n```\nFindColumnByNormalizedName finds the column with the specified name. It returns DescriptorStatus for the column, and an index into either the columns (status == DescriptorActive) or mutations (status == DescriptorIncomplete).\n\n```go\nfunc (desc *TableDescriptor) FindFamilyByID(id FamilyID) (*ColumnFamilyDescriptor, error)\n```\nFindFamilyByID finds the family with specified ID.\n\n```go\nfunc (desc *TableDescriptor) FindIndexByID(id IndexID) (*IndexDescriptor, error)\n```\nFindIndexByID finds an index (active or inactive) with the specified ID. Must return a pointer to the IndexDescriptor in the TableDescriptor, so that callers can use returned values to modify the TableDesc.\n\n```go\nfunc (desc *TableDescriptor) FindIndexByName(name parser.Name) (DescriptorStatus, int, error)\n```\nFindIndexByName calls FindIndexByNormalizedName on a normalized argument.\n\n```go\nfunc (desc *TableDescriptor) FindIndexByNormalizedName(\n\tnormName string,\n) (DescriptorStatus, int, error)\n```\nFindIndexByNormalizedName finds the index with the specified name. It returns DescriptorStatus for the index, and an index into either the indexes (status == DescriptorActive) or mutations (status == DescriptorIncomplete).\n\n```go\nfunc (desc *TableDescriptor) ForeachNonDropIndex(f func(*IndexDescriptor) error) error\n```\nForeachNonDropIndex runs a function on all indexes, including those being added in the mutations.\n\n```go\nfunc (m *TableDescriptor) GetChecks() []*TableDescriptor_CheckConstraint\n```\n\n```go\nfunc (m *TableDescriptor) GetColumns() []ColumnDescriptor\n```\n\n```go\nfunc (desc TableDescriptor) GetConstraintInfo(\n\tctx context.Context, txn *client.Txn,\n) (map[string]ConstraintDetail, error)\n```\nGetConstraintInfo returns a summary of all constraints on the table.\n\n```go\nfunc (desc TableDescriptor) GetConstraintInfoWithLookup(\n\ttableLookup tableLookupFn,\n) (map[string]ConstraintDetail, error)\n```\nGetConstraintInfoWithLookup returns a summary of all constraints on the table using the provided function to fetch a TableDescriptor from an ID.\n\n```go\nfunc (m *TableDescriptor) GetDependedOnBy() []TableDescriptor_Reference\n```\n\n```go\nfunc (m *TableDescriptor) GetDependsOn() []ID\n```\n\n```go\nfunc (desc TableDescriptor) GetDescMetadataKey() roachpb.Key\n```\nGetDescMetadataKey returns the descriptor key for the table.\n\n```go\nfunc (m *TableDescriptor) GetFamilies() []ColumnFamilyDescriptor\n```\n\n```go\nfunc (m *TableDescriptor) GetFormatVersion() FormatVersion\n```\n\n```go\nfunc (m *TableDescriptor) GetID() ID\n```\n\n```go\nfunc (m *TableDescriptor) GetIndexes() []IndexDescriptor\n```\n\n```go\nfunc (m *TableDescriptor) GetLease() *TableDescriptor_SchemaChangeLease\n```\n\n```go\nfunc (m *TableDescriptor) GetModificationTime() cockroach_util_hlc.Timestamp\n```\n\n```go\nfunc (m *TableDescriptor) GetMutations() []DescriptorMutation\n```\n\n```go\nfunc (m *TableDescriptor) GetName() string\n```\n\n```go\nfunc (desc TableDescriptor) GetNameMetadataKey() roachpb.Key\n```\nGetNameMetadataKey returns the namespace key for the table.\n\n```go\nfunc (m *TableDescriptor) GetNextColumnID() ColumnID\n```\n\n```go\nfunc (m *TableDescriptor) GetNextFamilyID() FamilyID\n```\n\n```go\nfunc (m *TableDescriptor) GetNextIndexID() IndexID\n```\n\n```go\nfunc (m *TableDescriptor) GetNextMutationID() MutationID\n```\n\n```go\nfunc (m *TableDescriptor) GetParentID() ID\n```\n\n```go\nfunc (m *TableDescriptor) GetPrimaryIndex() IndexDescriptor\n```\n\n```go\nfunc (m *TableDescriptor) GetPrivileges() *PrivilegeDescriptor\n```\n\n```go\nfunc (m *TableDescriptor) GetRenames() []TableDescriptor_RenameInfo\n```\n\n```go\nfunc (m *TableDescriptor) GetState() TableDescriptor_State\n```\n\n```go\nfunc (m *TableDescriptor) GetUpVersion() bool\n```\n\n```go\nfunc (m *TableDescriptor) GetVersion() DescriptorVersion\n```\n\n```go\nfunc (m *TableDescriptor) GetViewQuery() string\n```\n\n```go\nfunc (desc *TableDescriptor) IndexSpan(indexID IndexID) roachpb.Span\n```\nIndexSpan returns the Span that corresponds to an entire index; can be used for a full index scan.\n\n```go\nfunc (desc *TableDescriptor) InvalidateFKConstraints()\n```\nInvalidateFKConstraints sets all FK constraints to un-validated.\n\n```go\nfunc (desc *TableDescriptor) IsEmpty() bool\n```\nIsEmpty checks if the descriptor is uninitialized.\n\n```go\nfunc (desc *TableDescriptor) IsInterleaved() bool\n```\nIsInterleaved returns true if any part of this this table is interleaved with another table's data.\n\n```go\nfunc (desc *TableDescriptor) IsPhysicalTable() bool\n```\nIsPhysicalTable returns true if the TableDescriptor actually describes a physical Table that needs to be stored in the kv layer, as opposed to a different resource like a view or a virtual table. Physical tables have primary keys, column families, and indexes (unlike virtual tables).\n\n```go\nfunc (desc *TableDescriptor) IsTable() bool\n```\nIsTable returns true if the TableDescriptor actually describes a Table resource, as opposed to a different resource (like a View).\n\n```go\nfunc (desc *TableDescriptor) IsView() bool\n```\nIsView returns true if the TableDescriptor actually describes a View resource rather than a Table.\n\n```go\nfunc (desc *TableDescriptor) IsVirtualTable() bool\n```\nIsVirtualTable returns true if the TableDescriptor describes a virtual Table (like the information\\_schema tables) and thus doesn't need to be physically stored.\n\n```go\nfunc (desc *TableDescriptor) KeysPerRow(indexID IndexID) int\n```\nKeysPerRow returns the maximum number of keys used to encode a row for the given index. For secondary indexes, we always only use one, but for primary indexes, we can encode up to one kv per column family.\n\n```go\nfunc (desc *TableDescriptor) MakeMutationComplete(m DescriptorMutation)\n```\nMakeMutationComplete updates the descriptor upon completion of a mutation.\n\n```go\nfunc (m *TableDescriptor) Marshal() (dAtA []byte, err error)\n```\n\n```go\nfunc (m *TableDescriptor) MarshalTo(dAtA []byte) (int, error)\n```\n\n```go\nfunc (desc *TableDescriptor) MaybeUpgradeFormatVersion() bool\n```\nMaybeUpgradeFormatVersion transforms the TableDescriptor to the latest FormatVersion (if it's not already there) and returns true if any changes were made.\n\n```go\nfunc (desc *TableDescriptor) PrimaryIndexSpan() roachpb.Span\n```\nPrimaryIndexSpan returns the Span that corresponds to the entire primary index; can be used for a full table scan.\n\n```go\nfunc (*TableDescriptor) ProtoMessage()\n```\n\n```go\nfunc (desc *TableDescriptor) RemoveColumnFromFamily(colID ColumnID)\n```\nRemoveColumnFromFamily removes a colID from the family it's assigned to.\n\n```go\nfunc (desc *TableDescriptor) RenameColumnNormalized(colID ColumnID, newColName string)\n```\nRenameColumnNormalized updates all references to a column name in indexes and families.\n\n```go\nfunc (desc *TableDescriptor) Renamed() bool\n```\nRenamed returns true if the table is being renamed.\n\n```go\nfunc (m *TableDescriptor) Reset()\n```\n\n```go\nfunc (desc *TableDescriptor) SetID(id ID)\n```\nSetID implements the DescriptorProto interface.\n\n```go\nfunc (desc *TableDescriptor) SetName(name string)\n```\nSetName implements the DescriptorProto interface.\n\n```go\nfunc (desc *TableDescriptor) SetUpVersion() error\n```\nSetUpVersion sets the up\\_version marker on the table descriptor (see the proto\n\n```go\nfunc (m *TableDescriptor) Size() (n int)\n```\n\n```go\nfunc (m *TableDescriptor) String() string\n```\n\n```go\nfunc (desc *TableDescriptor) TableSpan() roachpb.Span\n```\nTableSpan returns the Span that corresponds to the entire table.\n\n```go\nfunc (desc *TableDescriptor) TypeName() string\n```\nTypeName returns the plain type of this descriptor.\n\n```go\nfunc (m *TableDescriptor) Unmarshal(dAtA []byte) error\n```\n\n```go\nfunc (desc *TableDescriptor) Validate(ctx context.Context, txn *client.Txn) error\n```\nValidate validates that the table descriptor is well formed. Checks include both single table and cross table invariants.\n\n```go\nfunc (desc *TableDescriptor) ValidateTable() error\n```\nValidateTable validates that the table descriptor is well formed. Checks include validating the table, column and index names, verifying that column names and index names are unique and verifying that column IDs and index IDs are consistent. Use Validate to validate that cross-table references are correct.\n\n```go\nfunc (desc *TableDescriptor) VisibleColumns() []ColumnDescriptor\n```\nVisibleColumns returns all non hidden columns.\n\n```go\ntype TableDescriptor_CheckConstraint struct {\n\tExpr     string             `protobuf:\"bytes,1,opt,name=expr\" json:\"expr\"`\n\tName     string             `protobuf:\"bytes,2,opt,name=name\" json:\"name\"`\n\tValidity ConstraintValidity `protobuf:\"varint,3,opt,name=validity,enum=cockroach.sql.sqlbase.ConstraintValidity\" json:\"validity\"`\n}\n```\n\n```go\nfunc (*TableDescriptor_CheckConstraint) Descriptor() ([]byte, []int)\n```\n\n```go\nfunc (m *TableDescriptor_CheckConstraint) Marshal() (dAtA []byte, err error)\n```\n\n```go\nfunc (m *TableDescriptor_CheckConstraint) MarshalTo(dAtA []byte) (int, error)\n```\n\n```go\nfunc (*TableDescriptor_CheckConstraint) ProtoMessage()\n```\n\n```go\nfunc (m *TableDescriptor_CheckConstraint) Reset()\n```\n\n```go\nfunc (m *TableDescriptor_CheckConstraint) Size() (n int)\n```\n\n```go\nfunc (m *TableDescriptor_CheckConstraint) String() string\n```\n\n```go\nfunc (m *TableDescriptor_CheckConstraint) Unmarshal(dAtA []byte) error\n```\n\n```go\ntype TableDescriptor_Reference struct {\n\t// The ID of the relation that depends on this one.\n\tID ID `protobuf:\"varint,1,opt,name=id,casttype=ID\" json:\"id\"`\n\t// If applicable, the ID of this table's index that is refenced by the\n\t// dependent relation.\n\tIndexID IndexID `protobuf:\"varint,2,opt,name=index_id,json=indexId,casttype=IndexID\" json:\"index_id\"`\n\t// The IDs of this table's columns that are referenced by the dependent\n\t// relation.\n\tColumnIDs []ColumnID `protobuf:\"varint,3,rep,name=column_ids,json=columnIds,casttype=ColumnID\" json:\"column_ids,omitempty\"`\n}\n```\n\n```go\nfunc (*TableDescriptor_Reference) Descriptor() ([]byte, []int)\n```\n\n```go\nfunc (m *TableDescriptor_Reference) Marshal() (dAtA []byte, err error)\n```\n\n```go\nfunc (m *TableDescriptor_Reference) MarshalTo(dAtA []byte) (int, error)\n```\n\n```go\nfunc (*TableDescriptor_Reference) ProtoMessage()\n```\n\n```go\nfunc (m *TableDescriptor_Reference) Reset()\n```\n\n```go\nfunc (m *TableDescriptor_Reference) Size() (n int)\n```\n\n```go\nfunc (m *TableDescriptor_Reference) String() string\n```\n\n```go\nfunc (m *TableDescriptor_Reference) Unmarshal(dAtA []byte) error\n```\n\n```go\ntype TableDescriptor_RenameInfo struct {\n\t// The database that the table belonged to before the rename (tables can be\n\t// renamed from one db to another).\n\tOldParentID ID     `protobuf:\"varint,1,opt,name=old_parent_id,json=oldParentId,casttype=ID\" json:\"old_parent_id\"`\n\tOldName     string `protobuf:\"bytes,2,opt,name=old_name,json=oldName\" json:\"old_name\"`\n}\n```\n\n```go\nfunc (*TableDescriptor_RenameInfo) Descriptor() ([]byte, []int)\n```\n\n```go\nfunc (m *TableDescriptor_RenameInfo) Marshal() (dAtA []byte, err error)\n```\n\n```go\nfunc (m *TableDescriptor_RenameInfo) MarshalTo(dAtA []byte) (int, error)\n```\n\n```go\nfunc (*TableDescriptor_RenameInfo) ProtoMessage()\n```\n\n```go\nfunc (m *TableDescriptor_RenameInfo) Reset()\n```\n\n```go\nfunc (m *TableDescriptor_RenameInfo) Size() (n int)\n```\n\n```go\nfunc (m *TableDescriptor_RenameInfo) String() string\n```\n\n```go\nfunc (m *TableDescriptor_RenameInfo) Unmarshal(dAtA []byte) error\n```\n\n```go\ntype TableDescriptor_SchemaChangeLease struct {\n\tNodeID 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\"`\n\t// Nanoseconds since the Unix epoch.\n\tExpirationTime int64 `protobuf:\"varint,2,opt,name=expiration_time,json=expirationTime\" json:\"expiration_time\"`\n}\n```\nThe 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.\n\n```go\nfunc (*TableDescriptor_SchemaChangeLease) Descriptor() ([]byte, []int)\n```\n\n```go\nfunc (m *TableDescriptor_SchemaChangeLease) Marshal() (dAtA []byte, err error)\n```\n\n```go\nfunc (m *TableDescriptor_SchemaChangeLease) MarshalTo(dAtA []byte) (int, error)\n```\n\n```go\nfunc (*TableDescriptor_SchemaChangeLease) ProtoMessage()\n```\n\n```go\nfunc (m *TableDescriptor_SchemaChangeLease) Reset()\n```\n\n```go\nfunc (m *TableDescriptor_SchemaChangeLease) Size() (n int)\n```\n\n```go\nfunc (m *TableDescriptor_SchemaChangeLease) String() string\n```\n\n```go\nfunc (m *TableDescriptor_SchemaChangeLease) Unmarshal(dAtA []byte) error\n```\n\n```go\ntype TableDescriptor_State int32\n```\nState is set if this TableDescriptor is in the process of being added or deleted. 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.\n\n```go\nconst (\n\t// Not used.\n\tTableDescriptor_PUBLIC TableDescriptor_State = 0\n\t// Descriptor is being added.\n\tTableDescriptor_ADD TableDescriptor_State = 1\n\t// Descriptor is being dropped.\n\tTableDescriptor_DROP TableDescriptor_State = 2\n)\n```\n\n```go\nfunc (x TableDescriptor_State) Enum() *TableDescriptor_State\n```\n\n```go\nfunc (TableDescriptor_State) EnumDescriptor() ([]byte, []int)\n```\n\n```go\nfunc (x TableDescriptor_State) String() string\n```\n\n```go\nfunc (x *TableDescriptor_State) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype TableLookup struct {\n\tTable    *TableDescriptor\n\tIsAdding bool\n}\n```\nTableLookup is the value type of TableLookupsByID: An optional table descriptor, populated when the table is public/leasable, and an IsAdding flag.\n\n```go\ntype TableLookupsByID map[ID]TableLookup\n```\nTableLookupsByID maps table IDs to looked up descriptors or, for tables that exist but are not yet public/leasable, entries with just the IsAdding flag.\n\n```go\nfunc TablesNeededForFKs(table TableDescriptor, usage FKCheck) TableLookupsByID\n```\nTablesNeededForFKs calculates the IDs of the additional TableDescriptors that will be needed for FK checking delete and/or insert operations on \\`table\\`.\n\nNB: the returned map's values are \\*not\\* set -- higher level calling code, eg in planner, should fill the map's values by acquiring leases. This function is essentially just returning a slice of IDs, but the empty map can be filled in place and reused, avoiding a second allocation.\n\n```go\ntype UserPrivilegeString struct {\n\tUser       string\n\tPrivileges []string\n}\n```\nUserPrivilegeString is a pair of strings describing the privileges for a given user.\n\n```go\nfunc (u UserPrivilegeString) PrivilegeString() string\n```\nPrivilegeString returns a string of comma-separted privilege names.\n\n```go\ntype UserPrivileges struct {\n\tUser string `protobuf:\"bytes,1,opt,name=user\" json:\"user\"`\n\t// privileges is a bitfield of 1\u003c\u003cPrivilege values.\n\tPrivileges uint32 `protobuf:\"varint,2,opt,name=privileges\" json:\"privileges\"`\n}\n```\nUserPrivileges describes the list of privileges available for a given user.\n\n```go\nfunc (*UserPrivileges) Descriptor() ([]byte, []int)\n```\n\n```go\nfunc (m *UserPrivileges) Marshal() (dAtA []byte, err error)\n```\n\n```go\nfunc (m *UserPrivileges) MarshalTo(dAtA []byte) (int, error)\n```\n\n```go\nfunc (*UserPrivileges) ProtoMessage()\n```\n\n```go\nfunc (m *UserPrivileges) Reset()\n```\n\n```go\nfunc (m *UserPrivileges) Size() (n int)\n```\n\n```go\nfunc (m *UserPrivileges) String() string\n```\n\n```go\nfunc (m *UserPrivileges) Unmarshal(dAtA []byte) error\n```\n\n","path":"github.com/spencerkimball/cockroach/pkg/sql/sqlbase","name":"sqlbase","synopsis":"Package sqlbase is a generated protocol buffer package.","isRedistributable":true}
