catid

package
v0.23.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package catid is a low-level package exporting ID types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FuncIDToOID

func FuncIDToOID(id DescID) oid.Oid

FuncIDToOID converts a function descriptor ID into a function OID.

func IsOIDUserDefined

func IsOIDUserDefined(oid oid.Oid) bool

IsOIDUserDefined returns true if oid is greater than CockroachPredefinedOIDMax, otherwise false.

func TypeIDToOID

func TypeIDToOID(id DescID) oid.Oid

TypeIDToOID converts a type descriptor ID into a type OID.

Types

type ColumnID

type ColumnID uint32

ColumnID is a custom type for Column IDs.

func (ColumnID) SafeValue

func (ColumnID) SafeValue()

SafeValue implements the redact.SafeValue interface.

type ConstraintID

type ConstraintID uint32

ConstraintID is a custom type for TableDeascriptor constraint IDs.

func (ConstraintID) SafeValue

func (ConstraintID) SafeValue()

SafeValue implements the redact.SafeValue interface.

type DescID

type DescID uint32

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

const InvalidDescID DescID = 0

InvalidDescID is the uninitialised descriptor id.

func UserDefinedOIDToID

func UserDefinedOIDToID(oid oid.Oid) DescID

UserDefinedOIDToID converts the OID of a user-defined type or function to a descriptor ID. Returns zero if the OID is not user-defined.

func (DescID) SafeValue

func (DescID) SafeValue()

SafeValue implements the redact.SafeValue interface.

type FamilyID

type FamilyID uint32

FamilyID is a custom type for ColumnFamilyDescriptor IDs.

func (FamilyID) SafeValue

func (FamilyID) SafeValue()

SafeValue implements the redact.SafeValue interface.

type IndexID

type IndexID uint32

IndexID is a custom type for IndexDescriptor IDs.

func (IndexID) SafeValue

func (IndexID) SafeValue()

SafeValue implements the redact.SafeValue interface.

type IndexSet

type IndexSet struct {
	// contains filtered or unexported fields
}

IndexSet efficiently stores an unordered set of index ids.

func MakeIndexIDSet

func MakeIndexIDSet(vals ...IndexID) IndexSet

MakeIndexIDSet returns a set initialized with the given values.

func (*IndexSet) Add

func (s *IndexSet) Add(indexID IndexID)

Add adds an index to the set. No-op if the index is already in the set.

func (IndexSet) Contains

func (s IndexSet) Contains(indexID IndexID) bool

Contains returns true if the set contains the index.

func (IndexSet) Difference

func (s IndexSet) Difference(other IndexSet) IndexSet

Difference returns the index IDs in s which are not in other.

func (IndexSet) Empty

func (s IndexSet) Empty() bool

Empty returns true if the set is empty.

func (IndexSet) ForEach

func (s IndexSet) ForEach(f func(col IndexID))

ForEach calls a function for each index in the set (in increasing order).

func (IndexSet) Intersection

func (s IndexSet) Intersection(other IndexSet) IndexSet

Intersection returns the intersection between s and other.

func (IndexSet) Len

func (s IndexSet) Len() int

Len returns the number of the indexes in the set.

func (IndexSet) Next

func (s IndexSet) Next(startVal IndexID) (IndexID, bool)

Next returns the first value in the set which is >= startVal. If there is no value, the second return value is false.

func (IndexSet) Ordered

func (s IndexSet) Ordered() []IndexID

Ordered returns a slice with all the IndexIDs in the set, in increasing order.

func (IndexSet) String

func (s IndexSet) String() string

String returns a list representation of elements. Sequential runs of positive numbers are shown as ranges. For example, for the set {1, 2, 3 5, 6, 10}, the output is "(1-3,5,6,10)".

func (IndexSet) SubsetOf

func (s IndexSet) SubsetOf(other IndexSet) bool

SubsetOf returns true if s is a subset of other.

func (*IndexSet) UnionWith

func (s *IndexSet) UnionWith(rhs IndexSet)

UnionWith adds all the indexes from rhs to this set.

type PGAttributeNum

type PGAttributeNum uint32

PGAttributeNum is a custom type for Column's logical order.

func (PGAttributeNum) SafeValue

func (PGAttributeNum) SafeValue()

SafeValue implements the redact.SafeValue interface.

type RoleID

type RoleID uint32

RoleID is a custom type for a role id.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL