prisma 5.19.0-dev.14 → 5.19.0-dev.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -147,6 +147,15 @@ export declare type ClientOptionDef = undefined | {
147
147
  [K in string]: any;
148
148
  };
149
149
 
150
+ export declare type ClientOtherOps = {
151
+ $queryRaw<T = unknown>(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise<T>;
152
+ $queryRawTyped<T>(query: TypedSql<unknown[], T>): PrismaPromise<T[]>;
153
+ $queryRawUnsafe<T = unknown>(query: string, ...values: any[]): PrismaPromise<T>;
154
+ $executeRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise<number>;
155
+ $executeRawUnsafe(query: string, ...values: any[]): PrismaPromise<number>;
156
+ $runCommandRaw(command: InputJsonObject): PrismaPromise<JsonObject>;
157
+ };
158
+
150
159
  declare type ColumnType = (typeof ColumnTypeEnum)[keyof typeof ColumnTypeEnum];
151
160
 
152
161
  declare const ColumnTypeEnum: {
@@ -886,7 +895,7 @@ export declare type DynamicClientExtensionThis<TypeMap extends TypeMapDef, TypeM
886
895
  } & {
887
896
  [P in Exclude<TypeMap['meta']['modelProps'], keyof ExtArgs['client']>]: DynamicModelExtensionThis<TypeMap, ModelKey<TypeMap, P>, ExtArgs, ClientOptions>;
888
897
  } & {
889
- [P in Exclude<keyof TypeMap['other']['operations'], keyof ExtArgs['client']>]: <R = GetResult<TypeMap['other']['payload'], any, P & Operation, ClientOptions>>(...args: ToTuple<TypeMap['other']['operations'][P]['args']>) => PrismaPromise<R>;
898
+ [P in Exclude<keyof TypeMap['other']['operations'], keyof ExtArgs['client']>]: P extends keyof ClientOtherOps ? ClientOtherOps[P] : never;
890
899
  } & {
891
900
  [P in Exclude<ClientBuiltInProp, keyof ExtArgs['client']>]: DynamicClientExtensionThisBuiltin<TypeMap, TypeMapCb, ExtArgs, ClientOptions>[P];
892
901
  } & {
@@ -1317,6 +1326,7 @@ declare namespace Extensions_2 {
1317
1326
  DevTypeMapDef,
1318
1327
  DevTypeMapFnDef,
1319
1328
  ClientOptionDef,
1329
+ ClientOtherOps,
1320
1330
  TypeMapCbDef,
1321
1331
  ModelKey,
1322
1332
  RequiredExtensionArgs as UserArgs
@@ -1501,6 +1511,11 @@ export declare function getPrismaClient(config: GetPrismaClientConfig): {
1501
1511
  * @returns
1502
1512
  */
1503
1513
  $queryRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2<unknown>;
1514
+ /**
1515
+ * Counterpart to $queryRaw, that returns strongly typed results
1516
+ * @param typedSql
1517
+ */
1518
+ $queryRawTyped(typedSql: UnknownTypedSql): PrismaPromise_2<unknown>;
1504
1519
  /**
1505
1520
  * Unsafe counterpart of `$queryRaw` that is susceptible to SQL injections
1506
1521
  * @see https://github.com/prisma/prisma/issues/7142
@@ -1653,6 +1668,7 @@ export declare type GetResult<Payload extends OperationPayload, Args, OperationN
1653
1668
  count: GetCountResult<Args>;
1654
1669
  groupBy: GetGroupByResult<Payload, Args>;
1655
1670
  $queryRaw: unknown;
1671
+ $queryRawTyped: unknown;
1656
1672
  $executeRaw: number;
1657
1673
  $queryRawUnsafe: unknown;
1658
1674
  $executeRawUnsafe: number;
@@ -1703,6 +1719,38 @@ declare type HandleErrorParams = {
1703
1719
  */
1704
1720
  declare type HrTime = [number, number];
1705
1721
 
1722
+ /**
1723
+ * Matches a JSON array.
1724
+ * Unlike \`JsonArray\`, readonly arrays are assignable to this type.
1725
+ */
1726
+ export declare interface InputJsonArray extends ReadonlyArray<InputJsonValue | null> {
1727
+ }
1728
+
1729
+ /**
1730
+ * Matches a JSON object.
1731
+ * Unlike \`JsonObject\`, this type allows undefined and read-only properties.
1732
+ */
1733
+ export declare type InputJsonObject = {
1734
+ readonly [Key in string]?: InputJsonValue | null;
1735
+ };
1736
+
1737
+ /**
1738
+ * Matches any valid value that can be used as an input for operations like
1739
+ * create and update as the value of a JSON field. Unlike \`JsonValue\`, this
1740
+ * type allows read-only arrays and read-only object properties and disallows
1741
+ * \`null\` at the top level.
1742
+ *
1743
+ * \`null\` cannot be used as the value of a JSON field because its meaning
1744
+ * would be ambiguous. Use \`Prisma.JsonNull\` to store the JSON null value or
1745
+ * \`Prisma.DbNull\` to clear the JSON value and set the field to the database
1746
+ * NULL value instead.
1747
+ *
1748
+ * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-by-null-values
1749
+ */
1750
+ export declare type InputJsonValue = string | number | boolean | InputJsonObject | InputJsonArray | {
1751
+ toJSON(): unknown;
1752
+ };
1753
+
1706
1754
  declare type InteractiveTransactionInfo<Payload = unknown> = {
1707
1755
  /**
1708
1756
  * Transaction ID returned by the query engine.
@@ -1816,6 +1864,10 @@ declare type JsonArgumentValue = number | string | boolean | null | RawTaggedVal
1816
1864
  [key: string]: JsonArgumentValue;
1817
1865
  };
1818
1866
 
1867
+ /**
1868
+ * From https://github.com/sindresorhus/type-fest/
1869
+ * Matches a JSON array.
1870
+ */
1819
1871
  export declare interface JsonArray extends Array<JsonValue> {
1820
1872
  }
1821
1873
 
@@ -1838,6 +1890,11 @@ declare type JsonFieldSelection = {
1838
1890
  declare class JsonNull extends NullTypesEnumValue {
1839
1891
  }
1840
1892
 
1893
+ /**
1894
+ * From https://github.com/sindresorhus/type-fest/
1895
+ * Matches a JSON object.
1896
+ * This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from.
1897
+ */
1841
1898
  export declare type JsonObject = {
1842
1899
  [Key in string]?: JsonValue;
1843
1900
  };
@@ -1857,6 +1914,10 @@ declare type JsonSelectionSet = {
1857
1914
  [fieldName: string]: boolean | JsonFieldSelection;
1858
1915
  };
1859
1916
 
1917
+ /**
1918
+ * From https://github.com/sindresorhus/type-fest/
1919
+ * Matches any valid JSON value.
1920
+ */
1860
1921
  export declare type JsonValue = string | number | boolean | JsonObject | JsonArray | null;
1861
1922
 
1862
1923
  export declare type JsOutputValue = null | string | number | boolean | bigint | Uint8Array | Date | Decimal | JsOutputValue[] | {
@@ -1954,6 +2015,8 @@ declare type LogLevel = 'info' | 'query' | 'warn' | 'error';
1954
2015
  */
1955
2016
  export declare function makeStrictEnum<T extends Record<PropertyKey, string | number>>(definition: T): T;
1956
2017
 
2018
+ export declare function makeTypedQueryFactory(sql: string): (...values: any[]) => TypedSql<any[], unknown>;
2019
+
1957
2020
  /**
1958
2021
  * Class that holds the list of all extensions, applied to particular instance,
1959
2022
  * as well as resolved versions of the components that need to apply on
@@ -2392,6 +2455,8 @@ declare type PrismaPromiseInteractiveTransaction<PayloadType = unknown> = {
2392
2455
 
2393
2456
  declare type PrismaPromiseTransaction<PayloadType = unknown> = PrismaPromiseBatchTransaction | PrismaPromiseInteractiveTransaction<PayloadType>;
2394
2457
 
2458
+ export declare const PrivateResultType: unique symbol;
2459
+
2395
2460
  declare namespace Public {
2396
2461
  export {
2397
2462
  validator
@@ -2545,7 +2610,7 @@ export declare type RawParameters = {
2545
2610
  values: string;
2546
2611
  };
2547
2612
 
2548
- export declare type RawQueryArgs = Sql | [query: string, ...values: RawValue[]];
2613
+ export declare type RawQueryArgs = Sql | UnknownTypedSql | [query: string, ...values: RawValue[]];
2549
2614
 
2550
2615
  declare type RawTaggedValue = {
2551
2616
  $type: 'Raw';
@@ -3160,6 +3225,13 @@ declare type TransactionOptions_2<InteractiveTransactionPayload> = {
3160
3225
  options: BatchTransactionOptions;
3161
3226
  };
3162
3227
 
3228
+ export declare class TypedSql<Values extends readonly unknown[], Result> {
3229
+ [PrivateResultType]: Result;
3230
+ constructor(sql: string, values: Values);
3231
+ get sql(): string;
3232
+ get values(): Values;
3233
+ }
3234
+
3163
3235
  export declare type TypeMapCbDef = Fn<{
3164
3236
  extArgs: InternalArgs;
3165
3237
  clientOptions: ClientOptionDef;
@@ -3174,6 +3246,7 @@ declare namespace Types {
3174
3246
  Extensions_2 as Extensions,
3175
3247
  Utils,
3176
3248
  Public_2 as Public,
3249
+ UnknownTypedSql,
3177
3250
  OperationPayload as Payload
3178
3251
  }
3179
3252
  }
@@ -3184,6 +3257,8 @@ declare type UnknownErrorParams = {
3184
3257
  batchRequestIdx?: number;
3185
3258
  };
3186
3259
 
3260
+ export declare type UnknownTypedSql = TypedSql<unknown[], unknown>;
3261
+
3187
3262
  declare type Unpacker = (data: any) => any;
3188
3263
 
3189
3264
  export declare type UnwrapPayload<P> = {} extends P ? unknown : {
@@ -3222,9 +3297,6 @@ declare namespace Utils {
3222
3297
  Narrow,
3223
3298
  Exact,
3224
3299
  Cast,
3225
- JsonObject,
3226
- JsonArray,
3227
- JsonValue,
3228
3300
  Record_2 as Record,
3229
3301
  UnwrapPromise,
3230
3302
  UnwrapTuple,