parse

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidName = errors.NewKind("the spatial reference system name can't be an empty string or start or end with whitespace")
View Source
var ErrInvalidOrgName = errors.NewKind("the organization name can't be an empty string or start or end with whitespace")
View Source
var ErrMissingMandatoryAttribute = errors.NewKind("missing mandatory attribute %s")
View Source
var (
	ErrPrimaryKeyOnNullField = errors.NewKind("All parts of PRIMARY KEY must be NOT NULL")
)

Functions

func ConvertConstraintsDefs added in v0.16.0

func ConvertConstraintsDefs(ctx *sql.Context, tname sqlparser.TableName, spec *sqlparser.TableSpec) (fks []*sql.ForeignKeyConstraint, checks []*sql.CheckConstraint, err error)

func ConvertIndexDefs added in v0.16.0

func ConvertIndexDefs(ctx *sql.Context, spec *sqlparser.TableSpec) (idxDefs []*plan.IndexDefinition, err error)

func ExprToExpression added in v0.9.0

func ExprToExpression(ctx *sql.Context, e sqlparser.Expr) (sql.Expression, error)

func ExpressionToColumnDefaultValue

func ExpressionToColumnDefaultValue(_ *sql.Context, inputExpr sql.Expression, isLiteral, isParenthesized bool) (*sql.ColumnDefaultValue, error)

ExpressionToColumnDefaultValue takes in an Expression and returns the equivalent ColumnDefaultValue if the expression is valid for a default value. If the expression represents a literal (and not an expression that returns a literal, so "5" rather than "(5)"), then the parameter "isLiteral" should be true.

func MustStringToColumnDefaultValue

func MustStringToColumnDefaultValue(ctx *sql.Context, exprStr string, outType sql.Type, nullable bool) *sql.ColumnDefaultValue

MustStringToColumnDefaultValue is used for creating default values on tables that do not go through the analyzer. Does not handle function nor column references.

func NewFrame added in v0.12.0

func NewFrame(ctx *sql.Context, f *ast.Frame) (sql.WindowFrame, error)

func Parse

func Parse(ctx *sql.Context, query string) (sql.Node, error)

Parse parses the given SQL sentence and returns the corresponding node.

func ParseColumnTypeString added in v0.11.0

func ParseColumnTypeString(ctx *sql.Context, columnType string) (sql.Type, error)

ParseColumnTypeString will return a SQL type for the given string that represents a column type. For example, giving the string `VARCHAR(255)` will return the string SQL type with the internal type set to Varchar and the length set to 255 with the default collation.

func ParseOne added in v0.12.0

func ParseOne(ctx *sql.Context, query string) (sql.Node, string, string, error)

func StringToColumnDefaultValue

func StringToColumnDefaultValue(ctx *sql.Context, exprStr string) (*sql.ColumnDefaultValue, error)

StringToColumnDefaultValue takes in a string representing a default value and returns the equivalent Expression.

func TableSpecToSchema

func TableSpecToSchema(ctx *sql.Context, tableSpec *sqlparser.TableSpec, forceInvalidCollation bool) (sql.PrimaryKeySchema, sql.CollationID, error)

TableSpecToSchema creates a sql.Schema from a parsed TableSpec

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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