Documentation
¶
Index ¶
- func NewCatalog() *catalog.Catalog
- func NewIdentifier(t string) *ast.String
- type Parser
- func (p *Parser) Cast(arg, typeName string) string
- func (p *Parser) CommentSyntax() source.CommentSyntax
- func (p *Parser) IsReservedKeyword(s string) bool
- func (p *Parser) NamedParam(name string) string
- func (p *Parser) Param(n int) string
- func (p *Parser) Parse(r io.Reader) ([]ast.Statement, error)
- func (p *Parser) QuoteIdent(s string) string
- func (p *Parser) TypeName(ns, name string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCatalog ¶
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 ¶
NewIdentifier builds an ast.String suitable for use inside a ColumnRef or Funcname list.
Types ¶
type Parser ¶
type Parser struct{}
func (*Parser) CommentSyntax ¶
func (p *Parser) CommentSyntax() source.CommentSyntax
https://www.cockroachlabs.com/docs/stable/comments — CockroachDB follows PostgreSQL comment syntax.
func (*Parser) IsReservedKeyword ¶
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 ¶
NamedParam returns the named parameter placeholder for the given name.
func (*Parser) QuoteIdent ¶
QuoteIdent returns a quoted identifier if it needs quoting.