Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,8 @@ import { CLIOptions, Inquirerer, extractFirst } from "inquirerer";
import { getClient } from "../executor";
import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from "../utils";
import type { FieldSchema } from "../utils";
import type { CreateCarInput, CarPatch } from "../../orm/input-types";
import type { CreateCarInput, CarPatch, CarSelect, CarFilter, CarsOrderBy } from "../../orm/input-types";
import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types";
const fieldSchema: FieldSchema = {
id: "uuid",
make: "string",
Expand Down Expand Up @@ -756,7 +757,9 @@ async function handleList(argv: Partial<Record<string, unknown>>, _prompter: Inq
isElectric: true,
createdAt: true
};
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
const findManyArgs = parseFindManyArgs<FindManyArgs<CarSelect, CarFilter, never, CarsOrderBy> & {
select: CarSelect;
}>(argv, defaultSelect);
const client = getClient();
const result = await client.car.findMany(findManyArgs).execute();
console.log(JSON.stringify(result, null, 2));
Expand All @@ -778,7 +781,9 @@ async function handleFindFirst(argv: Partial<Record<string, unknown>>, _prompter
isElectric: true,
createdAt: true
};
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
const findFirstArgs = parseFindFirstArgs<FindFirstArgs<CarSelect, CarFilter, never> & {
select: CarSelect;
}>(argv, defaultSelect);
const client = getClient();
const result = await client.car.findFirst(findFirstArgs).execute();
console.log(JSON.stringify(result, null, 2));
Expand Down Expand Up @@ -1160,7 +1165,8 @@ import { CLIOptions, Inquirerer, extractFirst } from "inquirerer";
import { getClient } from "../executor";
import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from "../utils";
import type { FieldSchema } from "../utils";
import type { CreateDriverInput, DriverPatch } from "../../orm/input-types";
import type { CreateDriverInput, DriverPatch, DriverSelect, DriverFilter, DriversOrderBy } from "../../orm/input-types";
import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types";
const fieldSchema: FieldSchema = {
id: "uuid",
name: "string",
Expand Down Expand Up @@ -1213,7 +1219,9 @@ async function handleList(argv: Partial<Record<string, unknown>>, _prompter: Inq
name: true,
licenseNumber: true
};
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
const findManyArgs = parseFindManyArgs<FindManyArgs<DriverSelect, DriverFilter, never, DriversOrderBy> & {
select: DriverSelect;
}>(argv, defaultSelect);
const client = getClient();
const result = await client.driver.findMany(findManyArgs).execute();
console.log(JSON.stringify(result, null, 2));
Expand All @@ -1232,7 +1240,9 @@ async function handleFindFirst(argv: Partial<Record<string, unknown>>, _prompter
name: true,
licenseNumber: true
};
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
const findFirstArgs = parseFindFirstArgs<FindFirstArgs<DriverSelect, DriverFilter, never> & {
select: DriverSelect;
}>(argv, defaultSelect);
const client = getClient();
const result = await client.driver.findFirst(findFirstArgs).execute();
console.log(JSON.stringify(result, null, 2));
Expand Down Expand Up @@ -3191,7 +3201,8 @@ import { CLIOptions, Inquirerer, extractFirst } from "inquirerer";
import { getClient } from "../../executor";
import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from "../../utils";
import type { FieldSchema } from "../../utils";
import type { CreateUserInput, UserPatch } from "../../../orm/input-types";
import type { CreateUserInput, UserPatch, UserSelect, UserFilter, UsersOrderBy } from "../../../orm/input-types";
import type { FindManyArgs, FindFirstArgs } from "../../../orm/select-types";
const fieldSchema: FieldSchema = {
id: "uuid",
email: "string",
Expand Down Expand Up @@ -3244,7 +3255,9 @@ async function handleList(argv: Partial<Record<string, unknown>>, _prompter: Inq
email: true,
name: true
};
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
const findManyArgs = parseFindManyArgs<FindManyArgs<UserSelect, UserFilter, never, UsersOrderBy> & {
select: UserSelect;
}>(argv, defaultSelect);
const client = getClient("auth");
const result = await client.user.findMany(findManyArgs).execute();
console.log(JSON.stringify(result, null, 2));
Expand All @@ -3263,7 +3276,9 @@ async function handleFindFirst(argv: Partial<Record<string, unknown>>, _prompter
email: true,
name: true
};
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
const findFirstArgs = parseFindFirstArgs<FindFirstArgs<UserSelect, UserFilter, never> & {
select: UserSelect;
}>(argv, defaultSelect);
const client = getClient("auth");
const result = await client.user.findFirst(findFirstArgs).execute();
console.log(JSON.stringify(result, null, 2));
Expand Down Expand Up @@ -3420,7 +3435,8 @@ import { CLIOptions, Inquirerer, extractFirst } from "inquirerer";
import { getClient } from "../../executor";
import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from "../../utils";
import type { FieldSchema } from "../../utils";
import type { CreateMemberInput, MemberPatch } from "../../../orm/input-types";
import type { CreateMemberInput, MemberPatch, MemberSelect, MemberFilter, MembersOrderBy } from "../../../orm/input-types";
import type { FindManyArgs, FindFirstArgs } from "../../../orm/select-types";
const fieldSchema: FieldSchema = {
id: "uuid",
role: "string"
Expand Down Expand Up @@ -3471,7 +3487,9 @@ async function handleList(argv: Partial<Record<string, unknown>>, _prompter: Inq
id: true,
role: true
};
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
const findManyArgs = parseFindManyArgs<FindManyArgs<MemberSelect, MemberFilter, never, MembersOrderBy> & {
select: MemberSelect;
}>(argv, defaultSelect);
const client = getClient("members");
const result = await client.member.findMany(findManyArgs).execute();
console.log(JSON.stringify(result, null, 2));
Expand All @@ -3489,7 +3507,9 @@ async function handleFindFirst(argv: Partial<Record<string, unknown>>, _prompter
id: true,
role: true
};
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
const findFirstArgs = parseFindFirstArgs<FindFirstArgs<MemberSelect, MemberFilter, never> & {
select: MemberSelect;
}>(argv, defaultSelect);
const client = getClient("members");
const result = await client.member.findFirst(findFirstArgs).execute();
console.log(JSON.stringify(result, null, 2));
Expand Down Expand Up @@ -3631,7 +3651,8 @@ import { CLIOptions, Inquirerer, extractFirst } from "inquirerer";
import { getClient } from "../../executor";
import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from "../../utils";
import type { FieldSchema } from "../../utils";
import type { CreateCarInput, CarPatch } from "../../../orm/input-types";
import type { CreateCarInput, CarPatch, CarSelect, CarFilter, CarsOrderBy } from "../../../orm/input-types";
import type { FindManyArgs, FindFirstArgs } from "../../../orm/select-types";
const fieldSchema: FieldSchema = {
id: "uuid",
make: "string",
Expand Down Expand Up @@ -3690,7 +3711,9 @@ async function handleList(argv: Partial<Record<string, unknown>>, _prompter: Inq
isElectric: true,
createdAt: true
};
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
const findManyArgs = parseFindManyArgs<FindManyArgs<CarSelect, CarFilter, never, CarsOrderBy> & {
select: CarSelect;
}>(argv, defaultSelect);
const client = getClient("app");
const result = await client.car.findMany(findManyArgs).execute();
console.log(JSON.stringify(result, null, 2));
Expand All @@ -3712,7 +3735,9 @@ async function handleFindFirst(argv: Partial<Record<string, unknown>>, _prompter
isElectric: true,
createdAt: true
};
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
const findFirstArgs = parseFindFirstArgs<FindFirstArgs<CarSelect, CarFilter, never> & {
select: CarSelect;
}>(argv, defaultSelect);
const client = getClient("app");
const result = await client.car.findFirst(findFirstArgs).execute();
console.log(JSON.stringify(result, null, 2));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,31 +373,6 @@ export interface CommentFilter {
or?: CommentFilter[];
not?: CommentFilter;
}
// ============ Table Condition Types ============
export interface UserCondition {
id?: string | null;
email?: string | null;
name?: string | null;
age?: number | null;
isActive?: boolean | null;
createdAt?: string | null;
metadata?: unknown | null;
}
export interface PostCondition {
id?: string | null;
title?: string | null;
content?: string | null;
authorId?: string | null;
publishedAt?: string | null;
tags?: string | null;
}
export interface CommentCondition {
id?: string | null;
body?: string | null;
postId?: string | null;
authorId?: string | null;
createdAt?: string | null;
}
// ============ OrderBy Types ============
export type UsersOrderBy = "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "NATURAL" | "ID_ASC" | "ID_DESC" | "EMAIL_ASC" | "EMAIL_DESC" | "NAME_ASC" | "NAME_DESC" | "AGE_ASC" | "AGE_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "METADATA_ASC" | "METADATA_DESC";
export type PostsOrderBy = "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "NATURAL" | "ID_ASC" | "ID_DESC" | "TITLE_ASC" | "TITLE_DESC" | "CONTENT_ASC" | "CONTENT_DESC" | "AUTHOR_ID_ASC" | "AUTHOR_ID_DESC" | "PUBLISHED_AT_ASC" | "PUBLISHED_AT_DESC" | "TAGS_ASC" | "TAGS_DESC";
Expand Down Expand Up @@ -771,16 +746,6 @@ export interface UserFilter {
or?: UserFilter[];
not?: UserFilter;
}
// ============ Table Condition Types ============
export interface UserCondition {
id?: string | null;
email?: string | null;
name?: string | null;
age?: number | null;
isActive?: boolean | null;
createdAt?: string | null;
metadata?: unknown | null;
}
// ============ OrderBy Types ============
export type UsersOrderBy = "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "NATURAL" | "ID_ASC" | "ID_DESC" | "EMAIL_ASC" | "EMAIL_DESC" | "NAME_ASC" | "NAME_DESC" | "AGE_ASC" | "AGE_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "METADATA_ASC" | "METADATA_DESC";
// ============ CRUD Input Types ============
Expand Down Expand Up @@ -1096,16 +1061,6 @@ export interface UserFilter {
or?: UserFilter[];
not?: UserFilter;
}
// ============ Table Condition Types ============
export interface UserCondition {
id?: string | null;
email?: string | null;
name?: string | null;
age?: number | null;
isActive?: boolean | null;
createdAt?: string | null;
metadata?: unknown | null;
}
// ============ OrderBy Types ============
export type UsersOrderBy = "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "NATURAL" | "ID_ASC" | "ID_DESC" | "EMAIL_ASC" | "EMAIL_DESC" | "NAME_ASC" | "NAME_DESC" | "AGE_ASC" | "AGE_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "METADATA_ASC" | "METADATA_DESC";
// ============ CRUD Input Types ============
Expand Down Expand Up @@ -1433,16 +1388,6 @@ export interface UserFilter {
or?: UserFilter[];
not?: UserFilter;
}
// ============ Table Condition Types ============
export interface UserCondition {
id?: string | null;
email?: string | null;
name?: string | null;
age?: number | null;
isActive?: boolean | null;
createdAt?: string | null;
metadata?: unknown | null;
}
// ============ OrderBy Types ============
export type UsersOrderBy = "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "NATURAL" | "ID_ASC" | "ID_DESC" | "EMAIL_ASC" | "EMAIL_DESC" | "NAME_ASC" | "NAME_DESC" | "AGE_ASC" | "AGE_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "METADATA_ASC" | "METADATA_DESC";
// ============ CRUD Input Types ============
Expand Down Expand Up @@ -1815,22 +1760,6 @@ export interface ProfileFilter {
or?: ProfileFilter[];
not?: ProfileFilter;
}
// ============ Table Condition Types ============
export interface UserCondition {
id?: string | null;
email?: string | null;
name?: string | null;
age?: number | null;
isActive?: boolean | null;
createdAt?: string | null;
metadata?: unknown | null;
}
export interface ProfileCondition {
id?: string | null;
bio?: string | null;
userId?: string | null;
avatarUrl?: string | null;
}
// ============ OrderBy Types ============
export type UsersOrderBy = "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "NATURAL" | "ID_ASC" | "ID_DESC" | "EMAIL_ASC" | "EMAIL_DESC" | "NAME_ASC" | "NAME_DESC" | "AGE_ASC" | "AGE_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "METADATA_ASC" | "METADATA_DESC";
export type ProfilesOrderBy = "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "NATURAL" | "ID_ASC" | "ID_DESC" | "BIO_ASC" | "BIO_DESC" | "USER_ID_ASC" | "USER_ID_DESC" | "AVATAR_URL_ASC" | "AVATAR_URL_DESC";
Expand Down Expand Up @@ -2210,20 +2139,6 @@ export interface CategoryFilter {
or?: CategoryFilter[];
not?: CategoryFilter;
}
// ============ Table Condition Types ============
export interface PostCondition {
id?: string | null;
title?: string | null;
content?: string | null;
authorId?: string | null;
publishedAt?: string | null;
tags?: string | null;
}
export interface CategoryCondition {
id?: string | null;
name?: string | null;
slug?: string | null;
}
// ============ OrderBy Types ============
export type PostsOrderBy = "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "NATURAL" | "ID_ASC" | "ID_DESC" | "TITLE_ASC" | "TITLE_DESC" | "CONTENT_ASC" | "CONTENT_DESC" | "AUTHOR_ID_ASC" | "AUTHOR_ID_DESC" | "PUBLISHED_AT_ASC" | "PUBLISHED_AT_DESC" | "TAGS_ASC" | "TAGS_DESC";
export type CategoriesOrderBy = "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "NATURAL" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "SLUG_ASC" | "SLUG_DESC";
Expand Down
Loading
Loading