query

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: May 25, 2024 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Overview

Copyright (C) 2019 Satoshi Konno. 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 (
	// Aliases for types defined in github.com/cybergarage/go-postgresql/postgresql/query.
	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

View Source
var ErrExist = errors.New("exist")

ErrExist is returned when the specified object is exist.

View Source
var ErrInvalid = errors.New("invalid")

ErrInvalid is returned when the specified object is invalid.

View Source
var ErrNotEqual = errors.New("not equal")

ErrNotEqual is returned when the specified object is not equal.

View Source
var ErrNotExist = errors.New("not exist")

ErrNotExist is returned when the specified object is not exist.

View Source
var ErrNotImplemented = errors.New("not implemented")

ErrNotImplemented is returned when the operation is not implemented.

View Source
var ErrNotSupported = errors.New("not supported")

ErrNotSupported is returned when the operation is not supported.

Functions

func NewDataRowForSelectors added in v1.1.1

func NewDataRowForSelectors(schema *query.Schema, rowDesc *message.RowDescription, selectors query.SelectorList, row Row) (*message.DataRow, error)

NewDataRowForSelectors returns a new DataRow from the specified row.

func NewDataRowsForAggregateFunction added in v1.1.1

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

NewDataRowsForAggregateFunction returns a new DataRow list from the specified rows.

func NewErrColumnNotExist added in v1.1.1

func NewErrColumnNotExist(v any) error

NewErrColumnNotExist returns a new column not exist error.

func NewErrColumnValueNotExist added in v1.1.1

func NewErrColumnValueNotExist(v any) error

NewErrColumnValueNotExist returns a new column value not exist error.

func NewErrColumnsNotEqual added in v1.1.1

func NewErrColumnsNotEqual(v1, v2 int) error

NewErrColumnsNotEqual returns a new columns not equal error.

func NewErrDatabaseExist added in v1.1.1

func NewErrDatabaseExist(v string) error

NewErrDatabaseExist returns a new database exist error.

func NewErrDatabaseNotExist added in v1.1.1

func NewErrDatabaseNotExist(v string) error

NewErrDatabaseNotExist returns a new database not exist error.

func NewErrExist added in v1.1.1

func NewErrExist(v any) error

NewErrExist returns a new exist error.

func NewErrGroupByColumnValueNotExist added in v1.1.1

func NewErrGroupByColumnValueNotExist(v any) error

NewErrGroupByColumnValueNotExist returns a new group by column not exist error.

func NewErrInvalid added in v1.3.0

func NewErrInvalid(v any) error

NewErrInvalid returns a new invalid error.

func NewErrMultiplePreparedStatementNotSupported added in v1.3.0

func NewErrMultiplePreparedStatementNotSupported(query string) error

NewErrPreparedStatementMultiStatement returns a new prepared statement multi statement error.

func NewErrMultipleTableNotSupported added in v1.3.0

func NewErrMultipleTableNotSupported(query string) error

NewErrMultipleTableNotSupported returns a new prepared statement multi table error.

func NewErrNotEqual added in v1.1.1

func NewErrNotEqual(v1, v2 any) error

NewErrNotEqual returns a new not equal error.

func NewErrNotExist added in v1.1.1

func NewErrNotExist(v any) error

NewErrNotExist returns a new not exist error.

func NewErrNotImplemented added in v1.1.1

func NewErrNotImplemented(msg string) error

NewErrNotImplemented returns a new ErrNotImplemented error.

func NewErrNotSupported added in v1.1.1

func NewErrNotSupported(msg string) error

NewErrNotSupported returns a new ErrNotSupported error.

func NewErrPreparedPortalNotExist added in v1.3.0

func NewErrPreparedPortalNotExist(name string) error

NewErrPreparedPortalNotExist returns a new prepared portal not exist error.

func NewErrPreparedStatementNotExist added in v1.3.0

func NewErrPreparedStatementNotExist(name string) error

NewErrPreparedStatementNotExist returns a new prepared statement not exist error.

func NewErrTableExist added in v1.1.1

func NewErrTableExist(v string) error

NewErrTableExist returns a new table exist error.

func NewErrTableNotExist added in v1.1.1

func NewErrTableNotExist(v string) error

NewErrTableNotExist returns a new table not exist error.

func NewRowFieldFrom added in v1.1.1

func NewRowFieldFrom(schema *query.Schema, selector query.Selector, idx int) (*message.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

Aliases for types defined in github.com/cybergarage/go-postgresql/postgresql/query.

type CmpExpr

type CmpExpr = query.CmpExpr

type Column

type Column = query.Column

type ColumnList added in v0.9.1

type ColumnList = query.ColumnList

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 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 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 OID added in v1.0.2

type OID = system.ObjectID

OID represents a object identifier.

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 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.SelectorList

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 message.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 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