syncql

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2019 License: BSD-3-Clause Imports: 6 Imported by: 9

Documentation

Overview

The ResultStream interface is used to iterate over query results.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadFieldInWhere                 = verror.Register("v.io/v23/query/syncql.BadFieldInWhere", verror.NoRetry, "{1:}{2:} [{3}]Where field must be 'k' or 'v[{.<ident>}...]'.")
	ErrBoolInvalidExpression           = verror.Register("v.io/v23/query/syncql.BoolInvalidExpression", verror.NoRetry, "{1:}{2:} [{3}]Boolean operands may only be used in equals and not equals expressions.")
	ErrCheckOfUnknownStatementType     = verror.Register("v.io/v23/query/syncql.CheckOfUnknownStatementType", verror.NoRetry, "{1:}{2:} [{3}]Cannot semantically check unknown statement type.")
	ErrCouldNotConvert                 = verror.Register("v.io/v23/query/syncql.CouldNotConvert", verror.NoRetry, "{1:}{2:} [{3}]Could not convert {4} to {5}.")
	ErrDotNotationDisallowedForKey     = verror.Register("v.io/v23/query/syncql.DotNotationDisallowedForKey", verror.NoRetry, "{1:}{2:} [{3}]Dot notation may not be used on a key field.")
	ErrExecOfUnknownStatementType      = verror.Register("v.io/v23/query/syncql.ExecOfUnknownStatementType", verror.NoRetry, "{1:}{2:} [{3}]Cannot execute unknown statement type: {4}.")
	ErrExpected                        = verror.Register("v.io/v23/query/syncql.Expected", verror.NoRetry, "{1:}{2:} [{3}]Expected '{4}'.")
	ErrExpectedFrom                    = verror.Register("v.io/v23/query/syncql.ExpectedFrom", verror.NoRetry, "{1:}{2:} [{3}]Expected 'from', found {4}.")
	ErrExpectedIdentifier              = verror.Register("v.io/v23/query/syncql.ExpectedIdentifier", verror.NoRetry, "{1:}{2:} [{3}]Expected identifier, found {4}.")
	ErrExpectedOperand                 = verror.Register("v.io/v23/query/syncql.ExpectedOperand", verror.NoRetry, "{1:}{2:} [{3}]Expected operand, found {4}.")
	ErrExpectedOperator                = verror.Register("v.io/v23/query/syncql.ExpectedOperator", verror.NoRetry, "{1:}{2:} [{3}]Expected operator, found {4}.")
	ErrFunctionArgCount                = verror.Register("v.io/v23/query/syncql.FunctionArgCount", verror.NoRetry, "{1:}{2:} [{3}]Function '{4}' expects {5} args, found: {6}.")
	ErrFunctionAtLeastArgCount         = verror.Register("v.io/v23/query/syncql.FunctionAtLeastArgCount", verror.NoRetry, "{1:}{2:} [{3}]Function '{4}' expects at least {5} args, found: {6}.")
	ErrFunctionTypeInvalidArg          = verror.Register("v.io/v23/query/syncql.FunctionTypeInvalidArg", verror.NoRetry, "{1:}{2:} [{3}]Function 'Type()' cannot get type of argument -- expecting object.")
	ErrFunctionLenInvalidArg           = verror.Register("v.io/v23/query/syncql.FunctionLenInvalidArg", verror.NoRetry, "{1:}{2:} [{3}]Function 'Len()' expects array, list, set, map, string or nil.")
	ErrFunctionArgBad                  = verror.Register("v.io/v23/query/syncql.FunctionArgBad", verror.NoRetry, "{1:}{2:} [{3}]Function '{4}' arg '{5}' could not be resolved.")
	ErrFunctionNotFound                = verror.Register("v.io/v23/query/syncql.FunctionNotFound", verror.NoRetry, "{1:}{2:} [{3}]Function '{4}' not found.")
	ErrArgMustBeField                  = verror.Register("v.io/v23/query/syncql.ArgMustBeField", verror.NoRetry, "{1:}{2:} [{3}]Argument must be a value field (i.e., must begin with 'v').")
	ErrBigIntConversionError           = verror.Register("v.io/v23/query/syncql.BigIntConversionError", verror.NoRetry, "{1:}{2:} [{3}]Can't convert to BigInt: {4}.")
	ErrBigRatConversionError           = verror.Register("v.io/v23/query/syncql.BigRatConversionError", verror.NoRetry, "{1:}{2:} [{3}]Can't convert to BigRat: {4}.")
	ErrBoolConversionError             = verror.Register("v.io/v23/query/syncql.BoolConversionError", verror.NoRetry, "{1:}{2:} [{3}]Can't convert to Bool: {4}.")
	ErrComplexConversionError          = verror.Register("v.io/v23/query/syncql.ComplexConversionError", verror.NoRetry, "{1:}{2:} [{3}]Can't convert to Complex: {4}.")
	ErrUintConversionError             = verror.Register("v.io/v23/query/syncql.UintConversionError", verror.NoRetry, "{1:}{2:} [{3}]Can't convert to Uint: {4}.")
	ErrTimeConversionError             = verror.Register("v.io/v23/query/syncql.TimeConversionError", verror.NoRetry, "{1:}{2:} [{3}]Can't convert to time: {4}.")
	ErrLocationConversionError         = verror.Register("v.io/v23/query/syncql.LocationConversionError", verror.NoRetry, "{1:}{2:} [{3}]Can't convert to location: {4}.")
	ErrStringConversionError           = verror.Register("v.io/v23/query/syncql.StringConversionError", verror.NoRetry, "{1:}{2:} [{3}]Can't convert to string: {4}.")
	ErrFloatConversionError            = verror.Register("v.io/v23/query/syncql.FloatConversionError", verror.NoRetry, "{1:}{2:} [{3}]Can't convert to float: {4}.")
	ErrIntConversionError              = verror.Register("v.io/v23/query/syncql.IntConversionError", verror.NoRetry, "{1:}{2:} [{3}]Can't convert to int: {4}.")
	ErrIsIsNotRequireLhsValue          = verror.Register("v.io/v23/query/syncql.IsIsNotRequireLhsValue", verror.NoRetry, "{1:}{2:} [{3}]'Is/is not' expressions require left operand to be a value operand.")
	ErrIsIsNotRequireRhsNil            = verror.Register("v.io/v23/query/syncql.IsIsNotRequireRhsNil", verror.NoRetry, "{1:}{2:} [{3}]'Is/is not' expressions require right operand to be nil.")
	ErrInvalidLikePattern              = verror.Register("v.io/v23/query/syncql.InvalidLikePattern", verror.NoRetry, "{1:}{2:} [{3}]Invalid like pattern: {4}.")
	ErrInvalidSelectField              = verror.Register("v.io/v23/query/syncql.InvalidSelectField", verror.NoRetry, "{1:}{2:} [{3}]Select field must be 'k' or 'v[{.<ident>}...]'.")
	ErrKeyExpressionLiteral            = verror.Register("v.io/v23/query/syncql.KeyExpressionLiteral", verror.NoRetry, "{1:}{2:} [{3}]Key (i.e., 'k') compares against literals must be string literal.")
	ErrKeyValueStreamError             = verror.Register("v.io/v23/query/syncql.KeyValueStreamError", verror.NoRetry, "{1:}{2:} [{3}]KeyValueStream error: {4}.")
	ErrLikeExpressionsRequireRhsString = verror.Register("v.io/v23/query/syncql.LikeExpressionsRequireRhsString", verror.NoRetry, "{1:}{2:} [{3}]Like expressions require right operand of type <string-literal>.")
	ErrLimitMustBeGt0                  = verror.Register("v.io/v23/query/syncql.LimitMustBeGt0", verror.NoRetry, "{1:}{2:} [{3}]Limit must be > 0.")
	ErrMaxStatementLenExceeded         = verror.Register("v.io/v23/query/syncql.MaxStatementLenExceeded", verror.NoRetry, "{1:}{2:} [{3}]Maximum length of statements is {4}; found {5}.")
	ErrNoStatementFound                = verror.Register("v.io/v23/query/syncql.NoStatementFound", verror.NoRetry, "{1:}{2:} [{3}]No statement found.")
	ErrOffsetMustBeGe0                 = verror.Register("v.io/v23/query/syncql.OffsetMustBeGe0", verror.NoRetry, "{1:}{2:} [{3}]Offset must be > 0.")
	ErrScanError                       = verror.Register("v.io/v23/query/syncql.ScanError", verror.NoRetry, "{1:}{2:} [{3}]Scan error: {4}.")
	ErrTableCantAccess                 = verror.Register("v.io/v23/query/syncql.TableCantAccess", verror.NoRetry, "{1:}{2:} [{3}]Table {4} does not exist (or cannot be accessed): {5}.")
	ErrUnexpected                      = verror.Register("v.io/v23/query/syncql.Unexpected", verror.NoRetry, "{1:}{2:} [{3}]Unexpected: {4}.")
	ErrUnexpectedEndOfStatement        = verror.Register("v.io/v23/query/syncql.UnexpectedEndOfStatement", verror.NoRetry, "{1:}{2:} [{3}]Unexpected end of statement.")
	ErrUnknownIdentifier               = verror.Register("v.io/v23/query/syncql.UnknownIdentifier", verror.NoRetry, "{1:}{2:} [{3}]Unknown identifier: {4}.")
	ErrInvalidEscapeChar               = verror.Register("v.io/v23/query/syncql.InvalidEscapeChar", verror.NoRetry, "{1:}{2:} [{3}]'{4}' is not a valid escape character.")
	ErrDidYouMeanLowercaseK            = verror.Register("v.io/v23/query/syncql.DidYouMeanLowercaseK", verror.NoRetry, "{1:}{2:} [{3}]Did you mean: 'k'?")
	ErrDidYouMeanLowercaseV            = verror.Register("v.io/v23/query/syncql.DidYouMeanLowercaseV", verror.NoRetry, "{1:}{2:} [{3}]Did you mean: 'v'?")
	ErrDidYouMeanFunction              = verror.Register("v.io/v23/query/syncql.DidYouMeanFunction", verror.NoRetry, "{1:}{2:} [{3}]Did you mean: '{4}'?")
	ErrNotEnoughParamValuesSpecified   = verror.Register("v.io/v23/query/syncql.NotEnoughParamValuesSpecified", verror.NoRetry, "{1:}{2:} [{3}]Not enough parameter values specified.")
	ErrTooManyParamValuesSpecified     = verror.Register("v.io/v23/query/syncql.TooManyParamValuesSpecified", verror.NoRetry, "{1:}{2:} [{3}]Too many parameter values specified.")
	ErrPreparedStatementNotFound       = verror.Register("v.io/v23/query/syncql.PreparedStatementNotFound", verror.NoRetry, "{1:}{2:} [0]Prepared statement not found.")
	ErrIndexKindNotSupported           = verror.Register("v.io/v23/query/syncql.IndexKindNotSupported", verror.NoRetry, "{1:}{2:} [{3}]Index kind {4} of field {5} on table {6} not supported.")
	ErrInvalidIndexField               = verror.Register("v.io/v23/query/syncql.InvalidIndexField", verror.NoRetry, "{1:}{2:} [{3}]Invalid index field {4} returned by table {5}.")
	ErrNotWritable                     = verror.Register("v.io/v23/query/syncql.NotWritable", verror.NoRetry, "{1:}{2:} [0]Can't write to table {3} (not supported on batch/connection).")
	ErrOperationNotSupported           = verror.Register("v.io/v23/query/syncql.OperationNotSupported", verror.NoRetry, "{1:}{2:} [0]{3} not supported.")
)

Functions

func NewErrArgMustBeField

func NewErrArgMustBeField(ctx *context.T, off int64) error

NewErrArgMustBeField returns an error with the ErrArgMustBeField ID.

func NewErrBadFieldInWhere

func NewErrBadFieldInWhere(ctx *context.T, off int64) error

NewErrBadFieldInWhere returns an error with the ErrBadFieldInWhere ID.

func NewErrBigIntConversionError

func NewErrBigIntConversionError(ctx *context.T, off int64, err error) error

NewErrBigIntConversionError returns an error with the ErrBigIntConversionError ID.

func NewErrBigRatConversionError

func NewErrBigRatConversionError(ctx *context.T, off int64, err error) error

NewErrBigRatConversionError returns an error with the ErrBigRatConversionError ID.

func NewErrBoolConversionError

func NewErrBoolConversionError(ctx *context.T, off int64, err error) error

NewErrBoolConversionError returns an error with the ErrBoolConversionError ID.

func NewErrBoolInvalidExpression

func NewErrBoolInvalidExpression(ctx *context.T, off int64) error

NewErrBoolInvalidExpression returns an error with the ErrBoolInvalidExpression ID.

func NewErrCheckOfUnknownStatementType

func NewErrCheckOfUnknownStatementType(ctx *context.T, off int64) error

NewErrCheckOfUnknownStatementType returns an error with the ErrCheckOfUnknownStatementType ID.

func NewErrComplexConversionError

func NewErrComplexConversionError(ctx *context.T, off int64, err error) error

NewErrComplexConversionError returns an error with the ErrComplexConversionError ID.

func NewErrCouldNotConvert

func NewErrCouldNotConvert(ctx *context.T, off int64, from string, to string) error

NewErrCouldNotConvert returns an error with the ErrCouldNotConvert ID.

func NewErrDidYouMeanFunction

func NewErrDidYouMeanFunction(ctx *context.T, off int64, correctName string) error

NewErrDidYouMeanFunction returns an error with the ErrDidYouMeanFunction ID.

func NewErrDidYouMeanLowercaseK

func NewErrDidYouMeanLowercaseK(ctx *context.T, off int64) error

NewErrDidYouMeanLowercaseK returns an error with the ErrDidYouMeanLowercaseK ID.

func NewErrDidYouMeanLowercaseV

func NewErrDidYouMeanLowercaseV(ctx *context.T, off int64) error

NewErrDidYouMeanLowercaseV returns an error with the ErrDidYouMeanLowercaseV ID.

func NewErrDotNotationDisallowedForKey

func NewErrDotNotationDisallowedForKey(ctx *context.T, off int64) error

NewErrDotNotationDisallowedForKey returns an error with the ErrDotNotationDisallowedForKey ID.

func NewErrExecOfUnknownStatementType

func NewErrExecOfUnknownStatementType(ctx *context.T, off int64, statementType string) error

NewErrExecOfUnknownStatementType returns an error with the ErrExecOfUnknownStatementType ID.

func NewErrExpected

func NewErrExpected(ctx *context.T, off int64, expected string) error

NewErrExpected returns an error with the ErrExpected ID.

func NewErrExpectedFrom

func NewErrExpectedFrom(ctx *context.T, off int64, found string) error

NewErrExpectedFrom returns an error with the ErrExpectedFrom ID.

func NewErrExpectedIdentifier

func NewErrExpectedIdentifier(ctx *context.T, off int64, found string) error

NewErrExpectedIdentifier returns an error with the ErrExpectedIdentifier ID.

func NewErrExpectedOperand

func NewErrExpectedOperand(ctx *context.T, off int64, found string) error

NewErrExpectedOperand returns an error with the ErrExpectedOperand ID.

func NewErrExpectedOperator

func NewErrExpectedOperator(ctx *context.T, off int64, found string) error

NewErrExpectedOperator returns an error with the ErrExpectedOperator ID.

func NewErrFloatConversionError

func NewErrFloatConversionError(ctx *context.T, off int64, err error) error

NewErrFloatConversionError returns an error with the ErrFloatConversionError ID.

func NewErrFunctionArgBad

func NewErrFunctionArgBad(ctx *context.T, off int64, funcName string, argName string) error

NewErrFunctionArgBad returns an error with the ErrFunctionArgBad ID.

func NewErrFunctionArgCount

func NewErrFunctionArgCount(ctx *context.T, off int64, name string, expected int64, found int64) error

NewErrFunctionArgCount returns an error with the ErrFunctionArgCount ID.

func NewErrFunctionAtLeastArgCount

func NewErrFunctionAtLeastArgCount(ctx *context.T, off int64, name string, expected int64, found int64) error

NewErrFunctionAtLeastArgCount returns an error with the ErrFunctionAtLeastArgCount ID.

func NewErrFunctionLenInvalidArg

func NewErrFunctionLenInvalidArg(ctx *context.T, off int64) error

NewErrFunctionLenInvalidArg returns an error with the ErrFunctionLenInvalidArg ID.

func NewErrFunctionNotFound

func NewErrFunctionNotFound(ctx *context.T, off int64, name string) error

NewErrFunctionNotFound returns an error with the ErrFunctionNotFound ID.

func NewErrFunctionTypeInvalidArg

func NewErrFunctionTypeInvalidArg(ctx *context.T, off int64) error

NewErrFunctionTypeInvalidArg returns an error with the ErrFunctionTypeInvalidArg ID.

func NewErrIndexKindNotSupported

func NewErrIndexKindNotSupported(ctx *context.T, off int64, kind string, fieldName string, table string) error

NewErrIndexKindNotSupported returns an error with the ErrIndexKindNotSupported ID.

func NewErrIntConversionError

func NewErrIntConversionError(ctx *context.T, off int64, err error) error

NewErrIntConversionError returns an error with the ErrIntConversionError ID.

func NewErrInvalidEscapeChar

func NewErrInvalidEscapeChar(ctx *context.T, off int64, escChar string) error

NewErrInvalidEscapeChar returns an error with the ErrInvalidEscapeChar ID.

func NewErrInvalidIndexField

func NewErrInvalidIndexField(ctx *context.T, off int64, fieldName string, table string) error

NewErrInvalidIndexField returns an error with the ErrInvalidIndexField ID.

func NewErrInvalidLikePattern

func NewErrInvalidLikePattern(ctx *context.T, off int64, err error) error

NewErrInvalidLikePattern returns an error with the ErrInvalidLikePattern ID.

func NewErrInvalidSelectField

func NewErrInvalidSelectField(ctx *context.T, off int64) error

NewErrInvalidSelectField returns an error with the ErrInvalidSelectField ID.

func NewErrIsIsNotRequireLhsValue

func NewErrIsIsNotRequireLhsValue(ctx *context.T, off int64) error

NewErrIsIsNotRequireLhsValue returns an error with the ErrIsIsNotRequireLhsValue ID.

func NewErrIsIsNotRequireRhsNil

func NewErrIsIsNotRequireRhsNil(ctx *context.T, off int64) error

NewErrIsIsNotRequireRhsNil returns an error with the ErrIsIsNotRequireRhsNil ID.

func NewErrKeyExpressionLiteral

func NewErrKeyExpressionLiteral(ctx *context.T, off int64) error

NewErrKeyExpressionLiteral returns an error with the ErrKeyExpressionLiteral ID.

func NewErrKeyValueStreamError

func NewErrKeyValueStreamError(ctx *context.T, off int64, err error) error

NewErrKeyValueStreamError returns an error with the ErrKeyValueStreamError ID.

func NewErrLikeExpressionsRequireRhsString

func NewErrLikeExpressionsRequireRhsString(ctx *context.T, off int64) error

NewErrLikeExpressionsRequireRhsString returns an error with the ErrLikeExpressionsRequireRhsString ID.

func NewErrLimitMustBeGt0

func NewErrLimitMustBeGt0(ctx *context.T, off int64) error

NewErrLimitMustBeGt0 returns an error with the ErrLimitMustBeGt0 ID.

func NewErrLocationConversionError

func NewErrLocationConversionError(ctx *context.T, off int64, err error) error

NewErrLocationConversionError returns an error with the ErrLocationConversionError ID.

func NewErrMaxStatementLenExceeded

func NewErrMaxStatementLenExceeded(ctx *context.T, off int64, max int64, found int64) error

NewErrMaxStatementLenExceeded returns an error with the ErrMaxStatementLenExceeded ID.

func NewErrNoStatementFound

func NewErrNoStatementFound(ctx *context.T, off int64) error

NewErrNoStatementFound returns an error with the ErrNoStatementFound ID.

func NewErrNotEnoughParamValuesSpecified

func NewErrNotEnoughParamValuesSpecified(ctx *context.T, off int64) error

NewErrNotEnoughParamValuesSpecified returns an error with the ErrNotEnoughParamValuesSpecified ID.

func NewErrNotWritable

func NewErrNotWritable(ctx *context.T, table string) error

NewErrNotWritable returns an error with the ErrNotWritable ID.

func NewErrOffsetMustBeGe0

func NewErrOffsetMustBeGe0(ctx *context.T, off int64) error

NewErrOffsetMustBeGe0 returns an error with the ErrOffsetMustBeGe0 ID.

func NewErrOperationNotSupported

func NewErrOperationNotSupported(ctx *context.T, operation string) error

NewErrOperationNotSupported returns an error with the ErrOperationNotSupported ID.

func NewErrPreparedStatementNotFound

func NewErrPreparedStatementNotFound(ctx *context.T) error

NewErrPreparedStatementNotFound returns an error with the ErrPreparedStatementNotFound ID.

func NewErrScanError

func NewErrScanError(ctx *context.T, off int64, err error) error

NewErrScanError returns an error with the ErrScanError ID.

func NewErrStringConversionError

func NewErrStringConversionError(ctx *context.T, off int64, err error) error

NewErrStringConversionError returns an error with the ErrStringConversionError ID.

func NewErrTableCantAccess

func NewErrTableCantAccess(ctx *context.T, off int64, table string, err error) error

NewErrTableCantAccess returns an error with the ErrTableCantAccess ID.

func NewErrTimeConversionError

func NewErrTimeConversionError(ctx *context.T, off int64, err error) error

NewErrTimeConversionError returns an error with the ErrTimeConversionError ID.

func NewErrTooManyParamValuesSpecified

func NewErrTooManyParamValuesSpecified(ctx *context.T, off int64) error

NewErrTooManyParamValuesSpecified returns an error with the ErrTooManyParamValuesSpecified ID.

func NewErrUintConversionError

func NewErrUintConversionError(ctx *context.T, off int64, err error) error

NewErrUintConversionError returns an error with the ErrUintConversionError ID.

func NewErrUnexpected

func NewErrUnexpected(ctx *context.T, off int64, found string) error

NewErrUnexpected returns an error with the ErrUnexpected ID.

func NewErrUnexpectedEndOfStatement

func NewErrUnexpectedEndOfStatement(ctx *context.T, off int64) error

NewErrUnexpectedEndOfStatement returns an error with the ErrUnexpectedEndOfStatement ID.

func NewErrUnknownIdentifier

func NewErrUnknownIdentifier(ctx *context.T, off int64, found string) error

NewErrUnknownIdentifier returns an error with the ErrUnknownIdentifier ID.

func SplitError

func SplitError(err error) (int64, string)

SplitError splits an error message into an offset and the remaining (i.e., rhs of offset) message. The query error convention is "<module><optional-rpc>[offset]<remaining-message>". If err is nil, (0, "") are returned.

Types

type ResultStream

type ResultStream interface {
	// Advance stages an element so the client can retrieve it with Result.
	// Advance returns true iff there is a result to retrieve. The client must
	// call Advance before calling Result. The client must call Cancel if it
	// does not iterate through all elements (i.e. until Advance returns false).
	// Advance may block if an element is not immediately available.
	Advance() bool

	// Result returns the row (i.e., array of vdl.Values) that was staged by
	// Advance. Result may panic if Advance returned false or was not called at
	// all. Result does not block.
	Result() []*vom.RawBytes

	// Err returns a non-nil error iff the stream encountered any errors. Err does
	// not block.
	Err() error

	// Cancel notifies the ResultStream provider that it can stop producing
	// results. The client must call Cancel if it does not iterate through all
	// results (i.e. until Advance returns false). Cancel is idempotent and can be
	// called concurrently with a goroutine that is iterating via Advance/Result.
	// Cancel causes Advance to subsequently return false. Cancel does not block.
	Cancel()
}

ResultStream is an interface for iterating through results (i.e., rows) returned from a query. Each resulting row is an array of vdl.Values.

Jump to

Keyboard shortcuts

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