1// ⚠️ GENERATED FILE - DO NOT EDIT
2// This file is automatically generated by 'prisma-next contract emit'.
3// To regenerate, run: prisma-next contract emit
4import type { CodecTypes as PgTypes } from '@prisma-next/target-postgres/codec-types';
5import type { JsonValue } from '@prisma-next/target-postgres/codec-types';
6import type { Char } from '@prisma-next/target-postgres/codec-types';
7import type { Varchar } from '@prisma-next/target-postgres/codec-types';
8import type { Numeric } from '@prisma-next/target-postgres/codec-types';
9import type { Bit } from '@prisma-next/target-postgres/codec-types';
10import type { VarBit } from '@prisma-next/target-postgres/codec-types';
11import type { Timestamp } from '@prisma-next/target-postgres/codec-types';
12import type { Timestamptz } from '@prisma-next/target-postgres/codec-types';
13import type { Time } from '@prisma-next/target-postgres/codec-types';
14import type { Timetz } from '@prisma-next/target-postgres/codec-types';
15import type { Interval } from '@prisma-next/target-postgres/codec-types';
16import type { QueryOperationTypes as PgAdapterQueryOps } from '@prisma-next/adapter-postgres/operation-types';
17
18import type {
19 ContractWithTypeMaps,
20 TypeMaps as TypeMapsType,
21} from '@prisma-next/sql-contract/types';
22import type {
23 Contract as ContractType,
24 ExecutionHashBase,
25 ProfileHashBase,
26 StorageHashBase,
27} from '@prisma-next/contract/types';
28
29export type StorageHash =
30 StorageHashBase<'sha256:ae5cf43e83687e08354eb6afa512ad5834d96164612280b204c5b7103b01e8e1'>;
31export type ExecutionHash =
32 ExecutionHashBase<'sha256:8c5eef43d2153fd832b8288ed2d8ffc9f5afb62908f8b4b7e6a4b7018444c41f'>;
33export type ProfileHash =
34 ProfileHashBase<'sha256:1a8dbe044289f30a1de958fe800cc5a8378b285d2e126a8c44b58864bac2c18e'>;
35
36export type CodecTypes = PgTypes;
37export type LaneCodecTypes = CodecTypes;
38export type QueryOperationTypes = PgAdapterQueryOps<CodecTypes>;
39type DefaultLiteralValue<CodecId extends string, _Encoded> = CodecId extends keyof CodecTypes
40 ? CodecTypes[CodecId]['output']
41 : _Encoded;
42
43export type FieldOutputTypes = {
44 readonly Post: {
45 readonly id: Char<36>;
46 readonly title: CodecTypes['pg/text@1']['output'];
47 readonly excerpt: CodecTypes['pg/text@1']['output'];
48 readonly userId: CodecTypes['pg/text@1']['output'];
49 readonly createdAt: CodecTypes['pg/timestamptz@1']['output'];
50 };
51 readonly User: {
52 readonly id: Char<36>;
53 readonly email: CodecTypes['pg/text@1']['output'];
54 readonly name: CodecTypes['pg/text@1']['output'];
55 readonly createdAt: CodecTypes['pg/timestamptz@1']['output'];
56 };
57};
58export type FieldInputTypes = {
59 readonly Post: {
60 readonly id: CodecTypes['sql/char@1']['input'];
61 readonly title: CodecTypes['pg/text@1']['input'];
62 readonly excerpt: CodecTypes['pg/text@1']['input'];
63 readonly userId: CodecTypes['pg/text@1']['input'];
64 readonly createdAt: CodecTypes['pg/timestamptz@1']['input'];
65 };
66 readonly User: {
67 readonly id: CodecTypes['sql/char@1']['input'];
68 readonly email: CodecTypes['pg/text@1']['input'];
69 readonly name: CodecTypes['pg/text@1']['input'];
70 readonly createdAt: CodecTypes['pg/timestamptz@1']['input'];
71 };
72};
73export type TypeMaps = TypeMapsType<
74 CodecTypes,
75 QueryOperationTypes,
76 FieldOutputTypes,
77 FieldInputTypes
78>;
79
80type ContractBase = ContractType<
81 {
82 readonly tables: {
83 readonly post: {
84 columns: {
85 readonly id: {
86 readonly nativeType: 'character';
87 readonly codecId: 'sql/char@1';
88 readonly nullable: false;
89 readonly typeParams: { readonly length: 36 };
90 };
91 readonly title: {
92 readonly nativeType: 'text';
93 readonly codecId: 'pg/text@1';
94 readonly nullable: false;
95 };
96 readonly excerpt: {
97 readonly nativeType: 'text';
98 readonly codecId: 'pg/text@1';
99 readonly nullable: false;
100 };
101 readonly userId: {
102 readonly nativeType: 'text';
103 readonly codecId: 'pg/text@1';
104 readonly nullable: false;
105 };
106 readonly createdAt: {
107 readonly nativeType: 'timestamptz';
108 readonly codecId: 'pg/timestamptz@1';
109 readonly nullable: false;
110 readonly default: { readonly kind: 'function'; readonly expression: 'now()' };
111 };
112 };
113 primaryKey: { readonly columns: readonly ['id'] };
114 uniques: readonly [];
115 indexes: readonly [];
116 foreignKeys: readonly [
117 {
118 readonly columns: readonly ['userId'];
119 readonly references: { readonly table: 'user'; readonly columns: readonly ['id'] };
120 readonly constraint: true;
121 readonly index: true;
122 },
123 ];
124 };
125 readonly user: {
126 columns: {
127 readonly id: {
128 readonly nativeType: 'character';
129 readonly codecId: 'sql/char@1';
130 readonly nullable: false;
131 readonly typeParams: { readonly length: 36 };
132 };
133 readonly email: {
134 readonly nativeType: 'text';
135 readonly codecId: 'pg/text@1';
136 readonly nullable: false;
137 };
138 readonly name: {
139 readonly nativeType: 'text';
140 readonly codecId: 'pg/text@1';
141 readonly nullable: false;
142 };
143 readonly createdAt: {
144 readonly nativeType: 'timestamptz';
145 readonly codecId: 'pg/timestamptz@1';
146 readonly nullable: false;
147 readonly default: { readonly kind: 'function'; readonly expression: 'now()' };
148 };
149 };
150 primaryKey: { readonly columns: readonly ['id'] };
151 uniques: readonly [];
152 indexes: readonly [];
153 foreignKeys: readonly [];
154 };
155 };
156 readonly types: Record<string, never>;
157 readonly storageHash: StorageHash;
158 },
159 {
160 readonly Post: {
161 readonly fields: {
162 readonly id: {
163 readonly nullable: false;
164 readonly type: {
165 readonly kind: 'scalar';
166 readonly codecId: 'sql/char@1';
167 readonly typeParams: { readonly length: 36 };
168 };
169 };
170 readonly title: {
171 readonly nullable: false;
172 readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
173 };
174 readonly excerpt: {
175 readonly nullable: false;
176 readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
177 };
178 readonly userId: {
179 readonly nullable: false;
180 readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
181 };
182 readonly createdAt: {
183 readonly nullable: false;
184 readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/timestamptz@1' };
185 };
186 };
187 readonly relations: {
188 readonly user: {
189 readonly to: 'User';
190 readonly cardinality: 'N:1';
191 readonly on: {
192 readonly localFields: readonly ['userId'];
193 readonly targetFields: readonly ['id'];
194 };
195 };
196 };
197 readonly storage: {
198 readonly table: 'post';
199 readonly fields: {
200 readonly id: { readonly column: 'id' };
201 readonly title: { readonly column: 'title' };
202 readonly excerpt: { readonly column: 'excerpt' };
203 readonly userId: { readonly column: 'userId' };
204 readonly createdAt: { readonly column: 'createdAt' };
205 };
206 };
207 };
208 readonly User: {
209 readonly fields: {
210 readonly id: {
211 readonly nullable: false;
212 readonly type: {
213 readonly kind: 'scalar';
214 readonly codecId: 'sql/char@1';
215 readonly typeParams: { readonly length: 36 };
216 };
217 };
218 readonly email: {
219 readonly nullable: false;
220 readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
221 };
222 readonly name: {
223 readonly nullable: false;
224 readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
225 };
226 readonly createdAt: {
227 readonly nullable: false;
228 readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/timestamptz@1' };
229 };
230 };
231 readonly relations: {
232 readonly posts: {
233 readonly to: 'Post';
234 readonly cardinality: '1:N';
235 readonly on: {
236 readonly localFields: readonly ['id'];
237 readonly targetFields: readonly ['userId'];
238 };
239 };
240 };
241 readonly storage: {
242 readonly table: 'user';
243 readonly fields: {
244 readonly id: { readonly column: 'id' };
245 readonly email: { readonly column: 'email' };
246 readonly name: { readonly column: 'name' };
247 readonly createdAt: { readonly column: 'createdAt' };
248 };
249 };
250 };
251 }
252> & {
253 readonly target: 'postgres';
254 readonly targetFamily: 'sql';
255 readonly roots: { readonly user: 'User'; readonly post: 'Post' };
256 readonly capabilities: {
257 readonly postgres: {
258 readonly jsonAgg: true;
259 readonly lateral: true;
260 readonly limit: true;
261 readonly orderBy: true;
262 readonly returning: true;
263 };
264 readonly sql: {
265 readonly defaultInInsert: true;
266 readonly enums: true;
267 readonly returning: true;
268 };
269 };
270 readonly extensionPacks: {};
271 readonly execution: {
272 readonly executionHash: ExecutionHash;
273 readonly mutations: {
274 readonly defaults: readonly [
275 {
276 readonly ref: { readonly table: 'post'; readonly column: 'id' };
277 readonly onCreate: { readonly kind: 'generator'; readonly id: 'uuidv4' };
278 },
279 {
280 readonly ref: { readonly table: 'user'; readonly column: 'id' };
281 readonly onCreate: { readonly kind: 'generator'; readonly id: 'uuidv4' };
282 },
283 ];
284 };
285 };
286 readonly meta: {};
287
288 readonly profileHash: ProfileHash;
289};
290
291export type Contract = ContractWithTypeMaps<ContractBase, TypeMaps>;
292
293export type Tables = Contract['storage']['tables'];
294export type Models = Contract['models'];