compiler

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2020 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedStatementType = errors.New("parseQuery: unsupported statement type")

Functions

This section is empty.

Types

type BuildResult added in v1.4.0

type BuildResult struct {
	// contains filtered or unexported fields
}

func (*BuildResult) Enums added in v1.4.0

func (r *BuildResult) Enums(settings config.CombinedSettings) []golang.Enum

func (*BuildResult) GoQueries added in v1.4.0

func (r *BuildResult) GoQueries(settings config.CombinedSettings) []golang.Query

func (*BuildResult) Structs added in v1.4.0

func (r *BuildResult) Structs(settings config.CombinedSettings) []golang.Struct

type Column added in v1.4.0

type Column struct {
	Name     string
	DataType string
	NotNull  bool
	IsArray  bool
	Comment  string

	// XXX: Figure out what PostgreSQL calls `foo.id`
	Scope string
	Table *ast.TableName
	Type  *ast.TypeName
}

type Engine added in v1.4.0

type Engine struct {
	// contains filtered or unexported fields
}

The Engine type only exists as a compatibility shim between the old dinosql package and the new compiler package.

func NewEngine added in v1.4.0

func NewEngine(conf config.SQL, combo config.CombinedSettings) *Engine

func (*Engine) ParseCatalog added in v1.4.0

func (e *Engine) ParseCatalog(schema []string) error

func (*Engine) ParseQueries added in v1.4.0

func (e *Engine) ParseQueries(queries []string, opts dinosql.ParserOpts) error

func (*Engine) Result added in v1.4.0

func (e *Engine) Result() golang.Generateable

type Parameter added in v1.4.0

type Parameter struct {
	Number int
	Column *Column
}

type Parser added in v1.4.0

type Parser interface {
	Parse(io.Reader) ([]ast.Statement, error)
	CommentSyntax() metadata.CommentSyntax
}

type Query added in v1.4.0

type Query struct {
	SQL      string
	Name     string
	Cmd      string // TODO: Pick a better name. One of: one, many, exec, execrows
	Columns  []*Column
	Params   []Parameter
	Comments []string

	// XXX: Hack
	Filename string
}

type QueryCatalog added in v1.4.0

type QueryCatalog struct {
	// contains filtered or unexported fields
}

func (QueryCatalog) GetTable added in v1.4.0

func (qc QueryCatalog) GetTable(rel *ast.TableName) (*Table, error)

type Result

type Result struct {
	Catalog *catalog.Catalog
	Queries []*Query
}

func (*Result) Enums

func (r *Result) Enums(settings config.CombinedSettings) []golang.Enum

func (*Result) GoQueries

func (r *Result) GoQueries(settings config.CombinedSettings) []golang.Query

func (*Result) Structs

func (r *Result) Structs(settings config.CombinedSettings) []golang.Struct

type Table added in v1.4.0

type Table struct {
	Rel     *ast.TableName
	Columns []*Column
}

Jump to

Keyboard shortcuts

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