Skip to content

Commit

Permalink
Restored pulled _relations changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sukairo-02 committed Dec 27, 2024
1 parent 29df678 commit 23e557c
Showing 1 changed file with 25 additions and 18 deletions.
43 changes: 25 additions & 18 deletions drizzle-orm/src/_relations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,22 +214,27 @@ export type DBQueryConfig<
TTableConfig extends TableRelationalConfig = TableRelationalConfig,
> =
& {
columns?: {
[K in keyof TTableConfig['columns']]?: boolean;
};
with?: {
[K in keyof TTableConfig['relations']]?:
| true
| DBQueryConfig<
TTableConfig['relations'][K] extends One ? 'one' : 'many',
false,
TSchema,
FindTableByDBName<
columns?:
| {
[K in keyof TTableConfig['columns']]?: boolean;
}
| undefined;
with?:
| {
[K in keyof TTableConfig['relations']]?:
| true
| DBQueryConfig<
TTableConfig['relations'][K] extends One ? 'one' : 'many',
false,
TSchema,
TTableConfig['relations'][K]['referencedTableName']
FindTableByDBName<
TSchema,
TTableConfig['relations'][K]['referencedTableName']
>
>
>;
};
| undefined;
}
| undefined;
extras?:
| Record<string, SQL.Aliased>
| ((
Expand All @@ -238,7 +243,8 @@ export type DBQueryConfig<
: TTableConfig['columns']
>,
operators: { sql: Operators['sql'] },
) => Record<string, SQL.Aliased>);
) => Record<string, SQL.Aliased>)
| undefined;
}
& (TRelationType extends 'many' ?
& {
Expand All @@ -260,11 +266,12 @@ export type DBQueryConfig<
: TTableConfig['columns']
>,
operators: OrderByOperators,
) => ValueOrArray<AnyColumn | SQL>);
limit?: number | Placeholder;
) => ValueOrArray<AnyColumn | SQL>)
| undefined;
limit?: number | Placeholder | undefined;
}
& (TIsRoot extends true ? {
offset?: number | Placeholder;
offset?: number | Placeholder | undefined;
}
: {})
: {});
Expand Down

0 comments on commit 23e557c

Please sign in to comment.