parser

package
v0.0.0-...-6131656 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ParsedQuery

type ParsedQuery struct {
	QueryType QueryType
	Query     string

	Tpl []*ParsedQueryField // TODO
	Arg []*ParsedQueryField
	Ret []*ParsedQueryField

	// options
	SelectSingle bool
	InsertMulti  bool
}

func (*ParsedQuery) Init

func (t *ParsedQuery) Init(query string)

type ParsedQueryField

type ParsedQueryField struct {
	Name   string
	GoType string
}

func NewField

func NewField(name, goType string) *ParsedQueryField

type Parser

type Parser interface {
	Parse(sql string) (*ParsedQuery, error)
}

type QueryType

type QueryType int8
const (
	QueryTypeSelect QueryType = iota + 1
	QueryTypeInsert
	QueryTypeUpdate
	QueryTypeDelete
)

type Type

type Type struct {
	Type     string `json:"type,omitempty"`
	Prec     int    `json:"prec,omitempty"`
	Scale    int    `json:"scale,omitempty"`
	Nullable bool   `json:"nullable,omitempty"`
	IsArray  bool   `json:"array,omitempty"`
	Unsigned bool   `json:"unsigned,omitempty"`
}

Type holds information for a database type.

func ParseType

func ParseType(typ string) *Type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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