Updates
This commit is contained in:
@@ -146,6 +146,23 @@ export default function sqlGenerator<
|
||||
mtch: ServerQueryParamsJoinMatchObject,
|
||||
join: ServerQueryParamsJoin,
|
||||
) {
|
||||
if (mtch.__batch) {
|
||||
let btch_mtch = ``;
|
||||
btch_mtch += `(`;
|
||||
|
||||
for (let i = 0; i < mtch.__batch.matches.length; i++) {
|
||||
const __mtch = mtch.__batch.matches[i];
|
||||
btch_mtch += `${generateJoinStr(__mtch, join)}`;
|
||||
if (i < mtch.__batch.matches.length - 1) {
|
||||
btch_mtch += ` ${mtch.__batch.operator || "OR"} `;
|
||||
}
|
||||
}
|
||||
|
||||
btch_mtch += `)`;
|
||||
|
||||
return btch_mtch;
|
||||
}
|
||||
|
||||
return `${finalDbName}${
|
||||
typeof mtch.source == "object" ? mtch.source.tableName : tableName
|
||||
}.${
|
||||
|
||||
@@ -1258,11 +1258,15 @@ export type ServerQueryParamsJoinMatchObject<
|
||||
Field extends object = { [key: string]: any },
|
||||
> = {
|
||||
/** Field name from the **Root Table** */
|
||||
source: string | ServerQueryParamsJoinMatchSourceTargetObject;
|
||||
source?: string | ServerQueryParamsJoinMatchSourceTargetObject;
|
||||
/** Field name from the **Join Table** */
|
||||
target?: keyof Field | ServerQueryParamsJoinMatchSourceTargetObject;
|
||||
/** A literal value: No source and target Needed! */
|
||||
targetLiteral?: string;
|
||||
__batch?: {
|
||||
matches: Omit<ServerQueryParamsJoinMatchObject<Field>, "__batch">[];
|
||||
operator: "AND" | "OR";
|
||||
};
|
||||
};
|
||||
|
||||
export type ServerQueryParamsJoinMatchSourceTargetObject = {
|
||||
|
||||
Reference in New Issue
Block a user