query

package
v1.18.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: MIT Imports: 53 Imported by: 3

Documentation

Index

Constants

View Source
const (
	ShowTables     = "TABLES"
	ShowViews      = "VIEWS"
	ShowCursors    = "CURSORS"
	ShowFunctions  = "FUNCTIONS"
	ShowStatements = "STATEMENTS"
	ShowFlags      = "FLAGS"
	ShowEnv        = "ENV"
	ShowRuninfo    = "RUNINFO"
)
View Source
const (
	ErrorMessageTemplate                 = "[L:%d C:%d] %s"
	ErrorMessageWithFilepathTemplate     = "%s [L:%d C:%d] %s"
	ErrorMessageWithCustomPrefixTemplate = "[%s] %s"

	ErrMsgSignalReceived = "signal received: %s"

	ErrMsgIncorrectCommandUsage                = "incorrect usage: %s"
	ErrMsgInvalidValueExpression               = "%s: cannot evaluate as a value"
	ErrMsgInvalidPath                          = "%s: %s"
	ErrMsgIO                                   = "%s"
	ErrMsgCommit                               = "failed to commit: %s"
	ErrMsgRollback                             = "failed to rollback: %s"
	ErrMsgCannotDetectFileEncoding             = "cannot detect character encoding: %s"
	ErrMsgFieldAmbiguous                       = "field %s is ambiguous"
	ErrMsgFieldNotExist                        = "field %s does not exist"
	ErrMsgFieldNotGroupKey                     = "field %s is not a group key"
	ErrMsgDuplicateFieldName                   = "field name %s is a duplicate"
	ErrMsgNotGroupingRecords                   = "function %s cannot aggregate not grouping records"
	ErrMsgNotAllowedAnalyticFunction           = "analytic function %s is only available in select clause or order by clause"
	ErrMsgUndeclaredVariable                   = "variable %s is undeclared"
	ErrMsgVariableRedeclared                   = "variable %s is redeclared"
	ErrMsgUndefinedConstant                    = "constant %s is not defined"
	ErrMsgInvalidUrl                           = "failed to parse %q as url"
	ErrMsgUnsupportedUrlScheme                 = "url scheme %s is not supported"
	ErrMsgFunctionNotExist                     = "function %s does not exist"
	ErrMsgFunctionArgumentsLength              = "function %s takes %s"
	ErrMsgFunctionInvalidArgument              = "%s for function %s"
	ErrMsgNestedAggregateFunctions             = "aggregate functions are nested at %s"
	ErrMsgFunctionRedeclared                   = "function %s is redeclared"
	ErrMsgBuiltInFunctionDeclared              = "function %s is a built-in function"
	ErrMsgDuplicateParameter                   = "parameter %s is a duplicate"
	ErrMsgSubqueryTooManyRecords               = "subquery returns too many records, should return only one record"
	ErrMsgSubqueryTooManyFields                = "subquery returns too many fields, should return only one field"
	ErrMsgJsonQueryTooManyRecords              = "json query returns too many records, should return only one record"
	ErrMsgLoadJson                             = "json loading error: %s"
	ErrMsgJsonLinesStructure                   = "json lines must be an array of objects"
	ErrMsgIncorrectLateralUsage                = "LATERAL cannot to be used in a RIGHT or FULL outer join"
	ErrMsgEmptyInlineTable                     = "inline table is empty"
	ErrMsgInvalidTableObject                   = "invalid table object: %s"
	ErrMsgTableObjectInvalidDelimiter          = "invalid delimiter: %s"
	ErrMsgTableObjectInvalidDelimiterPositions = "invalid delimiter positions: %s"
	ErrMsgTableObjectInvalidJsonQuery          = "invalid json query: %s"
	ErrMsgTableObjectArgumentsLength           = "table object %s takes at most %d arguments"
	ErrMsgTableObjectJsonArgumentsLength       = "table object %s takes exactly %d arguments"
	ErrMsgTableObjectInvalidArgument           = "invalid argument for %s: %s"
	ErrMsgCursorRedeclared                     = "cursor %s is redeclared"
	ErrMsgUndeclaredCursor                     = "cursor %s is undeclared"
	ErrMsgCursorClosed                         = "cursor %s is closed"
	ErrMsgCursorOpen                           = "cursor %s is already open"
	ErrMsgInvalidCursorStatement               = "invalid cursor statement: %s"
	ErrMsgPseudoCursor                         = "cursor %s is a pseudo cursor"
	ErrMsgCursorFetchLength                    = "fetching from cursor %s returns %s"
	ErrMsgInvalidFetchPosition                 = "fetching position %s is not an integer value"
	ErrMsgInlineTableRedefined                 = "inline table %s is redefined"
	ErrMsgUndefinedInlineTable                 = "inline table %s is undefined"
	ErrMsgInlineTableFieldLength               = "select query should return exactly %s for inline table %s"
	ErrMsgFileNotExist                         = "file %s does not exist"
	ErrMsgFileAlreadyExist                     = "file %s already exists"
	ErrMsgFileUnableToRead                     = "file %s is unable to be read"
	ErrMsgFileLockTimeout                      = "file %s: lock wait timeout period exceeded"
	ErrMsgFileNameAmbiguous                    = "filename %s is ambiguous"
	ErrMsgDataParsing                          = "data parse error in %s: %s"
	ErrMsgDataEncoding                         = "data encode error: %s"
	ErrMsgTableFieldLength                     = "select query should return exactly %s for table %s"
	ErrMsgTemporaryTableRedeclared             = "view %s is redeclared"
	ErrMsgUndeclaredTemporaryTable             = "view %s is undeclared"
	ErrMsgTemporaryTableFieldLength            = "select query should return exactly %s for view %s"
	ErrMsgDuplicateTableName                   = "table name %s is a duplicate"
	ErrMsgTableNotLoaded                       = "table %s is not loaded"
	ErrMsgStdinEmpty                           = "STDIN is empty"
	ErrMsgInlineTableCannotBeUpdated           = "inline table cannot be updated"
	ErrMsgAliasMustBeSpecifiedForUpdate        = "alias to table identification function or URL must be specified for update"
	ErrMsgRowValueLengthInComparison           = "row value should contain exactly %s"
	ErrMsgFieldLengthInComparison              = "select query should return exactly %s"
	ErrMsgInvalidLimitPercentage               = "limit percentage %s is not a float value"
	ErrMsgInvalidLimitNumber                   = "limit number of records %s is not an integer value"
	ErrMsgInvalidOffsetNumber                  = "offset number %s is not an integer value"
	ErrMsgCombinedSetFieldLength               = "result set to be combined should contain exactly %s"
	ErrMsgRecursionExceededLimit               = "iteration of recursive query exceeded the limit %d"
	ErrMsgNestedRecursion                      = "recursive queries are nested"
	ErrMsgInsertRowValueLength                 = "row value should contain exactly %s"
	ErrMsgInsertSelectFieldLength              = "select query should return exactly %s"
	ErrMsgUpdateFieldNotExist                  = "field %s does not exist in the tables to update"
	ErrMsgUpdateValueAmbiguous                 = "value %s to set in the field %s is ambiguous"
	ErrMsgReplaceKeyNotSet                     = "replace Key %s is not set"
	ErrMsgDeleteTableNotSpecified              = "tables to delete records are not specified"
	ErrMsgShowInvalidObjectType                = "object type %s is invalid"
	ErrMsgReplaceValueLength                   = "%s"
	ErrMsgSourceInvalidFilePath                = "%s is a invalid file path"
	ErrMsgInvalidFlagName                      = "%s is an unknown flag"
	ErrMsgFlagValueNowAllowedFormat            = "%s for %s is not allowed"
	ErrMsgInvalidFlagValue                     = "%s"
	ErrMsgAddFlagNotSupportedName              = "add flag element syntax does not support %s"
	ErrMsgRemoveFlagNotSupportedName           = "remove flag element syntax does not support %s"
	ErrMsgInvalidFlagValueToBeRemoved          = "%s is an invalid value for %s to specify the element"
	ErrMsgInvalidRuntimeInformation            = "%s is an unknown runtime information"
	ErrMsgNotTable                             = "table attributes can only be set on files"
	ErrMsgInvalidTableAttributeName            = "table attribute %s does not exist"
	ErrMsgTableAttributeValueNotAllowedFormat  = "%s for %s is not allowed"
	ErrMsgInvalidTableAttributeValue           = "%s"
	ErrMsgInvalidEventName                     = "%s is an unknown event"
	ErrMsgInternalRecordIdNotExist             = "internal record id does not exist"
	ErrMsgInternalRecordIdEmpty                = "internal record id is empty"
	ErrMsgFieldLengthNotMatch                  = "field length does not match"
	ErrMsgRowValueLengthInList                 = "row value length does not match at index %d"
	ErrMsgFormatStringLengthNotMatch           = "number of replace values does not match"
	ErrMsgUnknownFormatPlaceholder             = "%q is an unknown placeholder"
	ErrMsgFormatUnexpectedTermination          = "unexpected termination of format string"
	ErrMsgExternalCommand                      = "external command: %s"
	ErrMsgHttpRequest                          = "failed to get resource from %s: %s"
	ErrMsgInvalidReloadType                    = "%s is an unknown reload type"
	ErrMsgLoadConfiguration                    = "configuration loading error: %s"
	ErrMsgDuplicateStatementName               = "statement %s is a duplicate"
	ErrMsgStatementNotExist                    = "statement %s does not exist"
	ErrMsgStatementReplaceValueNotSpecified    = "replace value for %s is not specified"
	ErrMsgSelectIntoQueryFieldLengthNotMatch   = "select into query should return exactly %s"
	ErrMsgSelectIntoQueryTooManyRecords        = "select into query returns too many records, should return only one record"
	ErrMsgIntegerDevidedByZero                 = "integer divided by zero"
)
View Source
const (
	ReturnCodeApplicationError          = 1
	ReturnCodeIncorrectUsage            = 2
	ReturnCodeSyntaxError               = 4
	ReturnCodeContextDone               = 8
	ReturnCodeIOError                   = 16
	ReturnCodeSystemError               = 32
	ReturnCodeDefaultUserTriggeredError = 64
)
View Source
const (
	//Application Error
	ErrorFatal                                = 1
	ErrorCannotDetectFileEncoding             = 10001
	ErrorFieldAmbiguous                       = 10101
	ErrorFieldNotExist                        = 10102
	ErrorFieldNotGroupKey                     = 10103
	ErrorDuplicateFieldName                   = 10104
	ErrorNotGroupingRecords                   = 10201
	ErrorNotAllowedAnalyticFunction           = 10202
	ErrorUndeclaredVariable                   = 10301
	ErrorVariableRedeclared                   = 10302
	ErrorUndefinedConstant                    = 10321
	ErrorInvalidUrl                           = 10341
	ErrorUnsupportedUrlScheme                 = 10342
	ErrorFunctionNotExist                     = 10401
	ErrorFunctionArgumentsLength              = 10402
	ErrorFunctionInvalidArgument              = 10403
	ErrorFunctionRedeclared                   = 10501
	ErrorBuiltInFunctionDeclared              = 10502
	ErrorDuplicateParameter                   = 10503
	ErrorSubqueryTooManyRecords               = 10601
	ErrorSubqueryTooManyFields                = 10602
	ErrorJsonQueryTooManyRecords              = 10701
	ErrorLoadJson                             = 10702
	ErrorEmptyJsonQuery                       = 10703 // Not in use after v1.14.0
	ErrorJsonLinesStructure                   = 10704
	ErrorEmptyJsonTable                       = 10801 // Not in use after v1.14.0
	ErrorIncorrectLateralUsage                = 10802
	ErrorEmptyInlineTable                     = 10803
	ErrorInvalidTableObject                   = 10901
	ErrorTableObjectInvalidDelimiter          = 10902
	ErrorTableObjectInvalidDelimiterPositions = 10903
	ErrorTableObjectInvalidJsonQuery          = 10904
	ErrorTableObjectArgumentsLength           = 10905
	ErrorTableObjectJsonArgumentsLength       = 10906
	ErrorTableObjectInvalidArgument           = 10907
	ErrorCursorRedeclared                     = 11001
	ErrorUndeclaredCursor                     = 11002
	ErrorCursorClosed                         = 11003
	ErrorCursorOpen                           = 11004
	ErrorInvalidCursorStatement               = 11005
	ErrorPseudoCursor                         = 11006
	ErrorCursorFetchLength                    = 11007
	ErrorInvalidFetchPosition                 = 11008
	ErrorInlineTableRedefined                 = 11101
	ErrorUndefinedInlineTable                 = 11102
	ErrorInlineTableFieldLength               = 11103
	ErrorFileNameAmbiguous                    = 11201
	ErrorDataParsing                          = 11301
	ErrorDataEncoding                         = 11351
	ErrorTableFieldLength                     = 11401
	ErrorTemporaryTableRedeclared             = 11501
	ErrorUndeclaredTemporaryTable             = 11502
	ErrorTemporaryTableFieldLength            = 11503
	ErrorDuplicateTableName                   = 11601
	ErrorTableNotLoaded                       = 11602
	ErrorStdinEmpty                           = 11603
	ErrorInlineTableCannotBeUpdated           = 11604
	ErrorAliasMustBeSpecifiedForUpdate        = 11605
	ErrorRowValueLengthInComparison           = 11701
	ErrorFieldLengthInComparison              = 11702
	ErrorInvalidLimitPercentage               = 11801
	ErrorInvalidLimitNumber                   = 11802
	ErrorInvalidOffsetNumber                  = 11901
	ErrorCombinedSetFieldLength               = 12001
	ErrorRecursionExceededLimit               = 12002
	ErrorNestedRecursion                      = 12003
	ErrorInsertRowValueLength                 = 12101
	ErrorInsertSelectFieldLength              = 12102
	ErrorUpdateFieldNotExist                  = 12201
	ErrorUpdateValueAmbiguous                 = 12202
	ErrorDeleteTableNotSpecified              = 12301
	ErrorShowInvalidObjectType                = 12401
	ErrorReplaceValueLength                   = 12501
	ErrorSourceInvalidFilePath                = 12601
	ErrorInvalidFlagName                      = 12701
	ErrorFlagValueNowAllowedFormat            = 12702
	ErrorInvalidFlagValue                     = 12703
	ErrorAddFlagNotSupportedName              = 12801
	ErrorRemoveFlagNotSupportedName           = 12802
	ErrorInvalidFlagValueToBeRemoved          = 12803
	ErrorInvalidRuntimeInformation            = 12901
	ErrorNotTable                             = 13001
	ErrorInvalidTableAttributeName            = 13002
	ErrorTableAttributeValueNotAllowedFormat  = 13003
	ErrorInvalidTableAttributeValue           = 13004
	ErrorInvalidEventName                     = 13101
	ErrorInternalRecordIdNotExist             = 13201
	ErrorInternalRecordIdEmpty                = 13202
	ErrorFieldLengthNotMatch                  = 13301
	ErrorRowValueLengthInList                 = 13401
	ErrorFormatStringLengthNotMatch           = 13501
	ErrorUnknownFormatPlaceholder             = 13502
	ErrorFormatUnexpectedTermination          = 13503
	ErrorInvalidReloadType                    = 13601
	ErrorLoadConfiguration                    = 13701
	ErrorDuplicateStatementName               = 13801
	ErrorStatementNotExist                    = 13802
	ErrorStatementReplaceValueNotSpecified    = 13803
	ErrorReplaceKeyNotSet                     = 13901
	ErrorSelectIntoQueryFieldLengthNotMatch   = 14001
	ErrorSelectIntoQueryTooManyRecords        = 14002
	ErrorIntegerDevidedByZero                 = 30000

	//Incorrect Command Usage
	ErrorIncorrectCommandUsage = 90020

	//Syntax Error
	ErrorSyntaxError                  = 90040
	ErrorInvalidValueExpression       = 90041
	ErrorNestedAggregateFunctions     = 90042
	ErrorPreparedStatementSyntaxError = 90043

	//Context Error
	ErrorContextDone     = 90080
	ErrorContextCanceled = 90081
	ErrorFileLockTimeout = 90082

	//IO Error
	ErrorIO               = 90160
	ErrorCommit           = 90171
	ErrorRollback         = 90172
	ErrorInvalidPath      = 90180
	ErrorFileNotExist     = 90181
	ErrorFileAlreadyExist = 90182
	ErrorFileUnableToRead = 90183

	//System Error
	ErrorSystemError      = 90320
	ErrorExternalCommand  = 30330
	ErrorHttpRequestError = 30400

	//User Triggered Error
	ErrorExit          = 90640
	ErrorUserTriggered = 90650
)
View Source
const (
	TableDelimiter          = "DELIMITER"
	TableDelimiterPositions = "DELIMITER_POSITIONS"
	TableFormat             = "FORMAT"
	TableEncoding           = "ENCODING"
	TableLineBreak          = "LINE_BREAK"
	TableHeader             = "HEADER"
	TableEncloseAll         = "ENCLOSE_ALL"
	TableJsonEscape         = "JSON_ESCAPE"
	TablePrettyPrint        = "PRETTY_PRINT"
)
View Source
const (
	UncommittedInformation  = "UNCOMMITTED"
	CreatedInformation      = "CREATED"
	UpdatedInformation      = "UPDATED"
	UpdatedViewsInformation = "UPDATED_VIEWS"
	LoadedTablesInformation = "LOADED_TABLES"
	WorkingDirectory        = "WORKING_DIRECTORY"
	VersionInformation      = "VERSION"
)
View Source
const DefaultScreenWidth = 75
View Source
const DefaultUserTriggeredErrorMessage = "triggered error"
View Source
const EOF = -1
View Source
const ExitMessage = "exit"
View Source
const IgnoredFlagPrefix = "(ignored) "
View Source
const InternalIdColumn = "@__internal_id"
View Source
const LimitToUseFieldIndexSliceChache = 8
View Source
const LimitToUseUintSlicePool = 20
View Source
const MinimumRequiredPerCPUCore = 80
View Source
const (
	ReloadConfig = "CONFIG"
)
View Source
const StatementReplaceValuesContextKey = "rv"
View Source
const StoringResultsContextKey = "sqr"

Variables

View Source
var AggregateFunctions = map[string]AggregateFunction{
	"COUNT":  Count,
	"MAX":    Max,
	"MIN":    Min,
	"SUM":    Sum,
	"AVG":    Avg,
	"STDEV":  StdEV,
	"STDEVP": StdEVP,
	"VAR":    Var,
	"VARP":   VarP,
	"MEDIAN": Median,
}
View Source
var AnalyticFunctions = map[string]AnalyticFunction{
	"ROW_NUMBER":   RowNumber{},
	"RANK":         Rank{},
	"DENSE_RANK":   DenseRank{},
	"CUME_DIST":    CumeDist{},
	"PERCENT_RANK": PercentRank{},
	"NTILE":        NTile{},
	"FIRST_VALUE":  FirstValue{},
	"LAST_VALUE":   LastValue{},
	"NTH_VALUE":    NthValue{},
	"LAG":          Lag{},
	"LEAD":         Lead{},
	"LISTAGG":      AnalyticListAgg{},
	"JSON_AGG":     AnalyticJsonAgg{},
}
View Source
var DataEmpty = errors.New("data empty")
View Source
var EmptyResultSetError = errors.New("empty result set")
View Source
var Functions = map[string]BuiltInFunction{}/* 124 elements not displayed */
View Source
var RegExps = NewRegExpMap()
View Source
var Version = "v1.18.1"

Functions

func Abs

func Abs(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Acos

func Acos(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Acosh

func Acosh(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func AddDay

func AddDay(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func AddFlagElement

func AddFlagElement(ctx context.Context, scope *ReferenceScope, expr parser.AddFlagElement) error

func AddHour

func AddHour(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func AddMicro

func AddMicro(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func AddMilli

func AddMilli(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func AddMinute

func AddMinute(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func AddMonth

func AddMonth(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func AddNano

func AddNano(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func AddSecond

func AddSecond(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func AddYear

func AddYear(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func All

func All(rowValue value.RowValue, list []value.RowValue, operator string, datetimeFormats []string, location *time.Location) (ternary.Value, error)

func Analyze

func Analyze(ctx context.Context, scope *ReferenceScope, view *View, fn parser.AnalyticFunction, partitionIndices []int) error

func Any

func Any(rowValue value.RowValue, list []value.RowValue, operator string, datetimeFormats []string, location *time.Location) (ternary.Value, error)

func Asin

func Asin(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Asinh

func Asinh(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Atan

func Atan(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Atan2

func Atan2(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Atanh

func Atanh(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Avg

func Avg(list []value.Primary, _ *option.Flags) value.Primary

func Base64Decode

func Base64Decode(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Base64Encode

func Base64Encode(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Bin

func Bin(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func BinToDec

func BinToDec(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Boolean

func Boolean(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func ByteLen

func ByteLen(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func CalcMinimumRequired

func CalcMinimumRequired(i1 int, i2 int, defaultMinimumRequired int) int

func Calculate

func Calculate(p1 value.Primary, p2 value.Primary, operator int) (value.Primary, error)

func Call

func Call(ctx context.Context, fn parser.Function, args []value.Primary) (value.Primary, error)

func Cbrt

func Cbrt(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Ceil

func Ceil(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Chdir

func Chdir(ctx context.Context, scope *ReferenceScope, expr parser.Chdir) error

func CheckArgsLen

func CheckArgsLen(expr parser.AnalyticFunction, length []int) error

func Coalesce

func Coalesce(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func ContextForPreparedStatement

func ContextForPreparedStatement(ctx context.Context, values *ReplaceValues) context.Context

func ContextForStoringResults

func ContextForStoringResults(ctx context.Context) context.Context

func ConvertContextError

func ConvertContextError(err error) error

func ConvertFieldContents

func ConvertFieldContents(val value.Primary, forTextTable bool, useScientificNotation bool) (string, string, text.FieldAlignment)

func ConvertFileHandlerError

func ConvertFileHandlerError(err error, ident parser.Identifier) error

func ConvertLoadConfigurationError

func ConvertLoadConfigurationError(err error) error

func ConvertTableFunction

func ConvertTableFunction(ctx context.Context, scope *ReferenceScope, tableFunction parser.TableFunction) (parser.QueryExpression, error)

func ConvertUrlExpr

func ConvertUrlExpr(urlExpr parser.Url) (parser.QueryExpression, error)

func Cos

func Cos(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Cosh

func Cosh(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Count

func Count(list []value.Primary, _ *option.Flags) value.Primary

func CreateFilePath

func CreateFilePath(filename parser.Identifier, repository string) (string, error)

func CrossJoin

func CrossJoin(ctx context.Context, scope *ReferenceScope, view *View, joinView *View) error

func DateDiff

func DateDiff(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func Datetime

func Datetime(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func DatetimeFormat

func DatetimeFormat(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func Day

func Day(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func DayOfYear

func DayOfYear(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func DeclareView

func DeclareView(ctx context.Context, scope *ReferenceScope, expr parser.ViewDeclaration) error

func Distinguish

func Distinguish(list []value.Primary, flags *option.Flags) []value.Primary

func Echo

func Echo(ctx context.Context, scope *ReferenceScope, expr parser.Echo) (string, error)

func EncodeView

func EncodeView(ctx context.Context, fp io.Writer, view *View, options option.ExportOptions, palette *color.Palette) (string, error)

func Enotation

func Enotation(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func EnotationToDec

func EnotationToDec(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func EvalRowValue

func EvalRowValue(ctx context.Context, scope *ReferenceScope, expr parser.QueryExpression) (value.RowValue, error)

EvalRowValue returns single or multiple fields, single record

func Evaluate

func Evaluate(ctx context.Context, scope *ReferenceScope, expr parser.QueryExpression) (value.Primary, error)

func EvaluateEmbeddedString

func EvaluateEmbeddedString(ctx context.Context, scope *ReferenceScope, embedded string) (string, error)

func EvaluateSequentially

func EvaluateSequentially(ctx context.Context, scope *ReferenceScope, view *View, fn func(*ReferenceScope, int) error) error

func Exp

func Exp(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Exp2

func Exp2(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Expm1

func Expm1(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func FetchCursor

func FetchCursor(ctx context.Context, scope *ReferenceScope, name parser.Identifier, fetchPosition parser.FetchPosition, vars []parser.Variable) (bool, error)

func Float

func Float(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Floor

func Floor(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Format

func Format(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func FormatCount

func FormatCount(i int, obj string) string

func FormatFieldIdentifier

func FormatFieldIdentifier(e parser.QueryExpression) string

func FormatFieldLabel

func FormatFieldLabel(e parser.QueryExpression) string

func FormatTableName

func FormatTableName(s string) string

func GetComparisonKeysBuf

func GetComparisonKeysBuf() *bytes.Buffer

func GetRuntimeInformation

func GetRuntimeInformation(tx *Transaction, expr parser.RuntimeInformation) (value.Primary, error)

func GetValuesInOrderByClause

func GetValuesInOrderByClause(e parser.OrderByClause) []parser.QueryExpression

func HasAggregateFunction

func HasAggregateFunction(expr parser.QueryExpression, scope *ReferenceScope) (bool, error)

func HasAggregateFunctionInList

func HasAggregateFunctionInList(list []parser.QueryExpression, scope *ReferenceScope) (bool, error)

func Hex

func Hex(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func HexDecode

func HexDecode(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func HexEncode

func HexEncode(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func HexToDec

func HexToDec(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Hour

func Hour(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func If

func If(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Ifnull

func Ifnull(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func InRowValueList

func InRowValueList(rowValue value.RowValue, list []value.RowValue, matchType int, operator string, datetimeFormats []string, location *time.Location) (ternary.Value, error)

func InStrSliceWithCaseInsensitive

func InStrSliceWithCaseInsensitive(s string, list []string) bool

func InnerJoin

func InnerJoin(ctx context.Context, scope *ReferenceScope, view *View, joinView *View, condition parser.QueryExpression) error

func Instr

func Instr(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Integer

func Integer(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Is

func IsInf

func IsInf(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func IsNaN

func IsNaN(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func JsonAgg

func JsonAgg(list []value.Primary) value.Primary

func JsonObject

func JsonObject(ctx context.Context, scope *ReferenceScope, fn parser.Function) (value.Primary, error)

func JsonValue

func JsonValue(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Len

func Len(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Like

func Like(p1 value.Primary, p2 value.Primary) ternary.Value

func ListAgg

func ListAgg(list []value.Primary, separator string) value.Primary

func ListElem

func ListElem(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func LoadContentsFromFile

func LoadContentsFromFile(ctx context.Context, tx *Transaction, fpath parser.Identifier) (content string, err error)

func LoadStatementsFromFile

func LoadStatementsFromFile(ctx context.Context, tx *Transaction, fpath parser.Identifier) (statements []parser.Statement, err error)

func Log10

func Log10(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Log1p

func Log1p(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Log2

func Log2(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Logb

func Logb(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Lower

func Lower(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Lpad

func Lpad(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func Ltrim

func Ltrim(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func MathLog

func MathLog(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Max

func Max(list []value.Primary, flags *option.Flags) value.Primary

func Md5

func Md5(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Md5Hmac

func Md5Hmac(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Median

func Median(list []value.Primary, flags *option.Flags) value.Primary

func Microsecond

func Microsecond(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func MilliToDatetime

func MilliToDatetime(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func Millisecond

func Millisecond(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func Min

func Min(list []value.Primary, flags *option.Flags) value.Primary

func Minute

func Minute(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func Month

func Month(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func NanoToDatetime

func NanoToDatetime(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func Nanosecond

func Nanosecond(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func NewAddFlagNotSupportedNameError

func NewAddFlagNotSupportedNameError(expr parser.AddFlagElement) error

func NewAliasMustBeSpecifiedForUpdateError

func NewAliasMustBeSpecifiedForUpdateError(expr parser.QueryExpression) error

func NewBuiltInFunctionDeclaredError

func NewBuiltInFunctionDeclaredError(expr parser.Identifier) error

func NewCannotDetectFileEncodingError

func NewCannotDetectFileEncodingError(file parser.QueryExpression) error

func NewCombinedSetFieldLengthError

func NewCombinedSetFieldLengthError(selectEntity parser.QueryExpression, fieldLen int) error

func NewCommitError

func NewCommitError(expr parser.Expression, message string) error

func NewContextCanceled

func NewContextCanceled(message string) error

func NewContextDone

func NewContextDone(message string) error

func NewCursorClosedError

func NewCursorClosedError(cursor parser.Identifier) error

func NewCursorFetchLengthError

func NewCursorFetchLengthError(cursor parser.Identifier, returnLen int) error

func NewCursorOpenError

func NewCursorOpenError(cursor parser.Identifier) error

func NewCursorRedeclaredError

func NewCursorRedeclaredError(cursor parser.Identifier) error

func NewDataEncodingError

func NewDataEncodingError(message string) error

func NewDataParsingError

func NewDataParsingError(file parser.QueryExpression, filepath string, message string) error

func NewDeleteTableNotSpecifiedError

func NewDeleteTableNotSpecifiedError(query parser.DeleteQuery) error

func NewDuplicateFieldNameError

func NewDuplicateFieldNameError(fieldName parser.Identifier) error

func NewDuplicateParameterError

func NewDuplicateParameterError(expr parser.Variable) error

func NewDuplicateStatementNameError

func NewDuplicateStatementNameError(name parser.Identifier) error

func NewDuplicateTableNameError

func NewDuplicateTableNameError(table parser.Identifier) error

func NewEmptyInlineTableError

func NewEmptyInlineTableError(expr parser.FormatSpecifiedFunction) error

func NewExternalCommandError

func NewExternalCommandError(expr parser.Expression, message string) error

func NewFatalError

func NewFatalError(panicReport interface{}) error

func NewFieldAmbiguousError

func NewFieldAmbiguousError(field parser.QueryExpression) error

func NewFieldLengthNotMatchError

func NewFieldLengthNotMatchError(expr parser.QueryExpression) error

func NewFieldNotExistError

func NewFieldNotExistError(field parser.QueryExpression) error

func NewFieldNotGroupKeyError

func NewFieldNotGroupKeyError(field parser.QueryExpression) error

func NewFileAlreadyExistError

func NewFileAlreadyExistError(file parser.Identifier) error

func NewFileLockTimeoutError

func NewFileLockTimeoutError(file parser.Identifier) error

func NewFileNameAmbiguousError

func NewFileNameAmbiguousError(file parser.Identifier) error

func NewFileNotExistError

func NewFileNotExistError(file parser.QueryExpression) error

func NewFileUnableToReadError

func NewFileUnableToReadError(file parser.Identifier) error

func NewFlagValueNotAllowedFormatError

func NewFlagValueNotAllowedFormatError(setFlag parser.SetFlag) error

func NewForcedExit

func NewForcedExit(code int) error

func NewFormatStringLengthNotMatchError

func NewFormatStringLengthNotMatchError() error

func NewFormatUnexpectedTerminationError

func NewFormatUnexpectedTerminationError() error

func NewFunctionArgumentLengthError

func NewFunctionArgumentLengthError(expr parser.QueryExpression, funcname string, argslen []int) error

func NewFunctionArgumentLengthErrorWithCustomArgs

func NewFunctionArgumentLengthErrorWithCustomArgs(expr parser.QueryExpression, funcname string, argstr string) error

func NewFunctionInvalidArgumentError

func NewFunctionInvalidArgumentError(function parser.QueryExpression, funcname string, message string) error

func NewFunctionNotExistError

func NewFunctionNotExistError(expr parser.QueryExpression, funcname string) error

func NewFunctionRedeclaredError

func NewFunctionRedeclaredError(expr parser.Identifier) error

func NewHttpRequestError

func NewHttpRequestError(expr parser.Expression, url string, message string) error

func NewIOError

func NewIOError(expr parser.QueryExpression, message string) error

func NewInLineTableRedefinedError

func NewInLineTableRedefinedError(table parser.Identifier) error

func NewIncorrectCommandUsageError

func NewIncorrectCommandUsageError(message string) error

func NewIncorrectLateralUsageError

func NewIncorrectLateralUsageError(expr parser.Table) error

func NewInlineTableCannotBeUpdatedError

func NewInlineTableCannotBeUpdatedError(expr parser.QueryExpression) error

func NewInlineTableFieldLengthError

func NewInlineTableFieldLengthError(query parser.SelectQuery, table parser.Identifier, fieldLen int) error

func NewInsertRowValueLengthError

func NewInsertRowValueLengthError(rowValue parser.RowValue, valueLen int) error

func NewInsertSelectFieldLengthError

func NewInsertSelectFieldLengthError(query parser.SelectQuery, fieldLen int) error

func NewIntegerDevidedByZeroError

func NewIntegerDevidedByZeroError(expr parser.Arithmetic) error

func NewInternalRecordIdEmptyError

func NewInternalRecordIdEmptyError() error

func NewInternalRecordIdNotExistError

func NewInternalRecordIdNotExistError() error

func NewInvalidCursorStatementError

func NewInvalidCursorStatementError(statement parser.Identifier) error

func NewInvalidEventNameError

func NewInvalidEventNameError(expr parser.Identifier) error

func NewInvalidFetchPositionError

func NewInvalidFetchPositionError(position parser.FetchPosition) error

func NewInvalidFlagNameError

func NewInvalidFlagNameError(expr parser.Flag) error

func NewInvalidFlagValueError

func NewInvalidFlagValueError(expr parser.SetFlag, message string) error

func NewInvalidFlagValueToBeRemovedError

func NewInvalidFlagValueToBeRemovedError(unsetFlag parser.RemoveFlagElement) error

func NewInvalidLimitNumberError

func NewInvalidLimitNumberError(clause parser.LimitClause) error

func NewInvalidLimitPercentageError

func NewInvalidLimitPercentageError(clause parser.LimitClause) error

func NewInvalidOffsetNumberError

func NewInvalidOffsetNumberError(clause parser.OffsetClause) error

func NewInvalidPathError

func NewInvalidPathError(expr parser.Expression, path string, message string) error

func NewInvalidReloadTypeError

func NewInvalidReloadTypeError(expr parser.Reload, name string) error

func NewInvalidRuntimeInformationError

func NewInvalidRuntimeInformationError(expr parser.RuntimeInformation) error

func NewInvalidTableAttributeNameError

func NewInvalidTableAttributeNameError(expr parser.Identifier) error

func NewInvalidTableAttributeValueError

func NewInvalidTableAttributeValueError(expr parser.SetTableAttribute, message string) error

func NewInvalidTableObjectError

func NewInvalidTableObjectError(expr parser.FormatSpecifiedFunction, objectName string) error

func NewInvalidUrlError

func NewInvalidUrlError(expr parser.Url) error

func NewInvalidValueExpressionError

func NewInvalidValueExpressionError(expr parser.QueryExpression) error

func NewJsonLinesStructureError

func NewJsonLinesStructureError(expr parser.QueryExpression) error

func NewJsonQueryTooManyRecordsError

func NewJsonQueryTooManyRecordsError(expr parser.JsonQuery) error

func NewLoadConfigurationError

func NewLoadConfigurationError(expr parser.Expression, message string) error

func NewLoadJsonError

func NewLoadJsonError(expr parser.QueryExpression, message string) error

func NewNestedAggregateFunctionsError

func NewNestedAggregateFunctionsError(expr parser.QueryExpression) error

func NewNestedRecursionError

func NewNestedRecursionError(expr parser.QueryExpression) error

func NewNotAllowedAnalyticFunctionError

func NewNotAllowedAnalyticFunctionError(expr parser.AnalyticFunction) error

func NewNotGroupingRecordsError

func NewNotGroupingRecordsError(expr parser.QueryExpression, funcname string) error

func NewNotTableError

func NewNotTableError(expr parser.QueryExpression) error

func NewPreparedStatementSyntaxError

func NewPreparedStatementSyntaxError(err *parser.SyntaxError) error

func NewPseudoCursorError

func NewPseudoCursorError(cursor parser.Identifier) error

func NewRecursionExceededLimitError

func NewRecursionExceededLimitError(selectEntity parser.QueryExpression, limit int64) error

func NewRemoveFlagNotSupportedNameError

func NewRemoveFlagNotSupportedNameError(expr parser.RemoveFlagElement) error

func NewReplaceKeyNotSetError

func NewReplaceKeyNotSetError(key parser.QueryExpression) error

func NewReplaceValueLengthError

func NewReplaceValueLengthError(expr parser.Expression, message string) error

func NewRollbackError

func NewRollbackError(expr parser.Expression, message string) error

func NewRowValueLengthInComparisonError

func NewRowValueLengthInComparisonError(expr parser.QueryExpression, valueLen int) error

func NewRowValueLengthInListError

func NewRowValueLengthInListError(i int) error

func NewSelectFieldLengthInComparisonError

func NewSelectFieldLengthInComparisonError(query parser.Subquery, valueLen int) error

func NewSelectIntoQueryFieldLengthNotMatchError

func NewSelectIntoQueryFieldLengthNotMatchError(query parser.SelectQuery, fieldLen int) error

func NewSelectIntoQueryTooManyRecordsError

func NewSelectIntoQueryTooManyRecordsError(query parser.SelectQuery) error

func NewShowInvalidObjectTypeError

func NewShowInvalidObjectTypeError(expr parser.Expression, objectType string) error

func NewSignalReceived

func NewSignalReceived(sig os.Signal) error

func NewSourceInvalidFilePathError

func NewSourceInvalidFilePathError(source parser.Source, arg parser.QueryExpression) error

func NewStatementNotExistError

func NewStatementNotExistError(name parser.Identifier) error

func NewStatementReplaceValueNotSpecifiedError

func NewStatementReplaceValueNotSpecifiedError(placeholder parser.Placeholder) error

func NewStdinEmptyError

func NewStdinEmptyError(stdin parser.Stdin) error

func NewSubqueryTooManyFieldsError

func NewSubqueryTooManyFieldsError(expr parser.Subquery) error

func NewSubqueryTooManyRecordsError

func NewSubqueryTooManyRecordsError(expr parser.Subquery) error

func NewSyntaxError

func NewSyntaxError(err *parser.SyntaxError) error

func NewSystemError

func NewSystemError(message string) error

func NewTableAttributeUnchangedError

func NewTableAttributeUnchangedError(fpath string) error

func NewTableAttributeValueNotAllowedFormatError

func NewTableAttributeValueNotAllowedFormatError(expr parser.SetTableAttribute) error

func NewTableFieldLengthError

func NewTableFieldLengthError(query parser.SelectQuery, table parser.Identifier, fieldLen int) error

func NewTableNotLoadedError

func NewTableNotLoadedError(table parser.Identifier) error

func NewTableObjectArgumentsLengthError

func NewTableObjectArgumentsLengthError(expr parser.FormatSpecifiedFunction, argLen int) error

func NewTableObjectInvalidArgumentError

func NewTableObjectInvalidArgumentError(expr parser.FormatSpecifiedFunction, message string) error

func NewTableObjectInvalidDelimiterError

func NewTableObjectInvalidDelimiterError(expr parser.FormatSpecifiedFunction, delimiter string) error

func NewTableObjectInvalidDelimiterPositionsError

func NewTableObjectInvalidDelimiterPositionsError(expr parser.FormatSpecifiedFunction, positions string) error

func NewTableObjectInvalidJsonQueryError

func NewTableObjectInvalidJsonQueryError(expr parser.FormatSpecifiedFunction, jsonQuery string) error

func NewTableObjectJsonArgumentsLengthError

func NewTableObjectJsonArgumentsLengthError(expr parser.FormatSpecifiedFunction, argLen int) error

func NewTemporaryTableFieldLengthError

func NewTemporaryTableFieldLengthError(query parser.SelectQuery, table parser.Identifier, fieldLen int) error

func NewTemporaryTableRedeclaredError

func NewTemporaryTableRedeclaredError(table parser.Identifier) error

func NewUndeclaredCursorError

func NewUndeclaredCursorError(cursor parser.Identifier) error

func NewUndeclaredTemporaryTableError

func NewUndeclaredTemporaryTableError(table parser.QueryExpression) error

func NewUndeclaredVariableError

func NewUndeclaredVariableError(expr parser.Variable) error

func NewUndefinedConstantError

func NewUndefinedConstantError(expr parser.Constant) error

func NewUndefinedInLineTableError

func NewUndefinedInLineTableError(table parser.Identifier) error

func NewUnknownFormatPlaceholderError

func NewUnknownFormatPlaceholderError(placeholder rune) error

func NewUnsupportedUrlSchemeError

func NewUnsupportedUrlSchemeError(expr parser.Url, scheme string) error

func NewUpdateFieldNotExistError

func NewUpdateFieldNotExistError(field parser.QueryExpression) error

func NewUpdateValueAmbiguousError

func NewUpdateValueAmbiguousError(field parser.QueryExpression, value parser.QueryExpression) error

func NewUserTriggeredError

func NewUserTriggeredError(expr parser.Trigger, message string) error

func NewVariableRedeclaredError

func NewVariableRedeclaredError(expr parser.Variable) error

func NormalizeTableObject

func NormalizeTableObject(ctx context.Context, scope *ReferenceScope, tableObject parser.QueryExpression) (parser.QueryExpression, error)

func Now

func Now(scope *ReferenceScope, fn parser.Function, args []value.Primary) (value.Primary, error)

func Nullif

func Nullif(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func NumberFormat

func NumberFormat(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Oct

func Oct(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func OctToDec

func OctToDec(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func OuterJoin

func OuterJoin(ctx context.Context, scope *ReferenceScope, view *View, joinView *View, condition parser.QueryExpression, direction int) error

func ParseExecuteStatements

func ParseExecuteStatements(ctx context.Context, scope *ReferenceScope, expr parser.Execute) ([]parser.Statement, error)

func ParseJoinCondition

func ParseJoinCondition(join parser.Join, view *View, joinView *View) (parser.QueryExpression, []parser.FieldReference, []parser.FieldReference, error)

func ParseTableName

func ParseTableName(ctx context.Context, scope *ReferenceScope, table parser.Table) (parser.Identifier, error)

func Pow

func Pow(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Print

func Print(ctx context.Context, scope *ReferenceScope, expr parser.Print) (string, error)

func Printf

func Printf(ctx context.Context, scope *ReferenceScope, expr parser.Printf) (string, error)

func PutBlockScope

func PutBlockScope(scope BlockScope)

func PutComparisonkeysBuf

func PutComparisonkeysBuf(buf *bytes.Buffer)

func PutNodeScope

func PutNodeScope(scope NodeScope)

func Pwd

func Pwd(expr parser.Pwd) (string, error)

func Rand

func Rand(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func RegExpFind

func RegExpFind(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func RegExpFindAll

func RegExpFindAll(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func RegExpFindSubMatches

func RegExpFindSubMatches(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func RegExpMatch

func RegExpMatch(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func RegExpReplace

func RegExpReplace(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Reload

func Reload(ctx context.Context, tx *Transaction, expr parser.Reload) error

func RemoveFlagElement

func RemoveFlagElement(ctx context.Context, scope *ReferenceScope, expr parser.RemoveFlagElement) error

func ReplaceFn

func ReplaceFn(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Round

func Round(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Rpad

func Rpad(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func Rtrim

func Rtrim(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func SearchAnalyticFunctions

func SearchAnalyticFunctions(expr parser.QueryExpression) ([]parser.AnalyticFunction, error)

func SearchAnalyticFunctionsInList

func SearchAnalyticFunctionsInList(list []parser.QueryExpression) ([]parser.AnalyticFunction, error)

func SearchCSVFilePath

func SearchCSVFilePath(filename parser.Identifier, repository string) (string, error)

func SearchFilePath

func SearchFilePath(filename parser.Identifier, repository string, options option.ImportOptions, defaultFormat option.Format) (string, option.Format, error)

func SearchFilePathFromAllTypes

func SearchFilePathFromAllTypes(filename parser.Identifier, repository string) (string, error)

func SearchFilePathWithExtType

func SearchFilePathWithExtType(filename parser.Identifier, repository string, extTypes []string) (string, error)

func SearchFixedLengthFilePath

func SearchFixedLengthFilePath(filename parser.Identifier, repository string) (string, error)

func SearchJsonFilePath

func SearchJsonFilePath(filename parser.Identifier, repository string) (string, error)

func SearchJsonlFilePath

func SearchJsonlFilePath(filename parser.Identifier, repository string) (string, error)

func SearchLTSVFilePath

func SearchLTSVFilePath(filename parser.Identifier, repository string) (string, error)

func Second

func Second(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func SerializeComparisonKeys

func SerializeComparisonKeys(buf *bytes.Buffer, values []value.Primary, flags *option.Flags)

func SerializeIdenticalKey

func SerializeIdenticalKey(buf *bytes.Buffer, val value.Primary)

func SerializeKey

func SerializeKey(buf *bytes.Buffer, val value.Primary, flags *option.Flags)

func SetEnvVar

func SetEnvVar(ctx context.Context, scope *ReferenceScope, expr parser.SetEnvVar) error

func SetFlag

func SetFlag(ctx context.Context, scope *ReferenceScope, expr parser.SetFlag) error

func Sha1

func Sha1(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Sha1Hmac

func Sha1Hmac(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Sha256

func Sha256(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Sha256Hmac

func Sha256Hmac(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Sha512

func Sha512(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Sha512Hmac

func Sha512Hmac(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func ShowFields

func ShowFields(ctx context.Context, scope *ReferenceScope, expr parser.ShowFields) (string, error)

func ShowFlag

func ShowFlag(tx *Transaction, expr parser.ShowFlag) (string, error)

func ShowObjects

func ShowObjects(scope *ReferenceScope, expr parser.ShowObjects) (string, error)

func Sin

func Sin(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Sinh

func Sinh(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Source

func Source(ctx context.Context, scope *ReferenceScope, expr parser.Source) ([]parser.Statement, error)

func Sqrt

func Sqrt(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func StdEV

func StdEV(list []value.Primary, _ *option.Flags) value.Primary

func StdEVP

func StdEVP(list []value.Primary, _ *option.Flags) value.Primary

func String

func String(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Substr

func Substr(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Substring

func Substring(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Sum

func Sum(list []value.Primary, _ *option.Flags) value.Primary

func Syntax

func Syntax(ctx context.Context, scope *ReferenceScope, expr parser.Syntax) (string, error)

func Tan

func Tan(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Tanh

func Tanh(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Ternary

func Ternary(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func TimeDiff

func TimeDiff(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func TimeNanoDiff

func TimeNanoDiff(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func TitleCase

func TitleCase(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Trim

func Trim(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func TruncDay

func TruncDay(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func TruncMicro

func TruncMicro(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func TruncMilli

func TruncMilli(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func TruncMinute

func TruncMinute(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func TruncMonth

func TruncMonth(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func TruncNano

func TruncNano(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func TruncSecond

func TruncSecond(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func TruncTime

func TruncTime(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func UTC

func UTC(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func UnixNanoTime

func UnixNanoTime(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func UnixTime

func UnixTime(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func UnsetEnvVar

func UnsetEnvVar(expr parser.UnsetEnvVar) error

func Upper

func Upper(fn parser.Function, args []value.Primary, _ *option.Flags) (value.Primary, error)

func Var

func Var(list []value.Primary, _ *option.Flags) value.Primary

func VarP

func VarP(list []value.Primary, _ *option.Flags) value.Primary

func WeekOfYear

func WeekOfYear(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func Weekday

func Weekday(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func Width

func Width(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

func Year

func Year(fn parser.Function, args []value.Primary, flags *option.Flags) (value.Primary, error)

Types

type AddFlagNotSupportedNameError

type AddFlagNotSupportedNameError struct {
	*BaseError
}

type AggregateFunction

type AggregateFunction func([]value.Primary, *option.Flags) value.Primary

type AliasMap

type AliasMap map[string]string

func (AliasMap) Add

func (m AliasMap) Add(alias parser.Identifier, path string) error

func (AliasMap) Clear

func (m AliasMap) Clear()

func (AliasMap) Get

func (m AliasMap) Get(alias parser.Identifier) (string, error)

type AliasMustBeSpecifiedForUpdateError

type AliasMustBeSpecifiedForUpdateError struct {
	*BaseError
}

type AnalyticFunction

type AnalyticFunction interface {
	CheckArgsLen(expr parser.AnalyticFunction) error
	Execute(context.Context, *ReferenceScope, Partition, parser.AnalyticFunction) (map[int]value.Primary, error)
}

type AnalyticJsonAgg

type AnalyticJsonAgg struct{}

func (AnalyticJsonAgg) CheckArgsLen

func (fn AnalyticJsonAgg) CheckArgsLen(expr parser.AnalyticFunction) error

func (AnalyticJsonAgg) Execute

func (fn AnalyticJsonAgg) Execute(ctx context.Context, scope *ReferenceScope, partition Partition, expr parser.AnalyticFunction) (map[int]value.Primary, error)

type AnalyticListAgg

type AnalyticListAgg struct{}

func (AnalyticListAgg) CheckArgsLen

func (fn AnalyticListAgg) CheckArgsLen(expr parser.AnalyticFunction) error

func (AnalyticListAgg) Execute

func (fn AnalyticListAgg) Execute(ctx context.Context, scope *ReferenceScope, partition Partition, expr parser.AnalyticFunction) (map[int]value.Primary, error)

type BaseError

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

func NewBaseError

func NewBaseError(expr parser.Expression, message string, code int, number int) *BaseError

func NewBaseErrorWithPrefix

func NewBaseErrorWithPrefix(prefix string, message string, code int, number int) *BaseError

func (*BaseError) Char

func (e *BaseError) Char() int

func (*BaseError) Code

func (e *BaseError) Code() int

func (*BaseError) Error

func (e *BaseError) Error() string

func (*BaseError) Line

func (e *BaseError) Line() int

func (*BaseError) Message

func (e *BaseError) Message() string

func (*BaseError) Number

func (e *BaseError) Number() int

func (*BaseError) Source

func (e *BaseError) Source() string

type BlockScope

type BlockScope struct {
	Variables       VariableMap
	TemporaryTables ViewMap
	Cursors         CursorMap
	Functions       UserDefinedFunctionMap
}

func GetBlockScope

func GetBlockScope() BlockScope

func NewBlockScope

func NewBlockScope() BlockScope

func (BlockScope) Clear

func (scope BlockScope) Clear()

type BuiltInFunction

type BuiltInFunction func(parser.Function, []value.Primary, *option.Flags) (value.Primary, error)

type BuiltInFunctionDeclaredError

type BuiltInFunctionDeclaredError struct {
	*BaseError
}

type CannotDetectFileEncodingError

type CannotDetectFileEncodingError struct {
	*BaseError
}

type Cell

type Cell []value.Primary

func NewCell

func NewCell(val value.Primary) Cell

func NewGroupCell

func NewGroupCell(values []value.Primary) Cell

type CombinedSetFieldLengthError

type CombinedSetFieldLengthError struct {
	*BaseError
}

type CommitError

type CommitError struct {
	*BaseError
}

type ContextCanceled

type ContextCanceled struct {
	*BaseError
}

type ContextDone

type ContextDone struct {
	*BaseError
}

type CumeDist

type CumeDist struct{}

func (CumeDist) CheckArgsLen

func (fn CumeDist) CheckArgsLen(expr parser.AnalyticFunction) error

func (CumeDist) Execute

func (fn CumeDist) Execute(_ context.Context, scope *ReferenceScope, partition Partition, _ parser.AnalyticFunction) (map[int]value.Primary, error)

type Cursor

type Cursor struct {
	Name string
	// contains filtered or unexported fields
}

func NewCursor

func NewCursor(e parser.CursorDeclaration) *Cursor

func NewPseudoCursor

func NewPseudoCursor(name string, values []value.Primary) *Cursor

func (*Cursor) Close

func (c *Cursor) Close(name parser.Identifier) error

func (*Cursor) Count

func (c *Cursor) Count() (int, error)

func (*Cursor) Fetch

func (c *Cursor) Fetch(name parser.Identifier, position int, number int) ([]value.Primary, error)

func (*Cursor) IsInRange

func (c *Cursor) IsInRange() (ternary.Value, error)

func (*Cursor) IsOpen

func (c *Cursor) IsOpen() ternary.Value

func (*Cursor) Open

func (c *Cursor) Open(ctx context.Context, scope *ReferenceScope, name parser.Identifier, values []parser.ReplaceValue) error

func (*Cursor) Pointer

func (c *Cursor) Pointer() (int, error)

type CursorClosedError

type CursorClosedError struct {
	*BaseError
}

type CursorFetchLengthError

type CursorFetchLengthError struct {
	*BaseError
}

type CursorMap

type CursorMap struct {
	*SyncMap
}

func NewCursorMap

func NewCursorMap() CursorMap

func (CursorMap) AddPseudoCursor

func (m CursorMap) AddPseudoCursor(name parser.Identifier, values []value.Primary) error

func (CursorMap) Close

func (m CursorMap) Close(name parser.Identifier) error

func (CursorMap) Count

func (m CursorMap) Count(name parser.Identifier) (int, error)

func (CursorMap) Declare

func (m CursorMap) Declare(expr parser.CursorDeclaration) error

func (CursorMap) Delete

func (m CursorMap) Delete(name string)

func (CursorMap) Dispose

func (m CursorMap) Dispose(name parser.Identifier) error

func (CursorMap) Exists

func (m CursorMap) Exists(name string) bool

func (CursorMap) Fetch

func (m CursorMap) Fetch(name parser.Identifier, position int, number int) ([]value.Primary, error)

func (CursorMap) IsEmpty

func (m CursorMap) IsEmpty() bool

func (CursorMap) IsInRange

func (m CursorMap) IsInRange(name parser.Identifier) (ternary.Value, error)

func (CursorMap) IsOpen

func (m CursorMap) IsOpen(name parser.Identifier) (ternary.Value, error)

func (CursorMap) Load

func (m CursorMap) Load(name string) (*Cursor, bool)

func (CursorMap) LoadDirect

func (m CursorMap) LoadDirect(name string) (interface{}, bool)

func (CursorMap) Open

func (m CursorMap) Open(ctx context.Context, scope *ReferenceScope, name parser.Identifier, values []parser.ReplaceValue) error

func (CursorMap) Store

func (m CursorMap) Store(name string, val *Cursor)

type CursorOpenError

type CursorOpenError struct {
	*BaseError
}

type CursorRedeclaredError

type CursorRedeclaredError struct {
	*BaseError
}

type DataEncodingError

type DataEncodingError struct {
	*BaseError
}

type DataObject

type DataObject struct {
	*parser.BaseExpr
	Raw string
}

func (DataObject) String

func (o DataObject) String() string

type DataParsingError

type DataParsingError struct {
	*BaseError
}

type DeleteTableNotSpecifiedError

type DeleteTableNotSpecifiedError struct {
	*BaseError
}

type DenseRank

type DenseRank struct{}

func (DenseRank) CheckArgsLen

func (fn DenseRank) CheckArgsLen(expr parser.AnalyticFunction) error

func (DenseRank) Execute

func (fn DenseRank) Execute(_ context.Context, scope *ReferenceScope, partition Partition, _ parser.AnalyticFunction) (map[int]value.Primary, error)

type Direction

type Direction string
const (
	RightDirection Direction = "R"
	LeftDirection            = "L"
)

type Discard

type Discard struct {
}

func NewDiscard

func NewDiscard() *Discard

func (Discard) Close

func (d Discard) Close() error

func (Discard) Write

func (d Discard) Write(p []byte) (int, error)

type DuplicateFieldNameError

type DuplicateFieldNameError struct {
	*BaseError
}

type DuplicateParameterError

type DuplicateParameterError struct {
	*BaseError
}

type DuplicateStatementNameError

type DuplicateStatementNameError struct {
	*BaseError
}

type DuplicateTableNameError

type DuplicateTableNameError struct {
	*BaseError
}

type EmptyInlineTableError

type EmptyInlineTableError struct {
	*BaseError
}

type Error

type Error interface {
	Error() string
	Message() string
	Code() int
	Number() int
	Line() int
	Char() int
	Source() string
	// contains filtered or unexported methods
}

type ExternalCommandError

type ExternalCommandError struct {
	*BaseError
}

type FatalError

type FatalError struct {
	*BaseError
}

type FieldAmbiguousError

type FieldAmbiguousError struct {
	*BaseError
}

type FieldIndexCache

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

func NewFieldIndexCache

func NewFieldIndexCache(initCap int, limitToUseSlice int) *FieldIndexCache

func (*FieldIndexCache) Add

func (c *FieldIndexCache) Add(expr parser.QueryExpression, idx int)

func (*FieldIndexCache) Get

func (c *FieldIndexCache) Get(expr parser.QueryExpression) (int, bool)

type FieldLengthNotMatchError

type FieldLengthNotMatchError struct {
	*BaseError
}

type FieldNotExistError

type FieldNotExistError struct {
	*BaseError
}

type FieldNotGroupKeyError

type FieldNotGroupKeyError struct {
	*BaseError
}

type FileAlreadyExistError

type FileAlreadyExistError struct {
	*BaseError
}

type FileInfo

type FileInfo struct {
	Path        string
	ArchivePath string

	Format             option.Format
	Delimiter          rune
	DelimiterPositions fixedlen.DelimiterPositions
	JsonQuery          string
	Encoding           text.Encoding
	LineBreak          text.LineBreak
	NoHeader           bool
	EncloseAll         bool
	JsonEscape         json.EscapeType
	PrettyPrint        bool

	SingleLine bool

	Handler *file.Handler

	ForUpdate bool
	ViewType  ViewType
	// contains filtered or unexported fields
}

func AddColumns

func AddColumns(ctx context.Context, scope *ReferenceScope, query parser.AddColumns) (*FileInfo, int, error)

func CreateTable

func CreateTable(ctx context.Context, scope *ReferenceScope, query parser.CreateTable) (*FileInfo, error)

func Delete

func Delete(ctx context.Context, scope *ReferenceScope, query parser.DeleteQuery) ([]*FileInfo, []int, error)

func DropColumns

func DropColumns(ctx context.Context, scope *ReferenceScope, query parser.DropColumns) (*FileInfo, int, error)

func Insert

func Insert(ctx context.Context, scope *ReferenceScope, query parser.InsertQuery) (*FileInfo, int, error)

func NewFileInfo

func NewFileInfo(
	filename parser.Identifier,
	repository string,
	options option.ImportOptions,
	defaultFormat option.Format,
) (*FileInfo, error)

func NewFileInfoForCreate

func NewFileInfoForCreate(filename parser.Identifier, repository string, delimiter rune, encoding text.Encoding) (*FileInfo, error)

func NewInlineFileInfo

func NewInlineFileInfo(filePath string, importOptions option.ImportOptions, exportOptions option.ExportOptions) *FileInfo

func NewStdinFileInfo

func NewStdinFileInfo(filePath string, importOptions option.ImportOptions, exportOptions option.ExportOptions) *FileInfo

func NewTemporaryTableFileInfo

func NewTemporaryTableFileInfo(name string) *FileInfo

func RenameColumn

func RenameColumn(ctx context.Context, scope *ReferenceScope, query parser.RenameColumn) (*FileInfo, error)

func Replace

func Replace(ctx context.Context, scope *ReferenceScope, query parser.ReplaceQuery) (*FileInfo, int, error)

func SetTableAttribute

func SetTableAttribute(ctx context.Context, scope *ReferenceScope, query parser.SetTableAttribute) (*FileInfo, string, error)

func Update

func Update(ctx context.Context, scope *ReferenceScope, query parser.UpdateQuery) ([]*FileInfo, []int, error)

func (*FileInfo) ExportOptions

func (f *FileInfo) ExportOptions(tx *Transaction) option.ExportOptions

func (*FileInfo) IdentifiedPath

func (f *FileInfo) IdentifiedPath() string

func (*FileInfo) IsFile

func (f *FileInfo) IsFile() bool

func (*FileInfo) IsInMemoryTable

func (f *FileInfo) IsInMemoryTable() bool

func (*FileInfo) IsInlineTable

func (f *FileInfo) IsInlineTable() bool

func (*FileInfo) IsRemoteObject

func (f *FileInfo) IsRemoteObject() bool

func (*FileInfo) IsStdin

func (f *FileInfo) IsStdin() bool

func (*FileInfo) IsStringObject

func (f *FileInfo) IsStringObject() bool

func (*FileInfo) IsTemporaryTable

func (f *FileInfo) IsTemporaryTable() bool

func (*FileInfo) IsUpdatable

func (f *FileInfo) IsUpdatable() bool

func (*FileInfo) SetAllDefaultFileInfoAttributes

func (f *FileInfo) SetAllDefaultFileInfoAttributes(importOptions option.ImportOptions, exportOptions option.ExportOptions)

func (*FileInfo) SetDefaultFileInfoAttributes

func (f *FileInfo) SetDefaultFileInfoAttributes(importOptions option.ImportOptions, exportOptions option.ExportOptions)

func (*FileInfo) SetDelimiter

func (f *FileInfo) SetDelimiter(s string) error

func (*FileInfo) SetDelimiterPositions

func (f *FileInfo) SetDelimiterPositions(s string) error

func (*FileInfo) SetEncloseAll

func (f *FileInfo) SetEncloseAll(b bool) error

func (*FileInfo) SetEncoding

func (f *FileInfo) SetEncoding(s string) error

func (*FileInfo) SetFormat

func (f *FileInfo) SetFormat(s string) error

func (*FileInfo) SetJsonEscape

func (f *FileInfo) SetJsonEscape(s string) error

func (*FileInfo) SetLineBreak

func (f *FileInfo) SetLineBreak(s string) error

func (*FileInfo) SetNoHeader

func (f *FileInfo) SetNoHeader(b bool) error

func (*FileInfo) SetPrettyPrint

func (f *FileInfo) SetPrettyPrint(b bool) error

type FileLockTimeoutError

type FileLockTimeoutError struct {
	*BaseError
}

type FileNameAmbiguousError

type FileNameAmbiguousError struct {
	*BaseError
}

type FileNotExistError

type FileNotExistError struct {
	*BaseError
}

type FileUnableToReadError

type FileUnableToReadError struct {
	*BaseError
}

type FirstValue

type FirstValue struct{}

func (FirstValue) CheckArgsLen

func (fn FirstValue) CheckArgsLen(expr parser.AnalyticFunction) error

func (FirstValue) Execute

func (fn FirstValue) Execute(ctx context.Context, scope *ReferenceScope, partition Partition, expr parser.AnalyticFunction) (map[int]value.Primary, error)

type FlagValueNotAllowedFormatError

type FlagValueNotAllowedFormatError struct {
	*BaseError
}

type ForcedExit

type ForcedExit struct {
	*BaseError
}

type FormatStringLengthNotMatchError

type FormatStringLengthNotMatchError struct {
	*BaseError
}

type FormatUnexpectedTerminationError

type FormatUnexpectedTerminationError struct {
	*BaseError
}

type FunctionArgumentLengthError

type FunctionArgumentLengthError struct {
	*BaseError
}

type FunctionInvalidArgumentError

type FunctionInvalidArgumentError struct {
	*BaseError
}

type FunctionNotExistError

type FunctionNotExistError struct {
	*BaseError
}

type FunctionRedeclaredError

type FunctionRedeclaredError struct {
	*BaseError
}

type GoroutineManager

type GoroutineManager struct {
	Count                  int
	CountMutex             *sync.Mutex
	MinimumRequiredPerCore int
}

func GetGoroutineManager

func GetGoroutineManager() *GoroutineManager

func (*GoroutineManager) AssignRoutineNumber

func (m *GoroutineManager) AssignRoutineNumber(recordLen int, minimumRequiredPerCore int, cpuNum int) int

func (*GoroutineManager) Release

func (m *GoroutineManager) Release()

type GoroutineTaskManager

type GoroutineTaskManager struct {
	Number int
	// contains filtered or unexported fields
}

func NewGoroutineTaskManager

func NewGoroutineTaskManager(recordLen int, minimumRequiredPerCore int, cpuNum int) *GoroutineTaskManager

func (*GoroutineTaskManager) Add

func (m *GoroutineTaskManager) Add()

func (*GoroutineTaskManager) Done

func (m *GoroutineTaskManager) Done()

func (*GoroutineTaskManager) Err

func (m *GoroutineTaskManager) Err() error

func (*GoroutineTaskManager) HasError

func (m *GoroutineTaskManager) HasError() bool

func (*GoroutineTaskManager) RecordRange

func (m *GoroutineTaskManager) RecordRange(routineIndex int) (int, int)

func (*GoroutineTaskManager) Run

func (m *GoroutineTaskManager) Run(ctx context.Context, fn func(int) error) error

func (*GoroutineTaskManager) SetError

func (m *GoroutineTaskManager) SetError(e error)

func (*GoroutineTaskManager) Wait

func (m *GoroutineTaskManager) Wait()
type Header []HeaderField

func AddHeaderField

func AddHeaderField(h Header, identifier string, column string, alias string) (header Header, index int)

func NewEmptyHeader

func NewEmptyHeader(len int) Header

func NewHeader

func NewHeader(view string, words []string) Header

func NewHeaderWithAutofill

func NewHeaderWithAutofill(view string, words []string) Header

func NewHeaderWithId

func NewHeaderWithId(view string, words []string) Header

func (Header) ContainsInternalId

func (h Header) ContainsInternalId(viewName string) (int, error)

func (Header) ContainsObject

func (h Header) ContainsObject(obj parser.QueryExpression) (int, bool)

func (Header) Copy

func (h Header) Copy() Header

func (Header) FieldIndex

func (h Header) FieldIndex(fieldRef parser.FieldReference) (int, error)

func (Header) FieldNumberIndex

func (h Header) FieldNumberIndex(number parser.ColumnNumber) (int, error)

func (Header) Len

func (h Header) Len() int

func (Header) Merge

func (h Header) Merge(h2 Header) Header

func (Header) SearchIndex

func (h Header) SearchIndex(fieldRef parser.QueryExpression) (int, error)

func (Header) TableColumnNames

func (h Header) TableColumnNames() []string

func (Header) TableColumns

func (h Header) TableColumns() []parser.QueryExpression

func (Header) Update

func (h Header) Update(reference string, fields []parser.QueryExpression) error

type HeaderField

type HeaderField struct {
	View         string
	Identifier   string
	Column       string
	Aliases      []string
	Number       int
	IsFromTable  bool
	IsJoinColumn bool
	IsGroupKey   bool
}

type HttpObject

type HttpObject struct {
	*parser.BaseExpr
	URL string
}

func (HttpObject) String

func (o HttpObject) String() string

type HttpRequestError

type HttpRequestError struct {
	*BaseError
}

type IOError

type IOError struct {
	*BaseError
}

type InLineTableRedefinedError

type InLineTableRedefinedError struct {
	*BaseError
}

type IncorrectCommandUsageError

type IncorrectCommandUsageError struct {
	*BaseError
}

type IncorrectLateralUsageError

type IncorrectLateralUsageError struct {
	*BaseError
}

type InlineTableCannotBeUpdatedError

type InlineTableCannotBeUpdatedError struct {
	*BaseError
}

type InlineTableFieldLengthError

type InlineTableFieldLengthError struct {
	*BaseError
}

type InlineTableMap

type InlineTableMap map[string]*View

func (InlineTableMap) Clear

func (it InlineTableMap) Clear()

func (InlineTableMap) Exists

func (it InlineTableMap) Exists(name parser.Identifier) bool

func (InlineTableMap) Get

func (it InlineTableMap) Get(name parser.Identifier) (*View, error)

func (InlineTableMap) Set

func (it InlineTableMap) Set(ctx context.Context, scope *ReferenceScope, inlineTable parser.InlineTable) error

func (InlineTableMap) Store

func (it InlineTableMap) Store(name parser.Identifier, view *View) error

type Input

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

func NewInput

func NewInput(r io.Reader) *Input

func (*Input) Close

func (r *Input) Close() error

func (*Input) Read

func (r *Input) Read(p []byte) (int, error)

type InsertRowValueLengthError

type InsertRowValueLengthError struct {
	*BaseError
}

type InsertSelectFieldLengthError

type InsertSelectFieldLengthError struct {
	*BaseError
}

type IntegerDevidedByZeroError

type IntegerDevidedByZeroError struct {
	*BaseError
}

type InternalRecordIdEmptyError

type InternalRecordIdEmptyError struct {
	*BaseError
}

type InternalRecordIdNotExistError

type InternalRecordIdNotExistError struct {
	*BaseError
}

type InvalidCursorStatementError

type InvalidCursorStatementError struct {
	*BaseError
}

type InvalidEventNameError

type InvalidEventNameError struct {
	*BaseError
}

type InvalidFetchPositionError

type InvalidFetchPositionError struct {
	*BaseError
}

type InvalidFlagNameError

type InvalidFlagNameError struct {
	*BaseError
}

type InvalidFlagValueError

type InvalidFlagValueError struct {
	*BaseError
}

type InvalidFlagValueToBeRemoveError

type InvalidFlagValueToBeRemoveError struct {
	*BaseError
}

type InvalidLimitNumberError

type InvalidLimitNumberError struct {
	*BaseError
}

type InvalidLimitPercentageError

type InvalidLimitPercentageError struct {
	*BaseError
}

type InvalidOffsetNumberError

type InvalidOffsetNumberError struct {
	*BaseError
}

type InvalidPathError

type InvalidPathError struct {
	*BaseError
}

type InvalidReloadTypeError

type InvalidReloadTypeError struct {
	*BaseError
}

type InvalidRuntimeInformationError

type InvalidRuntimeInformationError struct {
	*BaseError
}

type InvalidTableAttributeNameError

type InvalidTableAttributeNameError struct {
	*BaseError
}

type InvalidTableAttributeValueError

type InvalidTableAttributeValueError struct {
	*BaseError
}

type InvalidTableObjectError

type InvalidTableObjectError struct {
	*BaseError
}

type InvalidUrlError

type InvalidUrlError struct {
	*BaseError
}

type InvalidValueExpressionError

type InvalidValueExpressionError struct {
	*BaseError
}

type JsonLinesStructureError

type JsonLinesStructureError struct {
	*BaseError
}

type JsonQueryTooManyRecordsError

type JsonQueryTooManyRecordsError struct {
	*BaseError
}

type Lag

type Lag struct{}

func (Lag) CheckArgsLen

func (fn Lag) CheckArgsLen(expr parser.AnalyticFunction) error

func (Lag) Execute

func (fn Lag) Execute(ctx context.Context, scope *ReferenceScope, partition Partition, expr parser.AnalyticFunction) (map[int]value.Primary, error)

type LastValue

type LastValue struct{}

func (LastValue) CheckArgsLen

func (fn LastValue) CheckArgsLen(expr parser.AnalyticFunction) error

func (LastValue) Execute

func (fn LastValue) Execute(ctx context.Context, scope *ReferenceScope, partition Partition, expr parser.AnalyticFunction) (map[int]value.Primary, error)

type Lead

type Lead struct{}

func (Lead) CheckArgsLen

func (fn Lead) CheckArgsLen(expr parser.AnalyticFunction) error

func (Lead) Execute

func (fn Lead) Execute(ctx context.Context, scope *ReferenceScope, partition Partition, expr parser.AnalyticFunction) (map[int]value.Primary, error)

type LoadConfigurationError

type LoadConfigurationError struct {
	*BaseError
}

type LoadJsonError

type LoadJsonError struct {
	*BaseError
}

type NTile

type NTile struct{}

func (NTile) CheckArgsLen

func (fn NTile) CheckArgsLen(expr parser.AnalyticFunction) error

func (NTile) Execute

func (fn NTile) Execute(ctx context.Context, scope *ReferenceScope, partition Partition, expr parser.AnalyticFunction) (map[int]value.Primary, error)

type NestedAggregateFunctionsError

type NestedAggregateFunctionsError struct {
	*BaseError
}

type NestedRecursionError

type NestedRecursionError struct {
	*BaseError
}

type NodeScope

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

func GetNodeScope

func GetNodeScope() NodeScope

func NewNodeScope

func NewNodeScope() NodeScope

func (NodeScope) Clear

func (scope NodeScope) Clear()

type NotAllowedAnalyticFunctionError

type NotAllowedAnalyticFunctionError struct {
	*BaseError
}

type NotGroupingRecordsError

type NotGroupingRecordsError struct {
	*BaseError
}

type NotTableError

type NotTableError struct {
	*BaseError
}

type NthValue

type NthValue struct{}

func (NthValue) CheckArgsLen

func (fn NthValue) CheckArgsLen(expr parser.AnalyticFunction) error

func (NthValue) Execute

func (fn NthValue) Execute(ctx context.Context, scope *ReferenceScope, partition Partition, expr parser.AnalyticFunction) (map[int]value.Primary, error)

type ObjectStatus

type ObjectStatus int
const (
	ObjectFixed ObjectStatus = iota
	ObjectCreated
	ObjectUpdated
	ReadOnly
)

type Output

type Output struct {
	bytes.Buffer
}

func NewOutput

func NewOutput() *Output

func (*Output) Close

func (w *Output) Close() error

type PaddingType

type PaddingType string
const (
	PaddingRuneCount PaddingType = "LEN"
	PaddingByteCount PaddingType = "BYTE"
	PaddingWidth     PaddingType = "WIDTH"
)

type Partition

type Partition []int

func (Partition) Reverse

func (p Partition) Reverse()

type Partitions

type Partitions map[string]Partition

type PercentRank

type PercentRank struct{}

func (PercentRank) CheckArgsLen

func (fn PercentRank) CheckArgsLen(expr parser.AnalyticFunction) error

func (PercentRank) Execute

func (fn PercentRank) Execute(_ context.Context, scope *ReferenceScope, partition Partition, _ parser.AnalyticFunction) (map[int]value.Primary, error)

type PreparedStatement

type PreparedStatement struct {
	Name            string
	StatementString string
	Statements      []parser.Statement
	HolderNumber    int
}

func NewPreparedStatement

func NewPreparedStatement(flags *option.Flags, expr parser.StatementPreparation) (*PreparedStatement, error)

type PreparedStatementMap

type PreparedStatementMap struct {
	*SyncMap
}

func NewPreparedStatementMap

func NewPreparedStatementMap() PreparedStatementMap

func (PreparedStatementMap) Delete

func (m PreparedStatementMap) Delete(name string)

func (PreparedStatementMap) Dispose

func (PreparedStatementMap) Exists

func (m PreparedStatementMap) Exists(name string) bool

func (PreparedStatementMap) Get

func (PreparedStatementMap) Load

func (PreparedStatementMap) LoadDirect

func (m PreparedStatementMap) LoadDirect(name string) (interface{}, bool)

func (PreparedStatementMap) Prepare

func (PreparedStatementMap) Store

func (m PreparedStatementMap) Store(name string, statement *PreparedStatement)

type PreparedStatementSyntaxError

type PreparedStatementSyntaxError struct {
	*BaseError
}

type Processor

type Processor struct {
	Tx             *Transaction
	ReferenceScope *ReferenceScope
	// contains filtered or unexported fields
}

func NewProcessor

func NewProcessor(tx *Transaction) *Processor

func NewProcessorWithScope

func NewProcessorWithScope(tx *Transaction, scope *ReferenceScope) *Processor

func (*Processor) AutoCommit

func (proc *Processor) AutoCommit(ctx context.Context) error

func (*Processor) AutoRollback

func (proc *Processor) AutoRollback() error

func (*Processor) Case

func (proc *Processor) Case(ctx context.Context, stmt parser.Case) (StatementFlow, error)

func (*Processor) Close

func (proc *Processor) Close()

func (*Processor) Commit

func (proc *Processor) Commit(ctx context.Context, expr parser.Expression) error

func (*Processor) ExecExternalCommand

func (proc *Processor) ExecExternalCommand(ctx context.Context, stmt parser.ExternalCommand) error

func (*Processor) Execute

func (proc *Processor) Execute(ctx context.Context, statements []parser.Statement) (StatementFlow, error)

func (*Processor) ExecuteStatement

func (proc *Processor) ExecuteStatement(ctx context.Context, stmt parser.Statement) (StatementFlow, error)

func (*Processor) IfStmt

func (proc *Processor) IfStmt(ctx context.Context, stmt parser.If) (StatementFlow, error)

func (*Processor) Log

func (proc *Processor) Log(log string, quiet bool)

func (*Processor) LogError

func (proc *Processor) LogError(log string)

func (*Processor) LogNotice

func (proc *Processor) LogNotice(log string, quiet bool)

func (*Processor) LogWarn

func (proc *Processor) LogWarn(log string, quiet bool)

func (*Processor) NewChildProcessor

func (proc *Processor) NewChildProcessor() *Processor

func (*Processor) ReleaseResources

func (proc *Processor) ReleaseResources() error

func (*Processor) ReleaseResourcesWithErrors

func (proc *Processor) ReleaseResourcesWithErrors() error

func (*Processor) Rollback

func (proc *Processor) Rollback(expr parser.Expression) error

func (*Processor) While

func (proc *Processor) While(ctx context.Context, stmt parser.While) (StatementFlow, error)

func (*Processor) WhileInCursor

func (proc *Processor) WhileInCursor(ctx context.Context, stmt parser.WhileInCursor) (StatementFlow, error)

type PseudoCursorError

type PseudoCursorError struct {
	*BaseError
}

type Rank

type Rank struct{}

func (Rank) CheckArgsLen

func (fn Rank) CheckArgsLen(expr parser.AnalyticFunction) error

func (Rank) Execute

func (fn Rank) Execute(_ context.Context, scope *ReferenceScope, partition Partition, _ parser.AnalyticFunction) (map[int]value.Primary, error)

type Record

type Record []Cell

func NewEmptyRecord

func NewEmptyRecord(len int) Record

func NewRecord

func NewRecord(values []value.Primary) Record

func NewRecordWithId

func NewRecordWithId(internalId int, values []value.Primary) Record

func (Record) Copy

func (r Record) Copy() Record

func (Record) GroupLen

func (r Record) GroupLen() int

func (Record) Merge

func (r Record) Merge(r2 Record, pool *sync.Pool) Record

type RecordReader

type RecordReader interface {
	Read() ([]text.RawText, error)
}

type RecordSet

type RecordSet []Record

func MergeRecordSetList

func MergeRecordSetList(list []RecordSet) RecordSet

func (RecordSet) Copy

func (r RecordSet) Copy() RecordSet

func (RecordSet) Merge

func (r RecordSet) Merge(r2 RecordSet) RecordSet

type RecursionExceededLimitError

type RecursionExceededLimitError struct {
	*BaseError
}

type ReferenceRecord

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

func NewReferenceRecord

func NewReferenceRecord(view *View, recordIdx int, cacheLen int) ReferenceRecord

func (*ReferenceRecord) IsInRange

func (r *ReferenceRecord) IsInRange() bool

type ReferenceScope

type ReferenceScope struct {
	Tx *Transaction

	Blocks []BlockScope

	Records []ReferenceRecord

	RecursiveTable   *parser.InlineTable
	RecursiveTmpView *View
	RecursiveCount   *int64
	// contains filtered or unexported fields
}

func NewReferenceScope

func NewReferenceScope(tx *Transaction) *ReferenceScope

func NewReferenceScopeWithBlock

func NewReferenceScopeWithBlock(tx *Transaction, scope BlockScope) *ReferenceScope

func (*ReferenceScope) AddAlias

func (rs *ReferenceScope) AddAlias(alias parser.Identifier, path string) error

func (*ReferenceScope) AddPseudoCursor

func (rs *ReferenceScope) AddPseudoCursor(name parser.Identifier, values []value.Primary) error

func (*ReferenceScope) AllCursors

func (rs *ReferenceScope) AllCursors() CursorMap

func (*ReferenceScope) AllFunctions

func (*ReferenceScope) AllTemporaryTables

func (rs *ReferenceScope) AllTemporaryTables() ViewMap

func (*ReferenceScope) AllVariables

func (rs *ReferenceScope) AllVariables() VariableMap

func (*ReferenceScope) ClearCurrentBlock

func (rs *ReferenceScope) ClearCurrentBlock()

func (*ReferenceScope) CloseCurrentBlock

func (rs *ReferenceScope) CloseCurrentBlock()

func (*ReferenceScope) CloseCurrentNode

func (rs *ReferenceScope) CloseCurrentNode()

func (*ReferenceScope) CloseCursor

func (rs *ReferenceScope) CloseCursor(name parser.Identifier) error

func (*ReferenceScope) CreateChild

func (rs *ReferenceScope) CreateChild() *ReferenceScope

func (*ReferenceScope) CreateNode

func (rs *ReferenceScope) CreateNode() *ReferenceScope

func (*ReferenceScope) CreateScopeForAnalytics

func (rs *ReferenceScope) CreateScopeForAnalytics() *ReferenceScope

func (*ReferenceScope) CreateScopeForRecordEvaluation

func (rs *ReferenceScope) CreateScopeForRecordEvaluation(view *View, recordIndex int) *ReferenceScope

func (*ReferenceScope) CreateScopeForSequentialEvaluation

func (rs *ReferenceScope) CreateScopeForSequentialEvaluation(view *View) *ReferenceScope

func (*ReferenceScope) CurrentBlock

func (rs *ReferenceScope) CurrentBlock() BlockScope

func (*ReferenceScope) CursorCount

func (rs *ReferenceScope) CursorCount(name parser.Identifier) (int, error)

func (*ReferenceScope) CursorIsInRange

func (rs *ReferenceScope) CursorIsInRange(name parser.Identifier) (ternary.Value, error)

func (*ReferenceScope) CursorIsOpen

func (rs *ReferenceScope) CursorIsOpen(name parser.Identifier) (ternary.Value, error)

func (*ReferenceScope) DeclareAggregateFunction

func (rs *ReferenceScope) DeclareAggregateFunction(expr parser.AggregateDeclaration) error

func (*ReferenceScope) DeclareCursor

func (rs *ReferenceScope) DeclareCursor(expr parser.CursorDeclaration) error

func (*ReferenceScope) DeclareFunction

func (rs *ReferenceScope) DeclareFunction(expr parser.FunctionDeclaration) error

func (*ReferenceScope) DeclareVariable

func (rs *ReferenceScope) DeclareVariable(ctx context.Context, expr parser.VariableDeclaration) error

func (*ReferenceScope) DeclareVariableDirectly

func (rs *ReferenceScope) DeclareVariableDirectly(variable parser.Variable, val value.Primary) error

func (*ReferenceScope) DisposeCursor

func (rs *ReferenceScope) DisposeCursor(name parser.Identifier) error

func (*ReferenceScope) DisposeFunction

func (rs *ReferenceScope) DisposeFunction(name parser.Identifier) error

func (*ReferenceScope) DisposeTemporaryTable

func (rs *ReferenceScope) DisposeTemporaryTable(name parser.QueryExpression) error

func (*ReferenceScope) DisposeVariable

func (rs *ReferenceScope) DisposeVariable(expr parser.Variable) error

func (*ReferenceScope) FetchCursor

func (rs *ReferenceScope) FetchCursor(name parser.Identifier, position int, number int) ([]value.Primary, error)

func (*ReferenceScope) FilePathExists

func (rs *ReferenceScope) FilePathExists(identifier string) bool

func (*ReferenceScope) GetAlias

func (rs *ReferenceScope) GetAlias(alias parser.Identifier) (path string, err error)

func (*ReferenceScope) GetFunction

func (rs *ReferenceScope) GetFunction(expr parser.QueryExpression, name string) (*UserDefinedFunction, error)

func (*ReferenceScope) GetInlineTable

func (rs *ReferenceScope) GetInlineTable(name parser.Identifier) (*View, error)

func (*ReferenceScope) GetTemporaryTable

func (rs *ReferenceScope) GetTemporaryTable(identifier parser.Identifier) (*View, error)

func (*ReferenceScope) GetTemporaryTableWithInternalId

func (rs *ReferenceScope) GetTemporaryTableWithInternalId(ctx context.Context, identifier parser.Identifier, flags *option.Flags) (view *View, err error)

func (*ReferenceScope) GetVariable

func (rs *ReferenceScope) GetVariable(expr parser.Variable) (val value.Primary, err error)

func (*ReferenceScope) Global

func (rs *ReferenceScope) Global() BlockScope

func (*ReferenceScope) InlineTableExists

func (rs *ReferenceScope) InlineTableExists(name parser.Identifier) bool

func (*ReferenceScope) LoadFilePath

func (rs *ReferenceScope) LoadFilePath(identifier string) (string, bool)

func (*ReferenceScope) LoadInlineTable

func (rs *ReferenceScope) LoadInlineTable(ctx context.Context, clause parser.WithClause) error

func (*ReferenceScope) NextRecord

func (rs *ReferenceScope) NextRecord() bool

func (*ReferenceScope) Now

func (rs *ReferenceScope) Now() time.Time

func (*ReferenceScope) OpenCursor

func (rs *ReferenceScope) OpenCursor(ctx context.Context, name parser.Identifier, values []parser.ReplaceValue) error

func (*ReferenceScope) ReplaceTemporaryTable

func (rs *ReferenceScope) ReplaceTemporaryTable(view *View)

func (*ReferenceScope) RestoreTemporaryTable

func (rs *ReferenceScope) RestoreTemporaryTable(uncomittedViews map[string]*FileInfo) []string

func (*ReferenceScope) SetInlineTable

func (rs *ReferenceScope) SetInlineTable(ctx context.Context, inlineTable parser.InlineTable) error

func (*ReferenceScope) SetTemporaryTable

func (rs *ReferenceScope) SetTemporaryTable(view *View)

func (*ReferenceScope) StoreFilePath

func (rs *ReferenceScope) StoreFilePath(identifier string, fpath string)

func (*ReferenceScope) StoreInlineTable

func (rs *ReferenceScope) StoreInlineTable(name parser.Identifier, view *View) error

func (*ReferenceScope) StoreTemporaryTable

func (rs *ReferenceScope) StoreTemporaryTable(session *Session, uncomittedViews map[string]*FileInfo) []string

func (*ReferenceScope) SubstituteVariable

func (rs *ReferenceScope) SubstituteVariable(ctx context.Context, expr parser.VariableSubstitution) (val value.Primary, err error)

func (*ReferenceScope) SubstituteVariableDirectly

func (rs *ReferenceScope) SubstituteVariableDirectly(variable parser.Variable, val value.Primary) (value.Primary, error)

func (*ReferenceScope) TemporaryTableExists

func (rs *ReferenceScope) TemporaryTableExists(identifier string) bool

type RegExpMap

type RegExpMap struct {
	*SyncMap
}

func NewRegExpMap

func NewRegExpMap() RegExpMap

func (RegExpMap) Get

func (rem RegExpMap) Get(expr string) (*regexp.Regexp, error)

func (RegExpMap) Load

func (rem RegExpMap) Load(key string) (*regexp.Regexp, bool)

func (RegExpMap) Store

func (rem RegExpMap) Store(key string, value *regexp.Regexp)

type RemoveFlagNotSupportedNameError

type RemoveFlagNotSupportedNameError struct {
	*BaseError
}

type ReplaceKeyNotSetError

type ReplaceKeyNotSetError struct {
	*BaseError
}

type ReplaceValueLengthError

type ReplaceValueLengthError struct {
	*BaseError
}

type ReplaceValues

type ReplaceValues struct {
	Values []parser.QueryExpression
	Names  map[string]int
}

func NewReplaceValues

func NewReplaceValues(replace []parser.ReplaceValue) *ReplaceValues

type RollbackError

type RollbackError struct {
	*BaseError
}

type RowNumber

type RowNumber struct{}

func (RowNumber) CheckArgsLen

func (fn RowNumber) CheckArgsLen(expr parser.AnalyticFunction) error

func (RowNumber) Execute

type RowValueLengthInComparisonError

type RowValueLengthInComparisonError struct {
	*BaseError
}

type RowValueLengthInListError

type RowValueLengthInListError struct {
	*BaseError
	Index int
}

type SelectFieldLengthInComparisonError

type SelectFieldLengthInComparisonError struct {
	*BaseError
}

type SelectIntoQueryFieldLengthNotMatchError

type SelectIntoQueryFieldLengthNotMatchError struct {
	*BaseError
}

type SelectIntoQueryTooManyRecordsError

type SelectIntoQueryTooManyRecordsError struct {
	*BaseError
}

type Session

type Session struct {
	CanReadStdin    bool
	CanOutputToPipe bool
	// contains filtered or unexported fields
}

func NewSession

func NewSession() *Session

func (*Session) GetStdinView

func (sess *Session) GetStdinView(ctx context.Context, flags *option.Flags, fileInfo *FileInfo, expr parser.Stdin) (*View, error)

func (*Session) OutFile

func (sess *Session) OutFile() io.Writer

func (*Session) ScreenFd

func (sess *Session) ScreenFd() uintptr

func (*Session) ScreenWidth

func (sess *Session) ScreenWidth() int

func (*Session) SetOutFile

func (sess *Session) SetOutFile(w io.Writer)

func (*Session) SetStderr

func (sess *Session) SetStderr(w io.WriteCloser)

func (*Session) SetStdin

func (sess *Session) SetStdin(r io.ReadCloser) error

func (*Session) SetStdinContext

func (sess *Session) SetStdinContext(ctx context.Context, r io.ReadCloser) error

func (*Session) SetStdout

func (sess *Session) SetStdout(w io.WriteCloser)

func (*Session) SetTerminal

func (sess *Session) SetTerminal(t VirtualTerminal)

func (*Session) Stderr

func (sess *Session) Stderr() io.WriteCloser

func (*Session) Stdin

func (sess *Session) Stdin() io.ReadCloser

func (*Session) Stdout

func (sess *Session) Stdout() io.WriteCloser

func (*Session) Terminal

func (sess *Session) Terminal() VirtualTerminal

func (*Session) WriteToStderr

func (sess *Session) WriteToStderr(s string) (err error)

func (*Session) WriteToStderrWithLineBreak

func (sess *Session) WriteToStderrWithLineBreak(s string) error

func (*Session) WriteToStdout

func (sess *Session) WriteToStdout(s string) (err error)

func (*Session) WriteToStdoutWithLineBreak

func (sess *Session) WriteToStdoutWithLineBreak(s string) error

type ShowInvalidObjectTypeError

type ShowInvalidObjectTypeError struct {
	*BaseError
}

type SignalReceived

type SignalReceived struct {
	*BaseError
}

type SortValue

type SortValue struct {
	Type SortValueType

	SerializedKey *bytes.Buffer

	Integer  int64
	Float    float64
	Datetime int64
	String   string
}

func NewSortValue

func NewSortValue(val value.Primary, flags *option.Flags) *SortValue

func (*SortValue) EquivalentTo

func (v *SortValue) EquivalentTo(compareValue *SortValue) bool

func (*SortValue) Less

func (v *SortValue) Less(compareValue *SortValue) ternary.Value

type SortValueType

type SortValueType int
const (
	NullType SortValueType = iota
	IntegerType
	FloatType
	DatetimeType
	BooleanType
	StringType
)

type SortValues

type SortValues []*SortValue

func (SortValues) EquivalentTo

func (values SortValues) EquivalentTo(compareValues SortValues) bool

func (SortValues) Less

func (values SortValues) Less(compareValues SortValues, directions []int, nullPositions []int) bool

func (SortValues) Serialize

func (values SortValues) Serialize(buf *bytes.Buffer)

type SourceInvalidFilePathError

type SourceInvalidFilePathError struct {
	*BaseError
}

type StatementFlow

type StatementFlow int
const (
	Terminate StatementFlow = iota
	TerminateWithError
	Exit
	Break
	Continue
	Return
)

type StatementNotExistError

type StatementNotExistError struct {
	*BaseError
}

type StatementReplaceValueNotSpecifiedError

type StatementReplaceValueNotSpecifiedError struct {
	*BaseError
}

type StdinEmptyError

type StdinEmptyError struct {
	*BaseError
}

type StdinLocker

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

func NewStdinLocker

func NewStdinLocker() *StdinLocker

func (*StdinLocker) Lock

func (cl *StdinLocker) Lock() error

func (*StdinLocker) LockContext

func (cl *StdinLocker) LockContext(ctx context.Context) error

func (*StdinLocker) RLock

func (cl *StdinLocker) RLock() error

func (*StdinLocker) RLockContext

func (cl *StdinLocker) RLockContext(ctx context.Context) error

func (*StdinLocker) RUnlock

func (cl *StdinLocker) RUnlock() (err error)

func (*StdinLocker) Unlock

func (cl *StdinLocker) Unlock() (err error)

type StringFormatter

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

func NewStringFormatter

func NewStringFormatter() *StringFormatter

func (*StringFormatter) Format

func (f *StringFormatter) Format(format string, values []value.Primary) (string, error)

type SubqueryTooManyFieldsError

type SubqueryTooManyFieldsError struct {
	*BaseError
}

type SubqueryTooManyRecordsError

type SubqueryTooManyRecordsError struct {
	*BaseError
}

type SyncMap

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

func NewSyncMap

func NewSyncMap() *SyncMap

func (SyncMap) Clear

func (m SyncMap) Clear()

func (SyncMap) Keys

func (m SyncMap) Keys() []string

func (SyncMap) Len

func (m SyncMap) Len() int

func (SyncMap) Range

func (m SyncMap) Range(fn func(key, value interface{}) bool)

func (SyncMap) SortedKeys

func (m SyncMap) SortedKeys() []string

type SyntaxError

type SyntaxError struct {
	*BaseError
}

type SystemError

type SystemError struct {
	*BaseError
}

type TableAttributeUnchangedError

type TableAttributeUnchangedError struct {
	Path    string
	Message string
}

func (TableAttributeUnchangedError) Error

type TableAttributeValueNotAllowedFormatError

type TableAttributeValueNotAllowedFormatError struct {
	*BaseError
}

type TableFieldLengthError

type TableFieldLengthError struct {
	*BaseError
}

type TableNotLoadedError

type TableNotLoadedError struct {
	*BaseError
}

type TableObjectArgumentsLengthError

type TableObjectArgumentsLengthError struct {
	*BaseError
}

type TableObjectInvalidArgumentError

type TableObjectInvalidArgumentError struct {
	*BaseError
}

type TableObjectInvalidDelimiterError

type TableObjectInvalidDelimiterError struct {
	*BaseError
}

type TableObjectInvalidDelimiterPositionsError

type TableObjectInvalidDelimiterPositionsError struct {
	*BaseError
}

type TableObjectInvalidJsonQueryError

type TableObjectInvalidJsonQueryError struct {
	*BaseError
}

type TableObjectJsonArgumentsLengthError

type TableObjectJsonArgumentsLengthError struct {
	*BaseError
}

type TemporaryTableFieldLengthError

type TemporaryTableFieldLengthError struct {
	*BaseError
}

type TemporaryTableRedeclaredError

type TemporaryTableRedeclaredError struct {
	*BaseError
}

type Transaction

type Transaction struct {
	Session *Session

	Environment *option.Environment
	Palette     *color.Palette
	Flags       *option.Flags

	WaitTimeout   time.Duration
	RetryDelay    time.Duration
	FileContainer *file.Container

	CachedViews      ViewMap
	UncommittedViews UncommittedViews

	UrlCache map[string]*UrlResource

	PreparedStatements PreparedStatementMap

	SelectedViews []*View
	AffectedRows  int

	AutoCommit bool
	// contains filtered or unexported fields
}

func NewTransaction

func NewTransaction(ctx context.Context, defaultWaitTimeout time.Duration, retryDelay time.Duration, session *Session) (*Transaction, error)

func (*Transaction) ClearUrlCache

func (tx *Transaction) ClearUrlCache()

func (*Transaction) Commit

func (tx *Transaction) Commit(ctx context.Context, scope *ReferenceScope, expr parser.Expression) error

func (*Transaction) CreateDocumentWriter

func (tx *Transaction) CreateDocumentWriter() *doc.Writer

func (*Transaction) Error

func (tx *Transaction) Error(s string) string

func (*Transaction) GetFlag

func (tx *Transaction) GetFlag(key string) (value.Primary, bool)

func (*Transaction) LockStdinContext

func (tx *Transaction) LockStdinContext(ctx context.Context) error

func (*Transaction) Log

func (tx *Transaction) Log(log string, quiet bool)

func (*Transaction) LogError

func (tx *Transaction) LogError(log string)

func (*Transaction) LogNotice

func (tx *Transaction) LogNotice(log string, quiet bool)

func (*Transaction) LogWarn

func (tx *Transaction) LogWarn(log string, quiet bool)

func (*Transaction) Notice

func (tx *Transaction) Notice(s string) string

func (*Transaction) RLockStdinContext

func (tx *Transaction) RLockStdinContext(ctx context.Context) error

func (*Transaction) RUnlockStdin

func (tx *Transaction) RUnlockStdin()

func (*Transaction) ReleaseResources

func (tx *Transaction) ReleaseResources() error

func (*Transaction) ReleaseResourcesWithErrors

func (tx *Transaction) ReleaseResourcesWithErrors() error

func (*Transaction) Rollback

func (tx *Transaction) Rollback(scope *ReferenceScope, expr parser.Expression) error

func (*Transaction) SetFlag

func (tx *Transaction) SetFlag(key string, value interface{}) error

func (*Transaction) SetFormatFlag

func (tx *Transaction) SetFormatFlag(value interface{}, outFile string) error

func (*Transaction) UnlockStdin

func (tx *Transaction) UnlockStdin()

func (*Transaction) UpdateWaitTimeout

func (tx *Transaction) UpdateWaitTimeout(waitTimeout float64, retryDelay time.Duration)

func (*Transaction) UseColor

func (tx *Transaction) UseColor(useColor bool)

func (*Transaction) Warn

func (tx *Transaction) Warn(s string) string

type UintPool

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

func NewUintPool

func NewUintPool(initCap int, limitToUseSlice int) *UintPool

func (*UintPool) Add

func (c *UintPool) Add(val uint)

func (*UintPool) Exists

func (c *UintPool) Exists(val uint) bool

func (*UintPool) Len

func (c *UintPool) Len() int

func (*UintPool) Range

func (c *UintPool) Range(fn func(idx int, value uint) error) error

type UncommittedViews

type UncommittedViews struct {
	Created map[string]*FileInfo
	Updated map[string]*FileInfo
	// contains filtered or unexported fields
}

func NewUncommittedViews

func NewUncommittedViews() UncommittedViews

func (*UncommittedViews) Clean

func (m *UncommittedViews) Clean()

func (*UncommittedViews) CountCreatedTables

func (m *UncommittedViews) CountCreatedTables() int

func (*UncommittedViews) CountUpdatedTables

func (m *UncommittedViews) CountUpdatedTables() int

func (*UncommittedViews) CountUpdatedViews

func (m *UncommittedViews) CountUpdatedViews() int

func (*UncommittedViews) IsEmpty

func (m *UncommittedViews) IsEmpty() bool

func (*UncommittedViews) SetForCreatedView

func (m *UncommittedViews) SetForCreatedView(fileInfo *FileInfo)

func (*UncommittedViews) SetForUpdatedView

func (m *UncommittedViews) SetForUpdatedView(fileInfo *FileInfo)

func (*UncommittedViews) UncommittedFiles

func (m *UncommittedViews) UncommittedFiles() (map[string]*FileInfo, map[string]*FileInfo)

func (*UncommittedViews) UncommittedTempViews

func (m *UncommittedViews) UncommittedTempViews() map[string]*FileInfo

func (*UncommittedViews) Unset

func (m *UncommittedViews) Unset(fileInfo *FileInfo)

type UndeclaredCursorError

type UndeclaredCursorError struct {
	*BaseError
}

type UndeclaredTemporaryTableError

type UndeclaredTemporaryTableError struct {
	*BaseError
}

type UndeclaredVariableError

type UndeclaredVariableError struct {
	*BaseError
}

type UndefinedConstantError

type UndefinedConstantError struct {
	*BaseError
}

type UndefinedInLineTableError

type UndefinedInLineTableError struct {
	*BaseError
}

type UnknownFormatPlaceholderError

type UnknownFormatPlaceholderError struct {
	*BaseError
}

type UnsupportedUrlSchemeError

type UnsupportedUrlSchemeError struct {
	*BaseError
}

type UpdateFieldNotExistError

type UpdateFieldNotExistError struct {
	*BaseError
}

type UpdateValueAmbiguousError

type UpdateValueAmbiguousError struct {
	*BaseError
}

type UrlResource

type UrlResource struct {
	MimeType string
	Data     []byte
}

func NewUrlResource

func NewUrlResource(res *http.Response) (*UrlResource, error)

type UserDefinedFunction

type UserDefinedFunction struct {
	Name         parser.Identifier
	Statements   []parser.Statement
	Parameters   []parser.Variable
	Defaults     map[string]parser.QueryExpression
	RequiredArgs int

	IsAggregate bool
	Cursor      parser.Identifier // For Aggregate Functions
}

func (*UserDefinedFunction) CheckArgsLen

func (fn *UserDefinedFunction) CheckArgsLen(expr parser.QueryExpression, name string, argsLen int) error

func (*UserDefinedFunction) Execute

func (fn *UserDefinedFunction) Execute(ctx context.Context, scope *ReferenceScope, args []value.Primary) (value.Primary, error)

func (*UserDefinedFunction) ExecuteAggregate

func (fn *UserDefinedFunction) ExecuteAggregate(ctx context.Context, scope *ReferenceScope, values []value.Primary, args []value.Primary) (value.Primary, error)

type UserDefinedFunctionMap

type UserDefinedFunctionMap struct {
	*SyncMap
}

func NewUserDefinedFunctionMap

func NewUserDefinedFunctionMap() UserDefinedFunctionMap

func (UserDefinedFunctionMap) CheckDuplicate

func (m UserDefinedFunctionMap) CheckDuplicate(name parser.Identifier) error

func (UserDefinedFunctionMap) Declare

func (UserDefinedFunctionMap) DeclareAggregate

func (m UserDefinedFunctionMap) DeclareAggregate(expr parser.AggregateDeclaration) error

func (UserDefinedFunctionMap) Delete

func (m UserDefinedFunctionMap) Delete(name string)

func (UserDefinedFunctionMap) Dispose

func (m UserDefinedFunctionMap) Dispose(name parser.Identifier) bool

func (UserDefinedFunctionMap) Exists

func (m UserDefinedFunctionMap) Exists(name string) bool

func (UserDefinedFunctionMap) Get

func (UserDefinedFunctionMap) IsEmpty

func (m UserDefinedFunctionMap) IsEmpty() bool

func (UserDefinedFunctionMap) Load

func (UserDefinedFunctionMap) LoadDirect

func (m UserDefinedFunctionMap) LoadDirect(name string) (interface{}, bool)

func (UserDefinedFunctionMap) Store

type UserTriggeredError

type UserTriggeredError struct {
	*BaseError
}

type VariableMap

type VariableMap struct {
	*SyncMap
}

func NewVariableMap

func NewVariableMap() VariableMap

func (VariableMap) Add

func (m VariableMap) Add(variable parser.Variable, val value.Primary) error

func (VariableMap) Declare

func (m VariableMap) Declare(ctx context.Context, scope *ReferenceScope, declaration parser.VariableDeclaration) error

func (VariableMap) Delete

func (m VariableMap) Delete(name string)

func (VariableMap) Dispose

func (m VariableMap) Dispose(variable parser.Variable) bool

func (VariableMap) Exists

func (m VariableMap) Exists(name string) bool

func (VariableMap) Get

func (m VariableMap) Get(variable parser.Variable) (value.Primary, bool)

func (VariableMap) IsEmpty

func (m VariableMap) IsEmpty() bool

func (VariableMap) Load

func (m VariableMap) Load(name string) (value.Primary, bool)

func (VariableMap) LoadDirect

func (m VariableMap) LoadDirect(name string) (interface{}, bool)

func (VariableMap) Set

func (m VariableMap) Set(variable parser.Variable, val value.Primary) bool

func (VariableMap) Store

func (m VariableMap) Store(name string, val value.Primary)

type VariableRedeclaredError

type VariableRedeclaredError struct {
	*BaseError
}

type View

type View struct {
	Header    Header
	RecordSet RecordSet
	FileInfo  *FileInfo
	// contains filtered or unexported fields
}

func LoadView

func LoadView(ctx context.Context, scope *ReferenceScope, tables []parser.QueryExpression, forUpdate bool, useInternalId bool) (*View, error)

func LoadViewFromTableIdentifier

func LoadViewFromTableIdentifier(ctx context.Context, scope *ReferenceScope, table parser.QueryExpression, forUpdate bool, useInternalId bool) (*View, error)

func NewDualView

func NewDualView() *View

func NewView

func NewView() *View

func NewViewFromGroupedRecord

func NewViewFromGroupedRecord(ctx context.Context, flags *option.Flags, referenceRecord ReferenceRecord) (*View, error)

func Select

func Select(ctx context.Context, scope *ReferenceScope, query parser.SelectQuery) (*View, error)

func (*View) Copy

func (view *View) Copy() *View

func (*View) CreateRestorePoint

func (view *View) CreateRestorePoint()

func (*View) Except

func (view *View) Except(ctx context.Context, flags *option.Flags, calcView *View, all bool) (err error)

func (*View) ExtendRecordCapacity

func (view *View) ExtendRecordCapacity(ctx context.Context, scope *ReferenceScope, exprs []parser.QueryExpression, funcs []parser.AnalyticFunction) error

func (*View) FieldIndex

func (view *View) FieldIndex(fieldRef parser.QueryExpression) (int, error)

func (*View) FieldIndices

func (view *View) FieldIndices(fields []parser.QueryExpression) ([]int, error)

func (*View) FieldLen

func (view *View) FieldLen() int

func (*View) FieldViewName

func (view *View) FieldViewName(fieldRef parser.QueryExpression) (string, error)

func (*View) Fix

func (view *View) Fix(ctx context.Context, flags *option.Flags) error

func (*View) GenerateComparisonKeys

func (view *View) GenerateComparisonKeys(ctx context.Context, flags *option.Flags) error

func (*View) GroupBy

func (view *View) GroupBy(ctx context.Context, scope *ReferenceScope, clause parser.GroupByClause) error

func (*View) Having

func (view *View) Having(ctx context.Context, scope *ReferenceScope, clause parser.HavingClause) error

func (*View) InsertFromQuery

func (view *View) InsertFromQuery(ctx context.Context, scope *ReferenceScope, fields []parser.QueryExpression, query parser.SelectQuery) (int, error)

func (*View) InsertValues

func (view *View) InsertValues(ctx context.Context, scope *ReferenceScope, fields []parser.QueryExpression, list []parser.QueryExpression) (int, error)

func (*View) InternalRecordId

func (view *View) InternalRecordId(ref string, recordIndex int) (int, error)

func (*View) Intersect

func (view *View) Intersect(ctx context.Context, flags *option.Flags, calcView *View, all bool) (err error)

func (*View) IsUpdatable

func (view *View) IsUpdatable() bool

func (*View) Len

func (view *View) Len() int

func (*View) Less

func (view *View) Less(i, j int) bool

func (*View) Limit

func (view *View) Limit(ctx context.Context, scope *ReferenceScope, clause parser.LimitClause) error

func (*View) ListValuesForAggregateFunctions

func (view *View) ListValuesForAggregateFunctions(ctx context.Context, scope *ReferenceScope, expr parser.QueryExpression, arg parser.QueryExpression, distinct bool) ([]value.Primary, error)

func (*View) Offset

func (view *View) Offset(ctx context.Context, scope *ReferenceScope, clause parser.OffsetClause) error

func (*View) OrderBy

func (view *View) OrderBy(ctx context.Context, scope *ReferenceScope, clause parser.OrderByClause) error

func (*View) RecordLen

func (view *View) RecordLen() int

func (*View) ReplaceFromQuery

func (view *View) ReplaceFromQuery(ctx context.Context, scope *ReferenceScope, fields []parser.QueryExpression, query parser.SelectQuery, keys []parser.QueryExpression) (int, error)

func (*View) ReplaceValues

func (view *View) ReplaceValues(ctx context.Context, scope *ReferenceScope, fields []parser.QueryExpression, list []parser.QueryExpression, keys []parser.QueryExpression) (int, error)

func (*View) Restore

func (view *View) Restore()

func (*View) RestoreHeaderReferences

func (view *View) RestoreHeaderReferences() error

func (*View) Select

func (view *View) Select(ctx context.Context, scope *ReferenceScope, clause parser.SelectClause) error

func (*View) SelectAllColumns

func (view *View) SelectAllColumns(ctx context.Context, scope *ReferenceScope) error

func (*View) Swap

func (view *View) Swap(i, j int)

func (*View) Union

func (view *View) Union(ctx context.Context, flags *option.Flags, calcView *View, all bool) (err error)

func (*View) Where

func (view *View) Where(ctx context.Context, scope *ReferenceScope, clause parser.WhereClause) error

type ViewMap

type ViewMap struct {
	*SyncMap
}

func NewViewMap

func NewViewMap() ViewMap

func (ViewMap) Clean

func (m ViewMap) Clean(container *file.Container) error

func (ViewMap) CleanWithErrors

func (m ViewMap) CleanWithErrors(container *file.Container) error

func (ViewMap) Delete

func (m ViewMap) Delete(identifier string)

func (ViewMap) Dispose

func (m ViewMap) Dispose(container *file.Container, identifier string) error

func (ViewMap) DisposeTemporaryTable

func (m ViewMap) DisposeTemporaryTable(tablePath parser.QueryExpression) bool

func (ViewMap) Exists

func (m ViewMap) Exists(identifier string) bool

func (ViewMap) Get

func (m ViewMap) Get(identifier string) (*View, error)

func (ViewMap) GetWithInternalId

func (m ViewMap) GetWithInternalId(ctx context.Context, identifier string, flags *option.Flags) (*View, error)

func (ViewMap) IsEmpty

func (m ViewMap) IsEmpty() bool

func (ViewMap) Load

func (m ViewMap) Load(identifier string) (*View, bool)

func (ViewMap) LoadDirect

func (m ViewMap) LoadDirect(identifier string) (interface{}, bool)

func (ViewMap) Set

func (m ViewMap) Set(view *View)

func (ViewMap) Store

func (m ViewMap) Store(identifier string, view *View)

type ViewType

type ViewType int
const (
	ViewTypeFile ViewType = iota
	ViewTypeTemporaryTable
	ViewTypeStdin
	ViewTypeRemoteObject
	ViewTypeStringObject
	ViewTypeInlineTable
)

type VirtualTerminal

type VirtualTerminal interface {
	ReadLine() (string, error)
	Write(string) error
	WriteError(string) error
	SetPrompt(ctx context.Context)
	SetContinuousPrompt(ctx context.Context)
	SaveHistory(string) error
	Teardown() error
	GetSize() (int, int, error)
	ReloadConfig() error
	UpdateCompleter()
}

type WindowFrame

type WindowFrame struct {
	Low     int
	High    int
	Records []int
}

func WindowFrameSet

func WindowFrameSet(partition Partition, expr parser.AnalyticClause) []WindowFrame

Jump to

Keyboard shortcuts

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