cockroachdb

package
v1.13.7 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCatalog

func NewCatalog() *catalog.Catalog

NewCatalog returns a CockroachDB-specific catalog. CockroachDB uses the "public" schema by default and is largely PostgreSQL-compatible, but the type vocabulary (STRING, INT8, BYTES, ...) and built-in functions are seeded here independently so the engine can diverge from PostgreSQL as needed.

func NewIdentifier

func NewIdentifier(t string) *ast.String

NewIdentifier builds an ast.String suitable for use inside a ColumnRef or Funcname list.

Types

type Parser

type Parser struct{}

func NewParser

func NewParser() *Parser

func (*Parser) Cast

func (p *Parser) Cast(arg, typeName string) string

Cast returns a type cast expression using PostgreSQL's expr::type syntax.

func (*Parser) CommentSyntax

func (p *Parser) CommentSyntax() source.CommentSyntax

https://www.cockroachlabs.com/docs/stable/comments — CockroachDB follows PostgreSQL comment syntax.

func (*Parser) IsReservedKeyword

func (p *Parser) IsReservedKeyword(s string) bool

IsReservedKeyword reports whether s is a fully-reserved CockroachDB keyword. CockroachDB's lexer classifies keywords into categories; category "R" marks the reserved set (keywords that cannot be used as a bare identifier).

func (*Parser) NamedParam

func (p *Parser) NamedParam(name string) string

NamedParam returns the named parameter placeholder for the given name.

func (*Parser) Param

func (p *Parser) Param(n int) string

Param returns the parameter placeholder for the given number ($1, $2, ...).

func (*Parser) Parse

func (p *Parser) Parse(r io.Reader) ([]ast.Statement, error)

func (*Parser) QuoteIdent

func (p *Parser) QuoteIdent(s string) string

QuoteIdent returns a quoted identifier if it needs quoting.

func (*Parser) TypeName

func (p *Parser) TypeName(ns, name string) string

TypeName returns the SQL type name for the given namespace and name.

Jump to

Keyboard shortcuts

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