Updates
This commit is contained in:
parent
9dbaca5ebe
commit
e4590e74d9
@ -35,8 +35,12 @@ function sqlGenerator({ tableName, genObject }) {
|
||||
typeof queryObj.value == "number"
|
||||
) {
|
||||
const valueParsed = String(queryObj.value);
|
||||
|
||||
if (queryObj.equality == "LIKE") {
|
||||
str = `LOWER(${finalFieldName}) LIKE LOWER('%${valueParsed}%')`;
|
||||
} else if (queryObj.equality == "NOT EQUAL") {
|
||||
str = `${finalFieldName} != ?`;
|
||||
sqlSearhValues.push(valueParsed);
|
||||
} else {
|
||||
sqlSearhValues.push(valueParsed);
|
||||
}
|
||||
@ -49,6 +53,9 @@ function sqlGenerator({ tableName, genObject }) {
|
||||
strArray.push(
|
||||
`LOWER(${finalFieldName}) LIKE LOWER('%${valueParsed}%')`
|
||||
);
|
||||
} else if (queryObj.equality == "NOT EQUAL") {
|
||||
strArray.push(`${finalFieldName} != ?`);
|
||||
sqlSearhValues.push(valueParsed);
|
||||
} else {
|
||||
strArray.push(`${finalFieldName} = ?`);
|
||||
sqlSearhValues.push(valueParsed);
|
||||
|
4
package-shared/types/index.d.ts
vendored
4
package-shared/types/index.d.ts
vendored
@ -917,7 +917,7 @@ export type ServerQueryParam = {
|
||||
strategy: "ASC" | "DESC";
|
||||
};
|
||||
searchOperator?: "AND" | "OR";
|
||||
searchEquality?: "EQUAL" | "LIKE";
|
||||
searchEquality?: "EQUAL" | "LIKE" | "NOT EQUAL";
|
||||
addUserId?: {
|
||||
fieldName: string;
|
||||
};
|
||||
@ -931,7 +931,7 @@ export type ServerQueryQueryObject<T extends object = {
|
||||
[key in keyof T]: {
|
||||
value: string | string[];
|
||||
operator?: "AND" | "OR";
|
||||
equality?: "EQUAL" | "LIKE";
|
||||
equality?: "EQUAL" | "LIKE" | "NOT EQUAL";
|
||||
tableName?: string;
|
||||
};
|
||||
};
|
||||
|
@ -1095,7 +1095,7 @@ export type ServerQueryParam = {
|
||||
strategy: "ASC" | "DESC";
|
||||
};
|
||||
searchOperator?: "AND" | "OR";
|
||||
searchEquality?: "EQUAL" | "LIKE";
|
||||
searchEquality?: "EQUAL" | "LIKE" | "NOT EQUAL";
|
||||
addUserId?: {
|
||||
fieldName: string;
|
||||
};
|
||||
@ -1109,7 +1109,7 @@ export type ServerQueryQueryObject<T extends object = { [key: string]: any }> =
|
||||
[key in keyof T]: {
|
||||
value: string | string[];
|
||||
operator?: "AND" | "OR";
|
||||
equality?: "EQUAL" | "LIKE";
|
||||
equality?: "EQUAL" | "LIKE" | "NOT EQUAL";
|
||||
tableName?: string;
|
||||
};
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@moduletrace/datasquirel",
|
||||
"version": "3.1.9",
|
||||
"version": "3.2.0",
|
||||
"description": "Cloud-based SQL data management tool",
|
||||
"main": "index.js",
|
||||
"bin": {
|
||||
|
Loading…
Reference in New Issue
Block a user