Update Types

This commit is contained in:
Benjamin Toby 2024-11-09 07:09:00 +01:00
parent 0d6b1d7e4c
commit 7dd8111b5b
2 changed files with 14 additions and 9 deletions

View File

@ -1174,26 +1174,31 @@ export type AuthFetchQuery = ServerQueryParam & {
[key: string]: string | number | { [key: string]: any };
};
export type ServerQueryParamsJoin = {
export type ServerQueryParamsJoin<
Table extends string = string,
Field extends object = { [key: string]: any }
> = {
joinType: "INNER JOIN" | "JOIN" | "LEFT JOIN" | "RIGHT JOIN";
tableName: string;
tableName: Table;
match?:
| ServerQueryParamsJoinMatchObject
| ServerQueryParamsJoinMatchObject[];
| ServerQueryParamsJoinMatchObject<Field>
| ServerQueryParamsJoinMatchObject<Field>[];
selectFields?: (
| string
| keyof Field
| {
field: string;
field: keyof Field;
alias?: string;
}
)[];
};
export type ServerQueryParamsJoinMatchObject = {
export type ServerQueryParamsJoinMatchObject<
Field extends object = { [key: string]: any }
> = {
/** Field name from the **Root Table** */
source: string | ServerQueryParamsJoinMatchSourceTargetObject;
/** Field name from the **Join Table** */
target: string | ServerQueryParamsJoinMatchSourceTargetObject;
target: keyof Field | ServerQueryParamsJoinMatchSourceTargetObject;
};
export type ServerQueryParamsJoinMatchSourceTargetObject = {

View File

@ -1,6 +1,6 @@
{
"name": "@moduletrace/datasquirel",
"version": "2.5.6",
"version": "2.5.7",
"description": "Cloud-based SQL data management tool",
"main": "index.js",
"bin": {