mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor: 🔥 Remove dead code
This commit is contained in:
parent
592f7c0ac2
commit
7b05a34cce
36 changed files with 32 additions and 1692 deletions
|
|
@ -1,39 +0,0 @@
|
|||
import type {
|
||||
BuildQueryResult,
|
||||
DBQueryConfig,
|
||||
ExtractTablesWithRelations,
|
||||
} from "drizzle-orm";
|
||||
|
||||
import type * as schema from "./schema";
|
||||
|
||||
type Schema = typeof schema;
|
||||
type TablesWithRelations = ExtractTablesWithRelations<Schema>;
|
||||
|
||||
export type IncludeRelation<TableName extends keyof TablesWithRelations> =
|
||||
DBQueryConfig<
|
||||
"one" | "many",
|
||||
boolean,
|
||||
TablesWithRelations,
|
||||
TablesWithRelations[TableName]
|
||||
>["with"];
|
||||
|
||||
export type IncludeColumns<TableName extends keyof TablesWithRelations> =
|
||||
DBQueryConfig<
|
||||
"one" | "many",
|
||||
boolean,
|
||||
TablesWithRelations,
|
||||
TablesWithRelations[TableName]
|
||||
>["columns"];
|
||||
|
||||
export type InferQueryModel<
|
||||
TableName extends keyof TablesWithRelations,
|
||||
Columns extends IncludeColumns<TableName> | undefined = undefined,
|
||||
With extends IncludeRelation<TableName> | undefined = undefined,
|
||||
> = BuildQueryResult<
|
||||
TablesWithRelations,
|
||||
TablesWithRelations[TableName],
|
||||
{
|
||||
columns: Columns;
|
||||
with: With;
|
||||
}
|
||||
>;
|
||||
Loading…
Add table
Add a link
Reference in a new issue