query

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: Apache-2.0 Imports: 3 Imported by: 1

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 (
	BigIntData       = query.BigIntData
	BinaryData       = query.BinaryData
	BitData          = query.BitData
	BlobData         = query.BlobData
	BooleanData      = query.BooleanData
	CharData         = query.CharData
	CharacterData    = query.CharacterData
	ClobData         = query.ClobData
	DateData         = query.DateData
	DateTimeData     = query.DateTimeData
	DecimalData      = query.DecimalData
	DoubleData       = query.DoubleData
	DoublePrecision  = query.DoublePrecision
	FloatData        = query.FloatData
	IntData          = query.IntData
	IntegerData      = query.IntegerData
	LongBlobData     = query.LongBlobData
	LongTextData     = query.LongTextData
	MediumBlobData   = query.MediumBlobData
	MediumIntData    = query.MediumIntData
	MediumTextData   = query.MediumTextData
	NumericData      = query.NumericData
	RealData         = query.RealData
	SetData          = query.SetData
	SmallIntData     = query.SmallIntData
	TextData         = query.TextData
	TimeData         = query.TimeData
	TimeStampData    = query.TimeStampData
	TinyBlobData     = query.TinyBlobData
	TinyIntData      = query.TinyIntData
	TinyTextData     = query.TinyTextData
	VarBinaryData    = query.VarBinaryData
	VarCharData      = query.VarCharData
	VarCharacterData = query.VarCharacterData
	YearData         = query.YearData
)
View Source
const (
	// MySQLTypeDecimal represents a MYSQL_TYPE_DECIMAL type.
	MySQLTypeDecimal FieldType = iota
	// MySQLTypeTiny represents a MYSQL_TYPE_TINYINT type.
	MySQLTypeTiny
	// MySQLTypeShort represents a MYSQL_TYPE_SMALLINT type.
	MySQLTypeShort
	// MySQLTypeLong represents an INT type.
	MySQLTypeLong
	// MySQLTypeFloat represents a MYSQL_TYPE_FLOAT type.
	MySQLTypeFloat
	// MySQLTypeDouble represents a MYSQL_TYPE_DOUBLE type.
	MySQLTypeDouble
	// MySQLTypeNull represents a MYSQL_TYPE_NULL type.
	MySQLTypeNull
	// MySQLTypeTimestamp represents a MYSQL_TYPE_TIMESTAMP type.
	MySQLTypeTimestamp
	// MySQLTypeLongLong represents a MYSQL_TYPE_BIGINT type.
	MySQLTypeLongLong
	// MySQLTypeInt24 represents a MYSQL_TYPE_MEDIUMINT type.
	MySQLTypeInt24
	// MySQLTypeDate represents a MYSQL_TYPE_DATE type.
	MySQLTypeDate
	// MySQLTypeTime represents a MYSQL_TYPE_TIME type.
	MySQLTypeTime
	// MySQLTypeDatetime represents a MYSQL_TYPE_DATETIME type.
	MySQLTypeDatetime
	// MySQLTypeYear represents a MYSQL_TYPE_YEAR type.
	MySQLTypeYear
	// MySQLTypeNewdate represents a MYSQL_TYPE_NEWDATE type.
	MySQLTypeNewdate
	// MySQLTypeVarchar represents a MYSQL_TYPE_VARCHAR type.
	MySQLTypeVarchar
	// MySQLTypeBit represents a MYSQL_TYPE_BIT type.
	MySQLTypeBit
	// MySQLTypeTimestamp2 represents a MYSQL_TYPE_TIMESTAMP2 type.
	MySQLTypeTimestamp2
	// MySQLTypeDatetime2 represents a MYSQL_TYPE_DATETIME2 type.
	MySQLTypeDatetime2
	// MySQLTypeTime2 represents a MYSQL_TYPE_TIME2 type.
	MySQLTypeTime2
	// MySQLTypeTypedArray represents a MYSQL_TYPE_TYPED_ARRAY type.
	MySQLTypeTypedArray
	// MySQLTypeVector represents a MYSQL_TYPE_VECTOR type.
	MySQLTypeVector = 242
	// MySQLTypeInvalid represents an INVALID type.
	MySQLTypeInvalid = 243
	// MySQLTypeBool represents a MYSQL_TYPE_BOOL type.
	MySQLTypeBool = 244
	// MySQLTypeJSON represents a MYSQL_TYPE_JSON type.
	MySQLTypeJSON = 245
	// MySQLTypeNewdecimal represents a MYSQL_TYPE_NEWDECIMAL type.
	MySQLTypeNewdecimal = 246
	// MySQLTypeEnum represents an ENUM type.
	MySQLTypeEnum = 247
	// MySQLTypeSet represents a MYSQL_TYPE_SET type.
	MySQLTypeSet = 248
	// MySQLTypeTinyBlob represents a MYSQL_TYPE_TINYBLOB type.
	MySQLTypeTinyBlob = 249
	// MySQLTypeMediumBlob represents a MYSQL_TYPE_MEDIUMBLOB type.
	MySQLTypeMediumBlob = 250
	// MySQLTypeLongBlob represents a MYSQL_TYPE_LONGBLOB type.
	MySQLTypeLongBlob = 251
	// MySQLTypeBlob represents a MYSQL_TYPE_BLOB type.
	MySQLTypeBlob = 252
	// MySQLTypeVarString represents a MYSQL_TYPE_VAR_STRING type.
	MySQLTypeVarString = 253
	// MySQLTypeString represents a MYSQL_TYPE_STRING type.
	MySQLTypeString = 254
	// MySQLTypeGeometry represents a MYSQL_TYPE_GEOMETRY type.
	MySQLTypeGeometry = 255
)
View Source
const (
	CreateDatabaseStatement = query.CreateDatabaseStatement
	CreateTableStatement    = query.CreateTableStatement
	CreateIndexStatement    = query.CreateIndexStatement
	InsertStatement         = query.InsertStatement
	SelectStatement         = query.SelectStatement
	UpdateStatement         = query.UpdateStatement
	DeleteStatement         = query.DeleteStatement
	DropDatabaseStatement   = query.DropDatabaseStatement
	DropTableStatement      = query.DropTableStatement
	DropIndexStatement      = query.DropIndexStatement
	AlterDatabaseStatement  = query.AlterDatabaseStatement
	AlterTableStatement     = query.AlterTableStatement
	AlterIndexStatement     = query.AlterIndexStatement
	CopyStatement           = query.CopyStatement
	CommitStatement         = query.CommitStatement
	VacuumStatement         = query.VacuumStatement
	TruncateStatement       = query.TruncateStatement
	BeginStatement          = query.BeginStatement
	RollbackStatement       = query.RollbackStatement
	UseStatement            = query.UseStatement
)

Variables

This section is empty.

Functions

func NewParser

func NewParser() sql.Parser

NewParser returns a new SQL parser.

Types

type AggregateFunction added in v1.1.0

type AggregateFunction = query.AggregateFunction

AggregateFunction represents an aggregate function.

type AggregateResultSet added in v1.1.0

type AggregateResultSet = query.AggregateResultSet

AggregateResultSet represents an aggregate result set.

type AlterDatabase added in v1.1.0

type AlterDatabase = sql.AlterDatabase

type AlterTable added in v1.1.0

type AlterTable = sql.AlterTable

type AndExpr

type AndExpr = query.AndExpr

type Begin

type Begin = sql.Begin

type BindParam added in v1.1.0

type BindParam = query.BindParam

type CmpExpr added in v1.1.0

type CmpExpr = query.CmpExpr

type Column

type Column = query.Column

type ColumnDefFlag added in v1.1.0

type ColumnDefFlag = uint16

ColumnDefFlag represents a MySQL column definition flag.

const (
	NotNullFlag        ColumnDefFlag = 1
	PriKeyFlag         ColumnDefFlag = 2
	UniqueKeyFlag      ColumnDefFlag = 4
	MultipleKeyFlag    ColumnDefFlag = 8
	BlobFlag           ColumnDefFlag = 16
	UnsignedFlag       ColumnDefFlag = 32
	ZerofillFlag       ColumnDefFlag = 64
	BinaryFlag         ColumnDefFlag = 128
	EnumFlag           ColumnDefFlag = 256
	AutoIncrementFlag  ColumnDefFlag = 512
	TimestampFlag      ColumnDefFlag = 1024
	SetFlag            ColumnDefFlag = 2048
	NoDefaultValueFlag ColumnDefFlag = 4096
	OnUpdateNowFlag    ColumnDefFlag = 8192
	NumFlag            ColumnDefFlag = 32768
	PartKeyFlag        ColumnDefFlag = 16384
	GroupFlag          ColumnDefFlag = 32768
)

func NewColumnDefFlagFrom added in v1.1.0

func NewColumnDefFlagFrom(c query.Constraint) (ColumnDefFlag, error)

NewColumnDefFlagFrom converts a given Constraint into a ColumnDefFlag.

type Columns

type Columns = query.Columns

type Commit

type Commit = sql.Commit

type Condition

type Condition = query.Condition

type Constraint added in v1.1.0

type Constraint = query.Constraint

type Copy added in v1.1.0

type Copy = sql.Copy

type CreateDatabase added in v1.1.0

type CreateDatabase = sql.CreateDatabase

type CreateIndex added in v1.1.2

type CreateIndex = sql.CreateIndex

type CreateTable added in v1.1.0

type CreateTable = sql.CreateTable

type DataType added in v1.1.0

type DataType = query.DataType

type Delete

type Delete = sql.Delete

type DropDatabase added in v1.1.0

type DropDatabase = sql.DropDatabase

type DropIndex added in v1.1.2

type DropIndex = sql.DropIndex

type DropTable added in v1.1.0

type DropTable = sql.DropTable

type Expr

type Expr = query.Expr

type FieldType added in v1.1.0

type FieldType uint8

FieldType represents a field type.

func NewFieldTypeFrom added in v1.1.0

func NewFieldTypeFrom(t query.DataType) (FieldType, error)

NewFieldTypeFrom returns a new FieldType from the data type.

func (FieldType) String added in v1.3.0

func (ft FieldType) String() string

String returns a string representation of the field type.

type Function added in v1.1.0

type Function = query.Function

Function represents a function.

type FunctionExecutor added in v1.1.0

type FunctionExecutor = query.FunctionExecutor

FunctionExecutor represents a function executor.

type Index added in v1.1.0

type Index = query.Index

type Indexes added in v1.1.0

type Indexes = query.Indexes

type Insert

type Insert = sql.Insert

type OrExpr

type OrExpr = query.OrExpr

type ResultSet added in v1.1.0

type ResultSet interface {
	ResultSetSchema
	// Row returns the current row.
	Row() ResultSetRow
	// Schema returns the schema.
	Schema() ResultSetSchema
	// RowsAffected returns the number of rows affected.
	RowsAffected() uint64
	// Next returns the next row.
	Next() bool
	// Close closes the resultset.
	Close() error
}

ResultSet represents a response resultset interface.

type ResultSetColumn added in v1.1.0

type ResultSetColumn interface {
	// Name returns the column name.
	Name() string
	// Type returns the data type.
	Type() DataType
	// Constraint returns the column constraint.
	Constraint() Constraint
}

ResultSetColumn represents a column interface in a resultset.

type ResultSetRow added in v1.1.0

type ResultSetRow interface {
	// Values returns the all values.
	Values() []any
	// ValueAt returns the value at the specified index.
	ValueAt(int) (any, error)
	// Scan scans the values.
	Scan(...any) error
	// ScanAt scans the value at the specified index.
	ScanAt(int, any) error
}

ResultSetRow represents a row interface.

type ResultSetSchema added in v1.1.0

type ResultSetSchema interface {
	// DatabaseName returns the database name.
	DatabaseName() string
	// TableName returns the table name.
	TableName() string
	// Columns returns the columns.
	Columns() []ResultSetColumn
}

ResultSetSchema represents a schema interface in a resultset.

type Rollback

type Rollback = sql.Rollback

type SQLExecutor added in v1.1.0

type SQLExecutor interface {
	sql.Executor
}

SQLExecutor represents a frontend message executor.

type Schema

type Schema = sql.Schema

type Select

type Select = sql.Select

type SelectOption added in v1.1.0

type SelectOption = query.SelectOption

type Selector added in v1.1.0

type Selector = query.Selector

type Selectors added in v1.1.0

type Selectors = query.Selectors

type Statement

type Statement = query.Statement

type StatementType

type StatementType = query.StatementType

type Table

type Table = query.Table

type TableList added in v1.1.0

type TableList = query.TableList

type Truncate added in v1.1.0

type Truncate = sql.Truncate

type Update

type Update = sql.Update

type Use

type Use = sql.Use

type Vacuum added in v1.1.0

type Vacuum = sql.Vacuum

Jump to

Keyboard shortcuts

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