Documentation ¶
Overview ¶
The ResultStream interface is used to iterate over query results.
Index ¶
- Variables
- func NewErrArgMustBeField(ctx *context.T, off int64) error
- func NewErrBadFieldInWhere(ctx *context.T, off int64) error
- func NewErrBigIntConversionError(ctx *context.T, off int64, err error) error
- func NewErrBigRatConversionError(ctx *context.T, off int64, err error) error
- func NewErrBoolConversionError(ctx *context.T, off int64, err error) error
- func NewErrBoolInvalidExpression(ctx *context.T, off int64) error
- func NewErrCheckOfUnknownStatementType(ctx *context.T, off int64) error
- func NewErrComplexConversionError(ctx *context.T, off int64, err error) error
- func NewErrCouldNotConvert(ctx *context.T, off int64, from string, to string) error
- func NewErrDidYouMeanFunction(ctx *context.T, off int64, correctName string) error
- func NewErrDidYouMeanLowercaseK(ctx *context.T, off int64) error
- func NewErrDidYouMeanLowercaseV(ctx *context.T, off int64) error
- func NewErrDotNotationDisallowedForKey(ctx *context.T, off int64) error
- func NewErrExecOfUnknownStatementType(ctx *context.T, off int64, statementType string) error
- func NewErrExpected(ctx *context.T, off int64, expected string) error
- func NewErrExpectedFrom(ctx *context.T, off int64, found string) error
- func NewErrExpectedIdentifier(ctx *context.T, off int64, found string) error
- func NewErrExpectedOperand(ctx *context.T, off int64, found string) error
- func NewErrExpectedOperator(ctx *context.T, off int64, found string) error
- func NewErrFloatConversionError(ctx *context.T, off int64, err error) error
- func NewErrFunctionArgBad(ctx *context.T, off int64, funcName string, argName string) error
- func NewErrFunctionArgCount(ctx *context.T, off int64, name string, expected int64, found int64) error
- func NewErrFunctionAtLeastArgCount(ctx *context.T, off int64, name string, expected int64, found int64) error
- func NewErrFunctionLenInvalidArg(ctx *context.T, off int64) error
- func NewErrFunctionNotFound(ctx *context.T, off int64, name string) error
- func NewErrFunctionTypeInvalidArg(ctx *context.T, off int64) error
- func NewErrIndexKindNotSupported(ctx *context.T, off int64, kind string, fieldName string, table string) error
- func NewErrIntConversionError(ctx *context.T, off int64, err error) error
- func NewErrInvalidEscapeChar(ctx *context.T, off int64, escChar string) error
- func NewErrInvalidIndexField(ctx *context.T, off int64, fieldName string, table string) error
- func NewErrInvalidLikePattern(ctx *context.T, off int64, err error) error
- func NewErrInvalidSelectField(ctx *context.T, off int64) error
- func NewErrIsIsNotRequireLhsValue(ctx *context.T, off int64) error
- func NewErrIsIsNotRequireRhsNil(ctx *context.T, off int64) error
- func NewErrKeyExpressionLiteral(ctx *context.T, off int64) error
- func NewErrKeyValueStreamError(ctx *context.T, off int64, err error) error
- func NewErrLikeExpressionsRequireRhsString(ctx *context.T, off int64) error
- func NewErrLimitMustBeGt0(ctx *context.T, off int64) error
- func NewErrLocationConversionError(ctx *context.T, off int64, err error) error
- func NewErrMaxStatementLenExceeded(ctx *context.T, off int64, max int64, found int64) error
- func NewErrNoStatementFound(ctx *context.T, off int64) error
- func NewErrNotEnoughParamValuesSpecified(ctx *context.T, off int64) error
- func NewErrNotWritable(ctx *context.T, table string) error
- func NewErrOffsetMustBeGe0(ctx *context.T, off int64) error
- func NewErrOperationNotSupported(ctx *context.T, operation string) error
- func NewErrPreparedStatementNotFound(ctx *context.T) error
- func NewErrScanError(ctx *context.T, off int64, err error) error
- func NewErrStringConversionError(ctx *context.T, off int64, err error) error
- func NewErrTableCantAccess(ctx *context.T, off int64, table string, err error) error
- func NewErrTimeConversionError(ctx *context.T, off int64, err error) error
- func NewErrTooManyParamValuesSpecified(ctx *context.T, off int64) error
- func NewErrUintConversionError(ctx *context.T, off int64, err error) error
- func NewErrUnexpected(ctx *context.T, off int64, found string) error
- func NewErrUnexpectedEndOfStatement(ctx *context.T, off int64) error
- func NewErrUnknownIdentifier(ctx *context.T, off int64, found string) error
- func SplitError(err error) (int64, string)
- type ResultStream
Constants ¶
This section is empty.
Variables ¶
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 ¶
NewErrArgMustBeField returns an error with the ErrArgMustBeField ID.
func NewErrBadFieldInWhere ¶
NewErrBadFieldInWhere returns an error with the ErrBadFieldInWhere ID.
func NewErrBigIntConversionError ¶
NewErrBigIntConversionError returns an error with the ErrBigIntConversionError ID.
func NewErrBigRatConversionError ¶
NewErrBigRatConversionError returns an error with the ErrBigRatConversionError ID.
func NewErrBoolConversionError ¶
NewErrBoolConversionError returns an error with the ErrBoolConversionError ID.
func NewErrBoolInvalidExpression ¶
NewErrBoolInvalidExpression returns an error with the ErrBoolInvalidExpression ID.
func NewErrCheckOfUnknownStatementType ¶
NewErrCheckOfUnknownStatementType returns an error with the ErrCheckOfUnknownStatementType ID.
func NewErrComplexConversionError ¶
NewErrComplexConversionError returns an error with the ErrComplexConversionError ID.
func NewErrCouldNotConvert ¶
NewErrCouldNotConvert returns an error with the ErrCouldNotConvert ID.
func NewErrDidYouMeanFunction ¶
NewErrDidYouMeanFunction returns an error with the ErrDidYouMeanFunction ID.
func NewErrDidYouMeanLowercaseK ¶
NewErrDidYouMeanLowercaseK returns an error with the ErrDidYouMeanLowercaseK ID.
func NewErrDidYouMeanLowercaseV ¶
NewErrDidYouMeanLowercaseV returns an error with the ErrDidYouMeanLowercaseV ID.
func NewErrDotNotationDisallowedForKey ¶
NewErrDotNotationDisallowedForKey returns an error with the ErrDotNotationDisallowedForKey ID.
func NewErrExecOfUnknownStatementType ¶
NewErrExecOfUnknownStatementType returns an error with the ErrExecOfUnknownStatementType ID.
func NewErrExpected ¶
NewErrExpected returns an error with the ErrExpected ID.
func NewErrExpectedFrom ¶
NewErrExpectedFrom returns an error with the ErrExpectedFrom ID.
func NewErrExpectedIdentifier ¶
NewErrExpectedIdentifier returns an error with the ErrExpectedIdentifier ID.
func NewErrExpectedOperand ¶
NewErrExpectedOperand returns an error with the ErrExpectedOperand ID.
func NewErrExpectedOperator ¶
NewErrExpectedOperator returns an error with the ErrExpectedOperator ID.
func NewErrFloatConversionError ¶
NewErrFloatConversionError returns an error with the ErrFloatConversionError ID.
func NewErrFunctionArgBad ¶
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 ¶
NewErrFunctionLenInvalidArg returns an error with the ErrFunctionLenInvalidArg ID.
func NewErrFunctionNotFound ¶
NewErrFunctionNotFound returns an error with the ErrFunctionNotFound ID.
func NewErrFunctionTypeInvalidArg ¶
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 ¶
NewErrIntConversionError returns an error with the ErrIntConversionError ID.
func NewErrInvalidEscapeChar ¶
NewErrInvalidEscapeChar returns an error with the ErrInvalidEscapeChar ID.
func NewErrInvalidIndexField ¶
NewErrInvalidIndexField returns an error with the ErrInvalidIndexField ID.
func NewErrInvalidLikePattern ¶
NewErrInvalidLikePattern returns an error with the ErrInvalidLikePattern ID.
func NewErrInvalidSelectField ¶
NewErrInvalidSelectField returns an error with the ErrInvalidSelectField ID.
func NewErrIsIsNotRequireLhsValue ¶
NewErrIsIsNotRequireLhsValue returns an error with the ErrIsIsNotRequireLhsValue ID.
func NewErrIsIsNotRequireRhsNil ¶
NewErrIsIsNotRequireRhsNil returns an error with the ErrIsIsNotRequireRhsNil ID.
func NewErrKeyExpressionLiteral ¶
NewErrKeyExpressionLiteral returns an error with the ErrKeyExpressionLiteral ID.
func NewErrKeyValueStreamError ¶
NewErrKeyValueStreamError returns an error with the ErrKeyValueStreamError ID.
func NewErrLikeExpressionsRequireRhsString ¶
NewErrLikeExpressionsRequireRhsString returns an error with the ErrLikeExpressionsRequireRhsString ID.
func NewErrLimitMustBeGt0 ¶
NewErrLimitMustBeGt0 returns an error with the ErrLimitMustBeGt0 ID.
func NewErrLocationConversionError ¶
NewErrLocationConversionError returns an error with the ErrLocationConversionError ID.
func NewErrMaxStatementLenExceeded ¶
NewErrMaxStatementLenExceeded returns an error with the ErrMaxStatementLenExceeded ID.
func NewErrNoStatementFound ¶
NewErrNoStatementFound returns an error with the ErrNoStatementFound ID.
func NewErrNotEnoughParamValuesSpecified ¶
NewErrNotEnoughParamValuesSpecified returns an error with the ErrNotEnoughParamValuesSpecified ID.
func NewErrNotWritable ¶
NewErrNotWritable returns an error with the ErrNotWritable ID.
func NewErrOffsetMustBeGe0 ¶
NewErrOffsetMustBeGe0 returns an error with the ErrOffsetMustBeGe0 ID.
func NewErrOperationNotSupported ¶
NewErrOperationNotSupported returns an error with the ErrOperationNotSupported ID.
func NewErrPreparedStatementNotFound ¶
NewErrPreparedStatementNotFound returns an error with the ErrPreparedStatementNotFound ID.
func NewErrScanError ¶
NewErrScanError returns an error with the ErrScanError ID.
func NewErrStringConversionError ¶
NewErrStringConversionError returns an error with the ErrStringConversionError ID.
func NewErrTableCantAccess ¶
NewErrTableCantAccess returns an error with the ErrTableCantAccess ID.
func NewErrTimeConversionError ¶
NewErrTimeConversionError returns an error with the ErrTimeConversionError ID.
func NewErrTooManyParamValuesSpecified ¶
NewErrTooManyParamValuesSpecified returns an error with the ErrTooManyParamValuesSpecified ID.
func NewErrUintConversionError ¶
NewErrUintConversionError returns an error with the ErrUintConversionError ID.
func NewErrUnexpected ¶
NewErrUnexpected returns an error with the ErrUnexpected ID.
func NewErrUnexpectedEndOfStatement ¶
NewErrUnexpectedEndOfStatement returns an error with the ErrUnexpectedEndOfStatement ID.
func NewErrUnknownIdentifier ¶
NewErrUnknownIdentifier returns an error with the ErrUnknownIdentifier ID.
func SplitError ¶
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.