From a71dd37c2d12ac1260cc15eddf32f0e270b7933f 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..18d48fa 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 insensitive equal to Text2 + Synonymous Form: Text2 is case insensitive 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..9ad5363 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 insensitive equal to': (from, to): EqualsNode => [ + 'Equals', + ['ToLower', from], + ['ToLower', to], + ], 'starts with': (from, to): StartsWithNode => ['StartsWith', from, to], 'ends with': (from, to): EndsWithNode => ['EndsWith', from, to], contains: (from, to): ContainsNode => ['Contains', from, to],