parser

package
v0.41.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2025 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColInfo

type ColInfo struct {
	// Postgres only extension bits
	// ArrType is the underlying data type of the Postgres
	// ARRAY type. See here:
	// https://www.postgresql.org/docs/9.1/static/infoschema-element-types.html
	ArrType   string `json:"arr_type" yaml:"arr_type"`
	UDTName   string `json:"udt_name" yaml:"udt_name"`
	UDTSchema string `json:"udt_schema" yaml:"udt_schema"`
}

type Enum

type Enum struct {
	Schema string
	Name   string
	Type   string
	Values pq.StringArray
}

type IndexExtra

type IndexExtra = struct {
	NullsFirst    []bool   `json:"nulls_first"` // same length as Columns
	NullsDistinct bool     `json:"nulls_not_distinct"`
	Where         string   `json:"where_clause"`
	Include       []string `json:"include"`
}

type Parser

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

func New

func New(db *sql.DB, t tables, sharedSchema string, translator *Translator) *Parser

func (*Parser) ParseFolders added in v0.35.0

func (p *Parser) ParseFolders(ctx context.Context, paths ...string) ([]drivers.QueryFolder, error)

func (*Parser) ParseQueries

func (p *Parser) ParseQueries(ctx context.Context, s string) ([]drivers.Query, error)

func (*Parser) ParseQuery

func (p *Parser) ParseQuery(ctx context.Context, input string) (drivers.Query, error)

type Translator

type Translator struct {
	Enums []Enum
	Types drivers.Types
	// contains filtered or unexported fields
}

func (*Translator) TranslateColumnType

func (t *Translator) TranslateColumnType(c drivers.Column, info ColInfo) drivers.Column

Jump to

Keyboard shortcuts

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