clickhouse

package
v0.0.0-...-3266b2f Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCatalog

func NewCatalog() *catalog.Catalog

func NewIdentifier

func NewIdentifier(t string) *ast.String

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. ClickHouse uses CAST(expr AS type) syntax, same as MySQL.

func (*Parser) NamedParam

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

NamedParam returns the named parameter placeholder for the given name. ClickHouse uses {name:Type} syntax for named parameters.

func (*Parser) Param

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

Param returns the parameter placeholder for the given number. ClickHouse uses {name:Type} for named parameters, but for positional parameters we use ? which is supported by the clickhouse-go driver.

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. ClickHouse uses backticks or double quotes for quoting identifiers.

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