From 881128fceab4bd89fa64b9ab7e1a479622b2cb27 Mon Sep 17 00:00:00 2001
From: Benjamin Toby <benoti.san@gmail.com>
Date: Wed, 4 Jun 2025 08:44:33 +0100
Subject: [PATCH] Updates

---
 dist/package-shared/functions/dsql/sql/sql-generator.js | 3 +++
 dist/package-shared/types/index.d.ts                    | 1 +
 package-shared/functions/dsql/sql/sql-generator.ts      | 2 ++
 package-shared/types/index.ts                           | 1 +
 package.json                                            | 2 +-
 5 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/dist/package-shared/functions/dsql/sql/sql-generator.js b/dist/package-shared/functions/dsql/sql/sql-generator.js
index 3a12595..2a0d661 100644
--- a/dist/package-shared/functions/dsql/sql/sql-generator.js
+++ b/dist/package-shared/functions/dsql/sql/sql-generator.js
@@ -27,6 +27,9 @@ function sqlGenerator({ tableName, genObject, dbFullName, count }) {
         if (queryObj.nullValue) {
             str = `${finalFieldName} IS NULL`;
         }
+        else if (queryObj.notNullValue) {
+            str = `${finalFieldName} IS NOT NULL`;
+        }
         else if (typeof queryObj.value == "string" ||
             typeof queryObj.value == "number") {
             const valueParsed = String(queryObj.value);
diff --git a/dist/package-shared/types/index.d.ts b/dist/package-shared/types/index.d.ts
index 7ef5a64..9cbbb2c 100644
--- a/dist/package-shared/types/index.d.ts
+++ b/dist/package-shared/types/index.d.ts
@@ -977,6 +977,7 @@ export type ServerQueryObject<T extends object = {
 }> = {
     value?: string | string[];
     nullValue?: boolean;
+    notNullValue?: boolean;
     operator?: (typeof ServerQueryOperators)[number];
     equality?: (typeof ServerQueryEqualities)[number];
     tableName?: string;
diff --git a/package-shared/functions/dsql/sql/sql-generator.ts b/package-shared/functions/dsql/sql/sql-generator.ts
index e27ed68..56cb4dd 100644
--- a/package-shared/functions/dsql/sql/sql-generator.ts
+++ b/package-shared/functions/dsql/sql/sql-generator.ts
@@ -57,6 +57,8 @@ export default function sqlGenerator<
 
         if (queryObj.nullValue) {
             str = `${finalFieldName} IS NULL`;
+        } else if (queryObj.notNullValue) {
+            str = `${finalFieldName} IS NOT NULL`;
         } else if (
             typeof queryObj.value == "string" ||
             typeof queryObj.value == "number"
diff --git a/package-shared/types/index.ts b/package-shared/types/index.ts
index 299a8ad..f9a8e79 100644
--- a/package-shared/types/index.ts
+++ b/package-shared/types/index.ts
@@ -1135,6 +1135,7 @@ export type ServerQueryParam<
 export type ServerQueryObject<T extends object = { [key: string]: any }> = {
     value?: string | string[];
     nullValue?: boolean;
+    notNullValue?: boolean;
     operator?: (typeof ServerQueryOperators)[number];
     equality?: (typeof ServerQueryEqualities)[number];
     tableName?: string;
diff --git a/package.json b/package.json
index 7190519..dd2b778 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
     "name": "@moduletrace/datasquirel",
-    "version": "4.7.2",
+    "version": "4.7.3",
     "description": "Cloud-based SQL data management tool",
     "main": "dist/index.js",
     "bin": {