query

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 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 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 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 NewErrPreparedQueryNotExist added in v1.1.1

func NewErrPreparedQueryNotExist(name string) error

NewErrPreparedQueryNotExist returns a new prepared query 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 AndExpr

type AndExpr = query.AndExpr

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

func NewInsertWith added in v0.9.1

func NewInsertWith(tbl *Table, columns ColumnList) *Insert

NewInsertWith returns a new insert statement instance with the specified parameters.

type OID added in v1.0.2

type OID = system.OID

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 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 Statement

type Statement struct {
	query.Statement
}

Statement represents a statement instance.

func NewStatement

func NewStatement(stmt query.Statement) *Statement

NewStatement returns a new statement.

func (*Statement) Bind

func (stmt *Statement) Bind(params message.BindParams) error

Bind binds the statement with the specified parameters.

type Table

type Table = query.Table

type Update

type Update = query.Update

Jump to

Keyboard shortcuts

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