@@ -13,8 +13,9 @@ const (
1313
1414 ErrCacheKeyNotFound errors.Code = "ErrCacheKeyNotFound"
1515
16- ErrDuplicateColumn errors.Code = "ErrDuplicateColumn"
17- ErrUnknownType errors.Code = "ErrUnknownType"
16+ ErrDuplicateColumn errors.Code = "ErrDuplicateColumn"
17+ ErrUnknownType errors.Code = "ErrUnknownType"
18+ ErrUnknownIdentifier errors.Code = "ErrUnknownIdentifier"
1819
1920 ErrTypeIncompatibleWithBitwiseOperator errors.Code = "ErrTypeIncompatibleWithBitwiseOperator"
2021 ErrTypeIncompatibleWithLogicalOperator errors.Code = "ErrTypeIncompatibleWithLogicalOperator"
@@ -43,6 +44,7 @@ const (
4344 ErrLiteralExpected errors.Code = "ErrLiteralExpected"
4445 ErrIntegerLiteral errors.Code = "ErrIntegerLiteral"
4546 ErrStringLiteral errors.Code = "ErrStringLiteral"
47+ ErrBoolLiteral errors.Code = "ErrBoolLiteral"
4648 ErrLiteralEmptySetNotAllowed errors.Code = "ErrLiteralEmptySetNotAllowed"
4749 ErrLiteralEmptyTupleNotAllowed errors.Code = "ErrLiteralEmptyTupleNotAllowed"
4850 ErrSetLiteralMustContainIntOrString errors.Code = "ErrSetLiteralMustContainIntOrString"
@@ -85,7 +87,18 @@ const (
8587 ErrParameterTypeMistmatch errors.Code = "ErrParameterTypeMistmatch"
8688 ErrCallParameterValueInvalid errors.Code = "ErrCallParameterValueInvalid"
8789
88- //optimizer errors
90+ // bulk insert errors
91+
92+ ErrReadingDatasource errors.Code = "ErrReadingDatasource"
93+ ErrMappingFromDatasource errors.Code = "ErrMappingFromDatasource"
94+ ErrFormatSpecifierExpected errors.Code = "ErrFormatSpecifierExpected"
95+ ErrInvalidFormatSpecifier errors.Code = "ErrInvalidFormatSpecifier"
96+ ErrInputSpecifierExpected errors.Code = "ErrInputSpecifierExpected"
97+ ErrInvalidInputSpecifier errors.Code = "ErrInvalidInputSpecifier"
98+ ErrInvalidBatchSize errors.Code = "ErrInvalidBatchSize"
99+ ErrTypeConversionOnMap errors.Code = "ErrTypeConversionOnMap"
100+
101+ // optimizer errors
89102 ErrAggregateNotAllowedInGroupBy errors.Code = "ErrIdPercentileNotAllowedInGroupBy"
90103)
91104
@@ -103,6 +116,13 @@ func NewErrUnknownType(line int, col int, typ string) error {
103116 )
104117}
105118
119+ func NewErrUnknownIdentifier (line int , col int , ident string ) error {
120+ return errors .New (
121+ ErrUnknownIdentifier ,
122+ fmt .Sprintf ("[%d:%d] unknown identifier '%s'" , line , col , ident ),
123+ )
124+ }
125+
106126func NewErrInternal (msg string ) error {
107127 preamble := "internal error"
108128 _ , filename , line , ok := runtime .Caller (1 )
@@ -186,6 +206,13 @@ func NewErrStringLiteral(line, col int) error {
186206 )
187207}
188208
209+ func NewErrBoolLiteral (line , col int ) error {
210+ return errors .New (
211+ ErrBoolLiteral ,
212+ fmt .Sprintf ("[%d:%d] bool literal expected" , line , col ),
213+ )
214+ }
215+
189216func NewErrLiteralEmptySetNotAllowed (line , col int ) error {
190217 return errors .New (
191218 ErrLiteralEmptySetNotAllowed ,
@@ -533,6 +560,64 @@ func NewErrCallParameterValueInvalid(line, col int, badParameterValue string, pa
533560 )
534561}
535562
563+ // bulk insert
564+
565+ func NewErrReadingDatasource (line , col int , dataSource string , errorText string ) error {
566+ return errors .New (
567+ ErrReadingDatasource ,
568+ fmt .Sprintf ("[%d:%d] unable to read datasource '%s': %s" , line , col , dataSource , errorText ),
569+ )
570+ }
571+
572+ func NewErrMappingFromDatasource (line , col int , dataSource string , errorText string ) error {
573+ return errors .New (
574+ ErrMappingFromDatasource ,
575+ fmt .Sprintf ("[%d:%d] unable to map from datasource '%s': %s" , line , col , dataSource , errorText ),
576+ )
577+ }
578+
579+ func NewErrFormatSpecifierExpected (line , col int ) error {
580+ return errors .New (
581+ ErrFormatSpecifierExpected ,
582+ fmt .Sprintf ("[%d:%d] format specifier expected" , line , col ),
583+ )
584+ }
585+
586+ func NewErrInvalidFormatSpecifier (line , col int , specifier string ) error {
587+ return errors .New (
588+ ErrInvalidFormatSpecifier ,
589+ fmt .Sprintf ("[%d:%d] invalid format specifier '%s'" , line , col , specifier ),
590+ )
591+ }
592+
593+ func NewErrInputSpecifierExpected (line , col int ) error {
594+ return errors .New (
595+ ErrInputSpecifierExpected ,
596+ fmt .Sprintf ("[%d:%d] input specifier expected" , line , col ),
597+ )
598+ }
599+
600+ func NewErrInvalidInputSpecifier (line , col int , specifier string ) error {
601+ return errors .New (
602+ ErrInvalidFormatSpecifier ,
603+ fmt .Sprintf ("[%d:%d] invalid input specifier '%s'" , line , col , specifier ),
604+ )
605+ }
606+
607+ func NewErrInvalidBatchSize (line , col int , batchSize int ) error {
608+ return errors .New (
609+ ErrInvalidBatchSize ,
610+ fmt .Sprintf ("[%d:%d] invalid batch size '%d'" , line , col , batchSize ),
611+ )
612+ }
613+
614+ func NewErrTypeConversionOnMap (line , col int , value interface {}, typeName string ) error {
615+ return errors .New (
616+ ErrTypeConversionOnMap ,
617+ fmt .Sprintf ("[%d:%d] value '%v' cannot be converted to type '%s'" , line , col , value , typeName ),
618+ )
619+ }
620+
536621// optimizer
537622
538623func NewErrAggregateNotAllowedInGroupBy (line , col int , aggName string ) error {
0 commit comments