query

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2025 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Overview

Copyright (C) 2019 The go-postgresql Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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
)

Variables

This section is empty.

Functions

func NewDataRowForSelectors added in v1.1.1

func NewDataRowForSelectors(schema resultset.Schema, rowDesc *protocol.RowDescription, selectors query.Selectors, row Row) (*protocol.DataRow, error)

NewDataRowForSelectors returns a new DataRow from the specified row.

func NewDataRowsForAggregateFunction added in v1.1.1

func NewDataRowsForAggregateFunction(schema resultset.Schema, rowDesc *protocol.RowDescription, selectors query.Selectors, rows []Row, groupBy string) ([]*protocol.DataRow, error)

NewDataRowsForAggregateFunction returns a new DataRow list from the specified rows.

func NewResponseFromResultSet added in v1.6.0

func NewResponseFromResultSet(stmt Select, rs resultset.ResultSet) (protocol.Responses, error)

NewResponseFromResultSet creates a response from a result set.

func NewRowFieldFrom added in v1.1.1

func NewRowFieldFrom(schema sql.ResultSetSchema, selector query.Selector, idx int) (*protocol.RowField, error)

NewRowFieldFrom returns a new RowField from the specified selector.

Types

type AggregateFunction added in v1.1.1

type AggregateFunction = query.AggregateFunction

AggregateFunction represents an aggregate function.

type AggregateResultSet added in v1.1.1

type AggregateResultSet = query.AggregateResultSet

AggregateResultSet represents an aggregate result set.

type AlterDatabase added in v1.2.0

type AlterDatabase = query.AlterDatabase

type AlterTable added in v1.2.0

type AlterTable = query.AlterTable

type AndExpr

type AndExpr = query.AndExpr

type Begin added in v1.2.0

type Begin = query.Begin

type BindParam

type BindParam = query.BindParam

type CmpExpr

type CmpExpr = query.CmpExpr

type Column

type Column = query.Column

type ColumnList added in v0.9.1

type ColumnList = query.Columns

type Commit added in v1.2.0

type Commit = query.Commit

type Condition

type Condition = query.Condition

type Copy added in v0.9.1

type Copy = query.Copy

type CreateDatabase

type CreateDatabase = query.CreateDatabase

type CreateIndex

type CreateIndex = query.CreateIndex

type CreateTable

type CreateTable = query.CreateTable

type DataType

type DataType = system.DataType

DataType represents a data type.

func NewDataTypeFrom added in v1.0.2

func NewDataTypeFrom(t query.DataType) (*DataType, error)

NewDataTypeFrom returns a data type from the specified query data type.

type Delete

type Delete = query.Delete

type DropDatabase

type DropDatabase = query.DropDatabase

type DropIndex added in v1.6.1

type DropIndex = query.DropIndex

type DropTable

type DropTable = query.DropTable

type Expr

type Expr = query.Expr

type Function added in v1.1.1

type Function = query.Function

Function represents a function.

type FunctionExecutor added in v1.1.1

type FunctionExecutor = query.FunctionExecutor

FunctionExecutor represents a function executor.

type Insert

type Insert = query.Insert

type ObjectID added in v1.6.1

type ObjectID = system.ObjectID

ObjectID represents a object identifier.

func NewObjectIDFrom added in v1.6.1

func NewObjectIDFrom(t query.DataType) (ObjectID, error)

NewObjectIDFrom returns a data type from the specified query data type.

type OrExpr

type OrExpr = query.OrExpr

type Parser

type Parser struct {
	sql.Parser
}

Parse returns a SQL parser.

func NewParser

func NewParser() *Parser

NewParser returns a new parser.

func (*Parser) ParseString

func (parser *Parser) ParseString(query string) ([]*Statement, error)

ParseString parses the specified query string and returns statements.

type Rollback added in v1.2.0

type Rollback = query.Rollback

type Row added in v1.1.1

type Row = map[string]any

Row represents a row of a result set.

type SQLExecutor added in v1.5.9

type SQLExecutor interface {
	sql.Executor
}

SQLExecutor represents a SQL executor.

type Schema

type Schema = query.Schema

type Select

type Select = query.Select

type SelectOption added in v1.3.0

type SelectOption = query.SelectOption

type Selector added in v1.3.0

type Selector = query.Selector

type SelectorList added in v1.3.0

type SelectorList = query.Selectors

type Statement

type Statement struct {
	// contains filtered or unexported fields
}

Statement represents a statement instance.

func NewStatementWith added in v1.3.0

func NewStatementWith(stmt query.Statement) *Statement

NewStatementWith returns a new statement.

func (*Statement) Bind

func (stmt *Statement) Bind(bindParams protocol.BindParams) error

Bind binds the statement with the specified parameters.

func (*Statement) Object added in v1.3.0

func (stmt *Statement) Object() query.Statement

Statement returns a statement object.

type Table

type Table = query.Table

type TableList added in v1.3.0

type TableList = query.TableList

type Truncate added in v1.2.0

type Truncate = query.Truncate

type Update

type Update = query.Update

type Use added in v1.6.0

type Use = query.Use

type Vacuum added in v1.2.0

type Vacuum = query.Vacuum

Jump to

Keyboard shortcuts

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