stage1

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package stage1. check and init, we cannot support all features, we will try to remove these unsupported features. For features that cannot be removed, we will throw errors.

1. remove aggregate functions(and GROUP BY).

2. remove window functions.

3. remove LEFT|RIGHT JOIN

4. remove Limit

5. remove uncertain functions

Note that:

(1) we only support SELECT statement.

(2) make sure your sql has no side-effects, such as assign operations, SELECT into.

(3) The transformed sql may fail to execute.

How to use: see Init, InitAndExec

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InitResult

type InitResult struct {
	InitSql    string
	Err        error
	ExecResult *connector.Result
}

func Init

func Init(sql string) *InitResult

Init: for the input sql, remove aggregate functions(and GROUP BY), window functions, LEFT|RIGHT JOIN, LIMIT, uncertain functions.

Note that:

(1) we only support SELECT statement.

(2) make sure your sql has no side-effects, such as assign operations, SELECT into.

(3) The transformed sql may fail to execute.

func InitAndExec

func InitAndExec(sql string, conn *connector.Connector) *InitResult

InitAndExec: Init + exec

type InitVisitor

type InitVisitor struct {
}

func (*InitVisitor) Enter

func (v *InitVisitor) Enter(in ast.Node) (ast.Node, bool)

func (*InitVisitor) Leave

func (v *InitVisitor) Leave(in ast.Node) (ast.Node, bool)

Jump to

Keyboard shortcuts

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