Updates
This commit is contained in:
Vendored
+1
-1
@@ -21,5 +21,5 @@ export default function get<T extends {
|
||||
[k: string]: any;
|
||||
} = {
|
||||
[k: string]: any;
|
||||
}>({ key, db, query, queryValues, tableName, user_id, debug, forceLocal, }: Param<T>): Promise<GetReturn>;
|
||||
}, R extends any = any>({ key, db, query, queryValues, tableName, user_id, debug, forceLocal, }: Param<T>): Promise<GetReturn<R>>;
|
||||
export {};
|
||||
|
||||
@@ -30,6 +30,12 @@ function sqlGenerator({ tableName, genObject, dbFullName }) {
|
||||
if (queryObj.equality == "LIKE") {
|
||||
str = `LOWER(${finalFieldName}) LIKE LOWER('%${valueParsed}%')`;
|
||||
}
|
||||
else if (queryObj.equality == "REGEXP") {
|
||||
str = `${finalFieldName} REGEXP '${valueParsed}'`;
|
||||
}
|
||||
else if (queryObj.equality == "FULLTEXT") {
|
||||
str = `MATCH(${finalFieldName}) AGAINST('${valueParsed}' IN BOOLEAN MODE)`;
|
||||
}
|
||||
else if (queryObj.equality == "NOT EQUAL") {
|
||||
str = `${finalFieldName} != ?`;
|
||||
sqlSearhValues.push(valueParsed);
|
||||
|
||||
Vendored
+4
-3
@@ -277,9 +277,9 @@ export interface UpdateUserFunctionReturn {
|
||||
success: boolean;
|
||||
payload?: Object[] | string;
|
||||
}
|
||||
export interface GetReturn {
|
||||
export interface GetReturn<R extends any = any> {
|
||||
success: boolean;
|
||||
payload?: any;
|
||||
payload?: R;
|
||||
msg?: string;
|
||||
error?: string;
|
||||
schema?: DSQL_TableSchemaType;
|
||||
@@ -942,7 +942,7 @@ export type FetchApiReturn = {
|
||||
[key: string]: any;
|
||||
};
|
||||
export declare const ServerQueryOperators: readonly ["AND", "OR"];
|
||||
export declare const ServerQueryEqualities: readonly ["EQUAL", "LIKE", "NOT EQUAL"];
|
||||
export declare const ServerQueryEqualities: readonly ["EQUAL", "LIKE", "NOT EQUAL", "REGEXP", "FULLTEXT"];
|
||||
export type ServerQueryParam<T extends {
|
||||
[k: string]: any;
|
||||
} = {
|
||||
@@ -1120,6 +1120,7 @@ export type HandleSocialDbFunctionParams = {
|
||||
additionalFields?: string[];
|
||||
debug?: boolean;
|
||||
loginOnly?: boolean;
|
||||
social_id?: string | number;
|
||||
};
|
||||
export type HandleSocialDbFunctionReturn = {
|
||||
success: boolean;
|
||||
|
||||
Vendored
+7
-1
@@ -12,6 +12,12 @@ exports.TextFieldTypesArray = [
|
||||
{ title: "Shell", value: "shell" },
|
||||
];
|
||||
exports.ServerQueryOperators = ["AND", "OR"];
|
||||
exports.ServerQueryEqualities = ["EQUAL", "LIKE", "NOT EQUAL"];
|
||||
exports.ServerQueryEqualities = [
|
||||
"EQUAL",
|
||||
"LIKE",
|
||||
"NOT EQUAL",
|
||||
"REGEXP",
|
||||
"FULLTEXT",
|
||||
];
|
||||
exports.DataCrudRequestMethods = ["GET", "POST", "PUT", "DELETE"];
|
||||
exports.DsqlCrudActions = ["insert", "update", "delete", "get"];
|
||||
|
||||
Reference in New Issue
Block a user