@machynx/data-db 1.0.6 → 1.0.7

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.
@@ -1,5 +1,7 @@
1
1
  import { AnyNull } from '@prisma/client-runtime-utils';
2
+ import { AnyNullClass } from '@prisma/client-runtime-utils';
2
3
  import { DbNull } from '@prisma/client-runtime-utils';
4
+ import { DbNullClass } from '@prisma/client-runtime-utils';
3
5
  import { Decimal } from '@prisma/client-runtime-utils';
4
6
  import { empty } from '@prisma/client-runtime-utils';
5
7
  import { isAnyNull } from '@prisma/client-runtime-utils';
@@ -7,6 +9,7 @@ import { isDbNull } from '@prisma/client-runtime-utils';
7
9
  import { isJsonNull } from '@prisma/client-runtime-utils';
8
10
  import { join } from '@prisma/client-runtime-utils';
9
11
  import { JsonNull } from '@prisma/client-runtime-utils';
12
+ import { JsonNullClass } from '@prisma/client-runtime-utils';
10
13
  import { NullTypes } from '@prisma/client-runtime-utils';
11
14
  import { ObjectEnumValue } from '@prisma/client-runtime-utils';
12
15
  import { PrismaClientInitializationError } from '@prisma/client-runtime-utils';
@@ -87,6 +90,8 @@ export declare type AllModelsToStringIndex<TypeMap extends TypeMapDef, Args exte
87
90
 
88
91
  export { AnyNull }
89
92
 
93
+ export { AnyNullClass }
94
+
90
95
  export declare type ApplyOmit<T, OmitConfig> = Compute<{
91
96
  [K in keyof T as OmitValue<OmitConfig, K> extends true ? never : K]: T[K];
92
97
  }>;
@@ -271,6 +276,7 @@ declare type CompilerWasmLoadingConfig = {
271
276
  * @remarks only used by ClientEngine
272
277
  */
273
278
  getQueryCompilerWasmModule: () => Promise<unknown>;
279
+ importName: string;
274
280
  };
275
281
 
276
282
  export declare type Compute<T> = T extends Function ? T : {
@@ -384,13 +390,6 @@ declare type DatamodelEnum = ReadonlyDeep_2<{
384
390
 
385
391
  declare function datamodelEnumToSchemaEnum(datamodelEnum: DatamodelEnum): SchemaEnum;
386
392
 
387
- declare type DatamodelSchemaEnum = ReadonlyDeep_2<{
388
- name: string;
389
- values: string[];
390
- }>;
391
-
392
- declare function datamodelSchemaEnumToSchemaEnum(datamodelSchemaEnum: DatamodelSchemaEnum): SchemaEnum;
393
-
394
393
  declare type DataRule = {
395
394
  type: 'rowCountEq';
396
395
  args: number;
@@ -406,6 +405,8 @@ declare type DataRule = {
406
405
 
407
406
  export { DbNull }
408
407
 
408
+ export { DbNullClass }
409
+
409
410
  export declare const Debug: typeof debugCreate & {
410
411
  enable(namespace: any): void;
411
412
  disable(): any;
@@ -497,12 +498,10 @@ export declare type DevTypeMapFnDef = {
497
498
  export declare namespace DMMF {
498
499
  export {
499
500
  datamodelEnumToSchemaEnum,
500
- datamodelSchemaEnumToSchemaEnum,
501
501
  Document_2 as Document,
502
502
  Mappings,
503
503
  OtherOperationMappings,
504
504
  DatamodelEnum,
505
- DatamodelSchemaEnum,
506
505
  SchemaEnum,
507
506
  EnumValue,
508
507
  Datamodel,
@@ -541,12 +540,10 @@ export declare namespace DMMF {
541
540
  declare namespace DMMF_2 {
542
541
  export {
543
542
  datamodelEnumToSchemaEnum,
544
- datamodelSchemaEnumToSchemaEnum,
545
543
  Document_2 as Document,
546
544
  Mappings,
547
545
  OtherOperationMappings,
548
546
  DatamodelEnum,
549
- DatamodelSchemaEnum,
550
547
  SchemaEnum,
551
548
  EnumValue,
552
549
  Datamodel,
@@ -795,6 +792,20 @@ declare interface EngineConfig {
795
792
  * Web Assembly module loading configuration
796
793
  */
797
794
  compilerWasm?: CompilerWasmLoadingConfig;
795
+ /**
796
+ * SQL commenter plugins that add metadata to SQL queries as comments.
797
+ * Each plugin receives query context and returns key-value pairs.
798
+ */
799
+ sqlCommenters?: SqlCommenterPlugin[];
800
+ /**
801
+ * Parameterization schema (ParamGraph) for schema-aware query parameterization.
802
+ * Enables precise parameterization based on DMMF metadata.
803
+ */
804
+ parameterizationSchema: SerializedParamGraph;
805
+ /**
806
+ * Runtime data model for enum lookups during parameterization.
807
+ */
808
+ runtimeDataModel: RuntimeDataModel;
798
809
  }
799
810
 
800
811
  declare type EngineEvent<E extends EngineEventType> = E extends QueryEventType ? QueryEvent : LogEvent;
@@ -861,7 +872,7 @@ declare interface ExceptionWithName {
861
872
 
862
873
  declare type ExtendedEventType = LogLevel | 'beforeExit';
863
874
 
864
- declare type ExtendedSpanOptions = SpanOptions & {
875
+ declare interface ExtendedSpanOptions extends SpanOptions {
865
876
  /** The name of the span */
866
877
  name: string;
867
878
  internal?: boolean;
@@ -869,7 +880,7 @@ declare type ExtendedSpanOptions = SpanOptions & {
869
880
  active?: boolean;
870
881
  /** The context to append the span to */
871
882
  context?: Context;
872
- };
883
+ }
873
884
 
874
885
  /** $extends, defineExtension */
875
886
  export declare interface ExtendsHook<Variant extends 'extends' | 'define', TypeMapCb extends TypeMapCbDef, ExtArgs extends Record<string, any>, TypeMap extends TypeMapDef = Call<TypeMapCb, {
@@ -1294,6 +1305,11 @@ export declare type GetPrismaClientConfig = {
1294
1305
  * Optional wasm loading configuration
1295
1306
  */
1296
1307
  compilerWasm?: CompilerWasmLoadingConfig;
1308
+ /**
1309
+ * Parameterization schema for schema-aware query parameterization.
1310
+ * Enables precise parameterization based on DMMF metadata.
1311
+ */
1312
+ parameterizationSchema: SerializedParamGraph;
1297
1313
  };
1298
1314
 
1299
1315
  export declare type GetResult<Payload extends OperationPayload, Args, OperationName extends Operation = 'findUniqueOrThrow', GlobalOmitOptions = {}> = {
@@ -1591,6 +1607,8 @@ declare type JsonFieldSelection = {
1591
1607
 
1592
1608
  export { JsonNull }
1593
1609
 
1610
+ export { JsonNullClass }
1611
+
1594
1612
  /**
1595
1613
  * From https://github.com/sindresorhus/type-fest/
1596
1614
  * Matches a JSON object.
@@ -1602,12 +1620,14 @@ export declare type JsonObject = {
1602
1620
 
1603
1621
  export declare type JsonQuery = {
1604
1622
  modelName?: string;
1605
- action: JsonQueryAction;
1623
+ action: JsonQueryAction_2;
1606
1624
  query: JsonFieldSelection;
1607
1625
  };
1608
1626
 
1609
1627
  declare type JsonQueryAction = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFirstOrThrow' | 'findMany' | 'createOne' | 'createMany' | 'createManyAndReturn' | 'updateOne' | 'updateMany' | 'updateManyAndReturn' | 'deleteOne' | 'deleteMany' | 'upsertOne' | 'aggregate' | 'groupBy' | 'executeRaw' | 'queryRaw' | 'runCommandRaw' | 'findRaw' | 'aggregateRaw';
1610
1628
 
1629
+ declare type JsonQueryAction_2 = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFirstOrThrow' | 'findMany' | 'createOne' | 'createMany' | 'createManyAndReturn' | 'updateOne' | 'updateMany' | 'updateManyAndReturn' | 'deleteOne' | 'deleteMany' | 'upsertOne' | 'aggregate' | 'groupBy' | 'executeRaw' | 'queryRaw' | 'runCommandRaw' | 'findRaw' | 'aggregateRaw';
1630
+
1611
1631
  declare type JsonSelectionSet = {
1612
1632
  $scalars?: boolean;
1613
1633
  $composites?: boolean;
@@ -2004,10 +2024,26 @@ export declare type PrismaClientOptions = PrismaClientMutuallyExclusiveOptions &
2004
2024
  * { emit: 'stdout', level: 'warn' }
2005
2025
  * ]
2006
2026
  * \`\`\`
2007
- * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#the-log-option).
2027
+ * Read more in our [docs](https://pris.ly/d/logging).
2008
2028
  */
2009
2029
  log?: Array<LogLevel | LogDefinition>;
2010
2030
  omit?: GlobalOmitOptions;
2031
+ /**
2032
+ * SQL commenter plugins that add metadata to SQL queries as comments.
2033
+ * Comments follow the sqlcommenter format: https://google.github.io/sqlcommenter/
2034
+ *
2035
+ * @example
2036
+ * ```ts
2037
+ * new PrismaClient({
2038
+ * adapter: new PrismaPg({ connectionString }),
2039
+ * comments: [
2040
+ * traceContext(),
2041
+ * queryInsights(),
2042
+ * ],
2043
+ * })
2044
+ * ```
2045
+ */
2046
+ comments?: SqlCommenterPlugin[];
2011
2047
  /**
2012
2048
  * @internal
2013
2049
  * You probably don't want to use this. \`__internal\` is used by internal tooling.
@@ -2540,8 +2576,8 @@ declare type Schema = ReadonlyDeep_2<{
2540
2576
  prisma: OutputType[];
2541
2577
  };
2542
2578
  enumTypes: {
2543
- model?: DatamodelSchemaEnum[];
2544
- prisma: DatamodelSchemaEnum[];
2579
+ model?: SchemaEnum[];
2580
+ prisma: SchemaEnum[];
2545
2581
  };
2546
2582
  fieldRefTypes: {
2547
2583
  prisma?: FieldRefType[];
@@ -2554,16 +2590,14 @@ declare type SchemaArg = ReadonlyDeep_2<{
2554
2590
  isNullable: boolean;
2555
2591
  isRequired: boolean;
2556
2592
  inputTypes: InputTypeRef[];
2593
+ isParameterizable: boolean;
2557
2594
  requiresOtherFields?: string[];
2558
2595
  deprecation?: Deprecation;
2559
2596
  }>;
2560
2597
 
2561
2598
  declare type SchemaEnum = ReadonlyDeep_2<{
2562
2599
  name: string;
2563
- data: {
2564
- key: string;
2565
- value: string;
2566
- }[];
2600
+ values: string[];
2567
2601
  }>;
2568
2602
 
2569
2603
  declare type SchemaField = ReadonlyDeep_2<{
@@ -2596,7 +2630,17 @@ export declare type SelectField<P extends SelectablePayloadFields<any, any>, K e
2596
2630
  declare type Selection_2 = Record<string, boolean | Skip | JsArgs>;
2597
2631
  export { Selection_2 as Selection }
2598
2632
 
2599
- export declare function serializeJsonQuery({ modelName, action, args, runtimeDataModel, extensions, callsite, clientMethod, errorFormat, clientVersion, previewFeatures, globalOmit, }: SerializeParams): JsonQuery;
2633
+ /**
2634
+ * Serialized format stored in the generated client.
2635
+ */
2636
+ declare interface SerializedParamGraph {
2637
+ /** String table (field names, enum names, root keys) */
2638
+ strings: string[];
2639
+ /** Base64url-encoded binary blob for structural data */
2640
+ graph: string;
2641
+ }
2642
+
2643
+ export declare function serializeJsonQuery({ modelName, action, args, runtimeDataModel, extensions, callsite, clientMethod, errorFormat, clientVersion, previewFeatures, globalOmit, wrapRawValues, }: SerializeParams): JsonQuery;
2600
2644
 
2601
2645
  declare type SerializeParams = {
2602
2646
  runtimeDataModel: RuntimeDataModel;
@@ -2610,6 +2654,7 @@ declare type SerializeParams = {
2610
2654
  errorFormat: ErrorFormat;
2611
2655
  previewFeatures: string[];
2612
2656
  globalOmit?: GlobalOmitOptions;
2657
+ wrapRawValues?: boolean;
2613
2658
  };
2614
2659
 
2615
2660
  declare class Skip {
@@ -2873,6 +2918,111 @@ declare enum SpanStatusCode {
2873
2918
 
2874
2919
  export { Sql }
2875
2920
 
2921
+ /**
2922
+ * Information about a compacted batch query (e.g. multiple independent
2923
+ * `findUnique` queries automatically merged into a single `SELECT` SQL
2924
+ * statement).
2925
+ */
2926
+ declare interface SqlCommenterCompactedQueryInfo {
2927
+ /**
2928
+ * The model name (e.g., "User", "Post").
2929
+ */
2930
+ readonly modelName: string;
2931
+ /**
2932
+ * The Prisma operation (e.g., "findUnique").
2933
+ */
2934
+ readonly action: SqlCommenterQueryAction;
2935
+ /**
2936
+ * The full query objects (selections, arguments, etc.).
2937
+ * Specifics of the query representation are not part of the public API yet.
2938
+ */
2939
+ readonly queries: ReadonlyArray<unknown>;
2940
+ }
2941
+
2942
+ /**
2943
+ * Context provided to SQL commenter plugins.
2944
+ */
2945
+ export declare interface SqlCommenterContext {
2946
+ /**
2947
+ * Information about the Prisma query being executed.
2948
+ */
2949
+ readonly query: SqlCommenterQueryInfo;
2950
+ /**
2951
+ * Raw SQL query generated from this Prisma query.
2952
+ *
2953
+ * It is always available when `PrismaClient` connects to the database and
2954
+ * renders SQL queries directly.
2955
+ *
2956
+ * When using Prisma Accelerate, SQL rendering happens on Accelerate side and the raw
2957
+ * SQL strings are not yet available when SQL commenter plugins are executed.
2958
+ */
2959
+ readonly sql?: string;
2960
+ }
2961
+
2962
+ /**
2963
+ * A SQL commenter plugin that returns key-value pairs to be added as comments.
2964
+ * Return an empty object to add no comments. Keys with undefined values will be omitted.
2965
+ *
2966
+ * @example
2967
+ * ```ts
2968
+ * const myPlugin: SqlCommenterPlugin = (context) => {
2969
+ * return {
2970
+ * application: 'my-app',
2971
+ * model: context.query.modelName ?? 'raw',
2972
+ * // Conditional key - will be omitted if ctx.sql is undefined
2973
+ * sqlLength: context.sql ? String(context.sql.length) : undefined,
2974
+ * }
2975
+ * }
2976
+ * ```
2977
+ */
2978
+ export declare interface SqlCommenterPlugin {
2979
+ (context: SqlCommenterContext): SqlCommenterTags;
2980
+ }
2981
+
2982
+ /**
2983
+ * Prisma query type corresponding to this SQL query.
2984
+ */
2985
+ declare type SqlCommenterQueryAction = JsonQueryAction;
2986
+
2987
+ /**
2988
+ * Information about the query or queries being executed.
2989
+ *
2990
+ * - `single`: A single query is being executed
2991
+ * - `compacted`: Multiple queries have been compacted into a single SQL statement
2992
+ */
2993
+ export declare type SqlCommenterQueryInfo = ({
2994
+ readonly type: 'single';
2995
+ } & SqlCommenterSingleQueryInfo) | ({
2996
+ readonly type: 'compacted';
2997
+ } & SqlCommenterCompactedQueryInfo);
2998
+
2999
+ /**
3000
+ * Information about a single Prisma query.
3001
+ */
3002
+ export declare interface SqlCommenterSingleQueryInfo {
3003
+ /**
3004
+ * The model name (e.g., "User", "Post"). Undefined for raw queries.
3005
+ */
3006
+ readonly modelName?: string;
3007
+ /**
3008
+ * The Prisma operation (e.g., "findMany", "createOne", "queryRaw").
3009
+ */
3010
+ readonly action: SqlCommenterQueryAction;
3011
+ /**
3012
+ * The full query object (selection, arguments, etc.).
3013
+ * Specifics of the query representation are not part of the public API yet.
3014
+ */
3015
+ readonly query: unknown;
3016
+ }
3017
+
3018
+ /**
3019
+ * Key-value pairs to add as SQL comments.
3020
+ * Keys with undefined values will be omitted from the final comment.
3021
+ */
3022
+ export declare type SqlCommenterTags = {
3023
+ readonly [key: string]: string | undefined;
3024
+ };
3025
+
2876
3026
  declare interface SqlDriverAdapter extends SqlQueryable {
2877
3027
  /**
2878
3028
  * Execute multiple SQL statements separated by semicolon.
@@ -3001,8 +3151,8 @@ declare interface Transaction extends AdapterInfo, SqlQueryable {
3001
3151
 
3002
3152
  declare namespace Transaction_2 {
3003
3153
  export {
3004
- Options,
3005
3154
  IsolationLevel_2 as IsolationLevel,
3155
+ Options,
3006
3156
  InteractiveTransactionInfo,
3007
3157
  TransactionHeaders
3008
3158
  }