@balena/abstract-sql-compiler
Advanced tools
Comparing version 9.1.4 to 9.2.0-build-add-typings-bb2233220c988afaece120ece38e035c8dd14b02-1
@@ -7,2 +7,6 @@ # Change Log | ||
## 9.2.0 - 2024-06-12 | ||
* Adds `EndsWithNode` and `ContainsNode` typings [Pagan Gazzard] | ||
## 9.1.4 - 2024-04-09 | ||
@@ -9,0 +13,0 @@ |
@@ -66,3 +66,5 @@ export declare const enum Engines { | ||
export type StartsWithNode = ['StartsWith', TextTypeNodes, TextTypeNodes]; | ||
export type StrictBooleanTypeNodes = BooleanNode | EqualsNode | NotEqualsNode | IsDistinctFromNode | IsNotDistinctFromNode | GreaterThanNode | GreaterThanOrEqualNode | LessThanNode | LessThanOrEqualNode | BetweenNode | LikeNode | InNode | NotInNode | ExistsNode | NotExistsNode | NotNode | AndNode | OrNode | StartsWithNode; | ||
export type EndsWithNode = ['EndsWith', TextTypeNodes, TextTypeNodes]; | ||
export type ContainsNode = ['Contains', TextTypeNodes, TextTypeNodes]; | ||
export type StrictBooleanTypeNodes = BooleanNode | EqualsNode | NotEqualsNode | IsDistinctFromNode | IsNotDistinctFromNode | GreaterThanNode | GreaterThanOrEqualNode | LessThanNode | LessThanOrEqualNode | BetweenNode | LikeNode | InNode | NotInNode | ExistsNode | NotExistsNode | NotNode | AndNode | OrNode | StartsWithNode | EndsWithNode | ContainsNode; | ||
export type BooleanTypeNodes = StrictBooleanTypeNodes | UnknownTypeNodes; | ||
@@ -69,0 +71,0 @@ export type YearNode = ['Year', DateTypeNodes]; |
@@ -282,2 +282,7 @@ "use strict"; | ||
const SubtractDateMatcher = tryMatches(matchArgs('SubtractDateDate', DateValue, DateValue), matchArgs('SubtractDateDuration', DateValue, DurationValue), matchArgs('SubtractDateNumber', DateValue, NumericValue)); | ||
const EndsWithMatcher = rewriteMatch('Endswith', [TextValue, TextValue], Helper(([haystack, needle]) => [ | ||
'Like', | ||
haystack, | ||
['Concatenate', ['EmbeddedText', '%'], ['EscapeForLike', needle]], | ||
])); | ||
const typeRules = { | ||
@@ -1125,7 +1130,4 @@ UnionQuery: (args) => { | ||
])), | ||
Endswith: rewriteMatch('Endswith', [TextValue, TextValue], Helper(([haystack, needle]) => [ | ||
'Like', | ||
haystack, | ||
['Concatenate', ['EmbeddedText', '%'], ['EscapeForLike', needle]], | ||
])), | ||
Endswith: EndsWithMatcher, | ||
EndsWith: EndsWithMatcher, | ||
IndexOf: rewriteMatch('IndexOf', [TextValue, TextValue], Helper(([haystack, needle]) => [ | ||
@@ -1132,0 +1134,0 @@ 'Subtract', |
@@ -19,3 +19,3 @@ import type { AbstractSqlQuery, AbstractSqlType, InsertQueryNode, SelectQueryNode, UnionQueryNode, UpdateQueryNode, DeleteQueryNode, UpsertQueryNode } from './AbstractSQLCompiler'; | ||
export declare const isNumericValue: (type: unknown) => type is "Number" | "Integer" | "Real" | "Add" | "Subtract" | "Multiply" | "Divide" | "StrPos" | "Year" | "Month" | "Day" | "Hour" | "Minute" | "Second" | "Fractionalseconds" | "Totalseconds" | "Round" | "Floor" | "Ceiling" | "Count" | "Average" | "Sum" | "BitwiseAnd" | "BitwiseShiftRight" | "CharacterLength" | "SubtractDateDate"; | ||
export declare const isBooleanValue: (type: unknown) => type is "Boolean" | "Equals" | "NotEquals" | "IsDistinctFrom" | "IsNotDistinctFrom" | "GreaterThan" | "GreaterThanOrEqual" | "LessThan" | "LessThanOrEqual" | "Between" | "Like" | "In" | "NotIn" | "Exists" | "NotExists" | "Not" | "And" | "Or" | "StartsWith"; | ||
export declare const isBooleanValue: (type: unknown) => type is "Boolean" | "Equals" | "NotEquals" | "IsDistinctFrom" | "IsNotDistinctFrom" | "GreaterThan" | "GreaterThanOrEqual" | "LessThan" | "LessThanOrEqual" | "Between" | "Like" | "In" | "NotIn" | "Exists" | "NotExists" | "Not" | "And" | "Or" | "StartsWith" | "EndsWith" | "Contains"; | ||
export declare const isDateValue: (type: unknown) => type is "Date" | "ToDate" | "ToTime" | "CurrentTimestamp" | "CurrentDate" | "DateTrunc" | "SubtractDateNumber" | "SubtractDateDuration" | "AddDateNumber" | "AddDateDuration"; | ||
@@ -22,0 +22,0 @@ export declare const isArrayValue: (type: unknown) => type is "TextArray"; |
{ | ||
"name": "@balena/abstract-sql-compiler", | ||
"version": "9.1.4", | ||
"version": "9.2.0-build-add-typings-bb2233220c988afaece120ece38e035c8dd14b02-1", | ||
"description": "A translator for abstract sql into sql.", | ||
@@ -64,4 +64,4 @@ "main": "out/AbstractSQLCompiler.js", | ||
"versionist": { | ||
"publishedAt": "2024-04-09T09:38:55.463Z" | ||
"publishedAt": "2024-06-12T12:41:02.471Z" | ||
} | ||
} |
@@ -87,2 +87,4 @@ export const enum Engines { | ||
export type StartsWithNode = ['StartsWith', TextTypeNodes, TextTypeNodes]; | ||
export type EndsWithNode = ['EndsWith', TextTypeNodes, TextTypeNodes]; | ||
export type ContainsNode = ['Contains', TextTypeNodes, TextTypeNodes]; | ||
export type StrictBooleanTypeNodes = | ||
@@ -107,3 +109,5 @@ | BooleanNode | ||
| OrNode | ||
| StartsWithNode; | ||
| StartsWithNode | ||
| EndsWithNode | ||
| ContainsNode; | ||
export type BooleanTypeNodes = StrictBooleanTypeNodes | UnknownTypeNodes; | ||
@@ -110,0 +114,0 @@ |
@@ -534,2 +534,14 @@ import * as _ from 'lodash'; | ||
const EndsWithMatcher = rewriteMatch( | ||
'Endswith', | ||
[TextValue, TextValue], | ||
Helper<MatchFn<LikeNode>>( | ||
([haystack, needle]: [TextTypeNodes, TextTypeNodes]) => [ | ||
'Like', | ||
haystack, | ||
['Concatenate', ['EmbeddedText', '%'], ['EscapeForLike', needle]], | ||
], | ||
), | ||
); | ||
const typeRules = { | ||
@@ -1556,13 +1568,4 @@ UnionQuery: (args): UnionQueryNode => { | ||
), | ||
Endswith: rewriteMatch( | ||
'Endswith', | ||
[TextValue, TextValue], | ||
Helper<MatchFn<LikeNode>>( | ||
([haystack, needle]: [TextTypeNodes, TextTypeNodes]) => [ | ||
'Like', | ||
haystack, | ||
['Concatenate', ['EmbeddedText', '%'], ['EscapeForLike', needle]], | ||
], | ||
), | ||
), | ||
Endswith: EndsWithMatcher, | ||
EndsWith: EndsWithMatcher, | ||
IndexOf: rewriteMatch( | ||
@@ -1569,0 +1572,0 @@ 'IndexOf', |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
850107
17933
2