pure

package
v0.16.0-rc8 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

README

pure

This folder contains an ad-hoc parser for CREATE SOURCE for use until SQL native library bindings are stable.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Boolean

type Boolean bool

func (*Boolean) Capture

func (b *Boolean) Capture(values []string) error

type CreateSource

type CreateSource struct {
	Name string `parser:"'CREATE' 'SOURCE' @Ident"`
	With With   `parser:"'WITH' (('(' @@ ')')|@@)"`
}

type Property

type Property struct {
	Key   string `parser:"(@Ident | @String)"`
	Value Value  `parser:"'=' @@"`
}

type Stmt

type Stmt struct {
	CreateSource *CreateSource `parser:"@@"`
}

func Parse

func Parse(sql string) (*Stmt, error)

type Value

type Value struct {
	Number  *float64 `parser:"( @Number"`
	String  *string  `parser:"| @String"`
	Boolean *Boolean `parser:"| @('TRUE' | 'FALSE')"`
	Null    bool     `parser:"| @'NULL' )"`
}

type With

type With struct {
	Properties []*Property `parser:"(@@ ','?)+"`
}

Jump to

Keyboard shortcuts

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