From 9ef533c1faf859a9ea1dbb18aa02b04adecc7dbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20de=20=C3=81vila=20Martins?= Date: Wed, 4 Dec 2024 11:17:38 -0300 Subject: [PATCH] Add IN to safe string (#86) --- src/safe-string.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/safe-string.ts b/src/safe-string.ts index 2978c9a..5d9587d 100644 --- a/src/safe-string.ts +++ b/src/safe-string.ts @@ -124,6 +124,22 @@ export class SafeString { divide(other: SafeString | null | number | string): SafeString { return dsql`(${this} / ${other})`; } + + /** + * @since 2.0.8 + */ + in(other: SafeString | null | number | string | SafeString[]): SafeString { + return dsql`(${this} IN (${other}))`; + } + + /** + * @since 2.0.8 + */ + notIn( + other: SafeString | null | number | string | SafeString[] + ): SafeString { + return dsql`(${this} NOT IN (${other}))`; + } } /**