Documentation
¶
Index ¶
- func ParseTableName(node ast.Node) (*ast.TableName, error)
- func ParseTypeName(node ast.Node) (*ast.TypeName, error)
- type Column
- type Compiler
- func (c *Compiler) Catalog() *catalog.Catalog
- func (c *Compiler) Close(ctx context.Context)
- func (c *Compiler) OutputColumns(stmt ast.Node) ([]*catalog.Column, error)
- func (c *Compiler) ParseCatalog(schema []string) error
- func (c *Compiler) ParseQueries(queries []string, o opts.Parser) error
- func (c *Compiler) Result() *Result
- type Function
- type Option
- type Parameter
- type Parser
- type Query
- type QueryCatalog
- type Relation
- type Result
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Column ¶
type Column struct {
Name string
OriginalName string
DataType string
NotNull bool
Unsigned bool
IsArray bool
ArrayDims int
Comment string
Length *int
IsNamedParam bool
IsFuncCall bool
// XXX: Figure out what PostgreSQL calls `foo.id`
Scope string
Table *ast.TableName
TableAlias string
Type *ast.TypeName
EmbedTable *ast.TableName
// TypeExpr is the type as the analysis core wrote it, with the
// arguments and nesting DataType and IsArray flatten away. It is unset
// on the legacy path.
TypeExpr *core.TypeExpr
IsSqlcSlice bool // is this sqlc.slice()
// contains filtered or unexported fields
}
type Compiler ¶
type Compiler struct {
// contains filtered or unexported fields
}
func NewCompiler ¶
func (*Compiler) OutputColumns ¶
OutputColumns determines which columns a statement will output
func (*Compiler) ParseCatalog ¶
func (*Compiler) ParseQueries ¶
type Option ¶
type Option func(*Compiler)
Option configures a Compiler.
func WithCoreAnalysis ¶
func WithCoreAnalysis() Option
WithCoreAnalysis analyzes queries with the core catalog and analyzer rather than each engine's own analysis path. ClickHouse and GoogleSQL always do; this opts the remaining engines in.
type Parser ¶
type Parser interface {
Parse(io.Reader) ([]ast.Statement, error)
CommentSyntax() source.CommentSyntax
IsReservedKeyword(string) bool
}
TODO: Rename this interface Engine
type QueryCatalog ¶
type QueryCatalog struct {
// contains filtered or unexported fields
}
type Relation ¶
func ParseRelationString ¶
Click to show internal directories.
Click to hide internal directories.