This commit is contained in:
Benjamin Toby 2025-06-04 08:44:33 +01:00
parent 761348de08
commit 881128fcea
5 changed files with 8 additions and 1 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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"

View File

@ -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;

View File

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