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