From fd9a360cd97e3cd08bc04d467be9311ecbcc945f Mon Sep 17 00:00:00 2001 From: Otavio Jacobi Date: Thu, 24 Oct 2024 10:06:09 -0300 Subject: [PATCH] Add `is case insensitive equal to` for Text types Change-type: minor --- Type.sbvr | 3 +++ src/types/text.ts | 6 ++++++ 2 files changed, 9 insertions(+) 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],