oidext

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package oidext contains oids that are not in `github.com/lib/pq/oid` as they are not shipped by default with postgres. As CRDB does not support extensions, we'll need to automatically assign a few OIDs of our own.

Index

Constants

View Source
const (
	T_geometry   = oid.Oid(90000)
	T__geometry  = oid.Oid(90001)
	T_geography  = oid.Oid(90002)
	T__geography = oid.Oid(90003)
	T_box2d      = oid.Oid(90004)
	T__box2d     = oid.Oid(90005)
)

OIDs in this block are extensions of postgres, thus having no official OID.

View Source
const CockroachPredefinedOIDMax = 100000

CockroachPredefinedOIDMax defines the maximum OID allowed for use by non user defined types. OIDs for user defined types will start at CockroachPrefixedOIDMax and increase as new types are created. User defined type descriptors have a cluster-wide unique stable ID. CockroachPredefinedOIDMax defines the mapping from this stable ID to a type OID. In particular, stable ID + CockroachPredefinedOIDMax = type OID. types.StableTypeIDToOID and types.UserDefinedTypeOIDToID should be used when converting between stable ID's and type OIDs.

Variables

View Source
var ExtensionTypeName = map[oid.Oid]string{
	T_geometry:   "GEOMETRY",
	T__geometry:  "_GEOMETRY",
	T_geography:  "GEOGRAPHY",
	T__geography: "_GEOGRAPHY",
	T_box2d:      "BOX2D",
	T__box2d:     "_BOX2D",
}

ExtensionTypeName returns a mapping from extension oids to their type name.

Functions

func TypeName

func TypeName(o oid.Oid) (string, bool)

TypeName checks the name for a given type by first looking up oid.TypeName before falling back to looking at the oid extension ExtensionTypeName.

Types

This section is empty.

Jump to

Keyboard shortcuts

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