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 = { 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 = { 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": {