sql

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2025 License: Apache-2.0 Imports: 5 Imported by: 10

Documentation

Index

Constants

View Source
const (
	EQ  = query.EQ
	NEQ = query.NEQ
	LT  = query.LT
	LE  = query.LE
	GT  = query.GT
	GE  = query.GE
	IN  = query.IN
	NIN = query.NIN
)
View Source
const (
	Version = "v1.5.3"
)

Variables

View Source
var ErrEmptyQuery = parser.ErrEmptyQuery

ErrEmptyQuery is returned when the query is empty.

Functions

This section is empty.

Types

type AlterDatabase added in v1.3.2

type AlterDatabase = query.AlterDatabase

AlterDatabase represents a "ALTER DATABASE" statement interface.

type AlterTable added in v1.3.2

type AlterTable = query.AlterTable

AlterTable represents a "ALTER TABLE" statement interface.

type Begin added in v1.3.2

type Begin = query.Begin

Begin represents a "BEGIN" statement interface.

type Commit added in v1.3.2

type Commit = query.Commit

Commit represents a "COMMIT" statement interface.

type Conn added in v1.3.1

type Conn = net.Conn

Conn represents a connection.

type Constraint added in v1.4.0

type Constraint = query.Constraint

Constraint represents a constraint.

type Copy added in v1.3.3

type Copy = query.Copy

Copy represents a "COPY" statement interface.

type CreateDatabase added in v1.3.2

type CreateDatabase = query.CreateDatabase

CreateDatabase represents a "CREATE DATABASE" statement interface.

type CreateIndex added in v1.4.2

type CreateIndex = query.CreateIndex

CreateIndex represents a "CREATE INDEX" statement interface.

type CreateTable added in v1.3.2

type CreateTable = query.CreateTable

CreateTable represents a "CREATE TABLE" statement interface.

type DCOExecutor added in v1.4.0

type DCOExecutor interface {
	// Use handles a USE query.
	Use(Conn, Use) error
}

DCOExecutor defines a executor interface for DCO (Data Control Operations).

type DDOExecutor added in v1.3.1

type DDOExecutor interface {
	// CreateDatabase handles a CREATE DATABASE query.
	CreateDatabase(Conn, CreateDatabase) error
	// CreateTable handles a CREATE TABLE query.
	CreateTable(Conn, CreateTable) error
	// AlterDatabase handles a ALTER DATABASE query.
	AlterDatabase(Conn, AlterDatabase) error
	// AlterTable handles a ALTER TABLE query.
	AlterTable(Conn, AlterTable) error
	// DropDatabase handles a DROP DATABASE query.
	DropDatabase(Conn, DropDatabase) error
	// DropIndex handles a DROP INDEX query.
	DropTable(Conn, DropTable) error
}

DDOExecutor defines a executor interface for DDO (Data Definition Operations).

type DMOExecutor added in v1.3.1

type DMOExecutor interface {
	// Insert handles a INSERT query.
	Insert(Conn, Insert) error
	// Select handles a SELECT query.
	Select(Conn, Select) (ResultSet, error)
	// Update handles a UPDATE query.
	Update(Conn, Update) (ResultSet, error)
	// Delete handles a DELETE query.
	Delete(Conn, Delete) (ResultSet, error)
}

DMOExecutor defines a executor interface for DMO (Data Manipulation Operations).

type DataType added in v1.4.0

type DataType = query.DataType // DataType represents a data type.

DataType represents a data type.

type Delete added in v1.3.2

type Delete = query.Delete

Delete represents a "DELETE" statement interface.

type DropDatabase added in v1.3.2

type DropDatabase = query.DropDatabase

DropDatabase represents a "DROP DATABASE" statement interface.

type DropIndex added in v1.4.2

type DropIndex = query.DropIndex

DropIndex represents a "DROP INDEX" statement interface.

type DropTable added in v1.3.2

type DropTable = query.DropTable

DropTable represents a "DROP TABLE" statement interface.

type Executor added in v1.3.1

type Executor interface {
	QueryExecutor
	SystemQueryExecutor
}

Executor represents a frontend message executor.

type Function added in v1.3.2

type Function = query.Function

Function represents a function.

type FunctionExecutor added in v1.3.2

type FunctionExecutor = query.FunctionExecutor

FunctionExecutor represents a function executor.

type Insert added in v1.3.2

type Insert = query.Insert

Insert represents a "INSERT" statement interface.

type Parser

type Parser interface {
	// ParseString parses a SQL statement string and returns the query statements.
	ParseString(string) ([]query.Statement, error)
}

Parser represents a parser interface for SQL.

func NewParser

func NewParser() Parser

NewParser returns a new parser.

type QueryExecutor added in v1.3.1

type QueryExecutor interface {
	DDOExecutor
	DMOExecutor
	DCOExecutor
	TCOExecutor
}

QueryExecutor represents a user query message executor.

type ResultSet added in v1.3.3

type ResultSet = resultset.ResultSet

ResultSet represents a response resultset interface.

type ResultSetColumn added in v1.4.0

type ResultSetColumn = resultset.Column

ResultSetColumn represents a column interface in a resultset.

type ResultSetRow added in v1.4.0

type ResultSetRow = resultset.Row

Row represents a row interface.

type ResultSetSchema added in v1.4.0

type ResultSetSchema = resultset.Schema

ResultSetSchema represents a schema interface in a resultset.

type Rollback added in v1.3.2

type Rollback = query.Rollback

Rollback represents a "ROLLBACK" statement interface.

type Schema added in v1.3.3

type Schema = query.Schema

Schema represents a schema.

type Select added in v1.3.2

type Select = query.Select

Select represents a "SELECT" statement interface.

type Statement added in v1.4.0

type Statement = query.Statement

Statement represents a common query interface.

type SystemDMOExecutor added in v1.4.0

type SystemDMOExecutor interface {
	// SystemSelect handles a system SELECT query.
	SystemSelect(Conn, Select) (ResultSet, error)
}

SystemDMOExecutor defines a system executor interface for DMO (Data Manipulation Operations).

type SystemQueryExecutor added in v1.3.1

type SystemQueryExecutor interface {
	SystemDMOExecutor
}

SystemQueryExecutor represents a system query message executor.

type TCOExecutor added in v1.4.0

type TCOExecutor interface {
	// Begin handles a BEGIN query.
	Begin(Conn, Begin) error
	// Commit handles a COMMIT query.
	Commit(Conn, Commit) error
	// Rollback handles a ROLLBACK query.
	Rollback(Conn, Rollback) error
}

TCOExecutor defines a executor interface for TCO (Transaction Control Operations).

type Truncate added in v1.3.3

type Truncate = query.Truncate

Truncate represents a "TRUNCATE" statement interface.

type Update added in v1.3.2

type Update = query.Update

Update represents a "UPDATE" statement interface.

type Use added in v1.3.5

type Use = query.Use

Use represents a "USE" statement interface.

type Vacuum added in v1.3.3

type Vacuum = query.Vacuum

Vacuum represents a "VACUUM" statement interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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