diff --git a/Type.sbvr b/Type.sbvr index f4faf5c..5577cdf 100644 --- a/Type.sbvr +++ b/Type.sbvr @@ -94,6 +94,9 @@ Fact type: Text1 is equal to Text2 Synonymous Form: Text1 equals Text2 Synonymous Form: Text2 equals Text1 +Fact type: Text1 is case insensitively equal to Text2 + Synonymous Form: Text2 is case insensitively equal to Text1 + Fact type: Text1 starts with Text2 Fact type: Text1 ends with Text2 diff --git a/src/types/text.ts b/src/types/text.ts index f3736dc..54fd2bd 100644 --- a/src/types/text.ts +++ b/src/types/text.ts @@ -3,6 +3,7 @@ import type { StartsWithNode, EndsWithNode, ContainsNode, + EqualsNode, } from '@balena/abstract-sql-compiler'; import * as TypeUtils from '../type-utils'; @@ -27,6 +28,11 @@ export const nativeProperties: TypeUtils.NativeProperties = { export const nativeFactTypes: TypeUtils.NativeFactTypes = { Text: { ...TypeUtils.nativeFactTypeTemplates.equality, + 'is case insensitively equal to': (from, to): EqualsNode => [ + 'Equals', + ['Lower', from], + ['Lower', to], + ], 'starts with': (from, to): StartsWithNode => ['StartsWith', from, to], 'ends with': (from, to): EndsWithNode => ['EndsWith', from, to], contains: (from, to): ContainsNode => ['Contains', from, to],