@prisma-next/sql-runtime 0.3.0-dev.9 → 0.3.0-pr.49.6
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.
- package/dist/test/utils.d.ts +3 -2
- package/dist/test/utils.d.ts.map +1 -1
- package/dist/test/utils.js +8 -7
- package/dist/test/utils.js.map +1 -1
- package/package.json +14 -14
- package/test/utils.ts +14 -10
package/package.json
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma-next/sql-runtime",
|
|
3
|
-
"version": "0.3.0-
|
|
3
|
+
"version": "0.3.0-pr.49.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"description": "SQL runtime implementation for Prisma Next",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@prisma-next/core-execution-plane": "0.3.0-
|
|
9
|
-
"@prisma-next/
|
|
10
|
-
"@prisma-next/
|
|
11
|
-
"@prisma-next/runtime-executor": "0.3.0-
|
|
12
|
-
"@prisma-next/sql-contract": "0.3.0-
|
|
13
|
-
"@prisma-next/sql-operations": "0.3.0-
|
|
14
|
-
"@prisma-next/sql-relational-core": "0.3.0-
|
|
8
|
+
"@prisma-next/core-execution-plane": "0.3.0-pr.49.6",
|
|
9
|
+
"@prisma-next/operations": "0.3.0-pr.49.6",
|
|
10
|
+
"@prisma-next/contract": "0.3.0-pr.49.6",
|
|
11
|
+
"@prisma-next/runtime-executor": "0.3.0-pr.49.6",
|
|
12
|
+
"@prisma-next/sql-contract": "0.3.0-pr.49.6",
|
|
13
|
+
"@prisma-next/sql-operations": "0.3.0-pr.49.6",
|
|
14
|
+
"@prisma-next/sql-relational-core": "0.3.0-pr.49.6"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@types/pg": "8.16.0",
|
|
18
|
-
"@vitest/coverage-v8": "4.0.16",
|
|
19
18
|
"pg": "8.16.3",
|
|
20
19
|
"tsup": "8.5.1",
|
|
21
20
|
"typescript": "5.9.3",
|
|
22
21
|
"vitest": "4.0.16",
|
|
23
|
-
"@prisma-next/test-utils": "0.0.1"
|
|
22
|
+
"@prisma-next/test-utils": "0.0.1",
|
|
23
|
+
"@prisma-next/tsconfig": "0.0.0"
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
"dist",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"test": "vitest run --passWithNoTests",
|
|
43
43
|
"test:coverage": "vitest run --coverage --passWithNoTests",
|
|
44
44
|
"typecheck": "tsc --project tsconfig.json --noEmit",
|
|
45
|
-
"lint": "biome check . --
|
|
46
|
-
"lint:fix": "biome check --write .
|
|
47
|
-
"lint:fix:unsafe": "biome check --write --unsafe .
|
|
48
|
-
"clean": "
|
|
45
|
+
"lint": "biome check . --error-on-warnings",
|
|
46
|
+
"lint:fix": "biome check --write .",
|
|
47
|
+
"lint:fix:unsafe": "biome check --write --unsafe .",
|
|
48
|
+
"clean": "rm -rf dist coverage .tmp-output"
|
|
49
49
|
}
|
|
50
50
|
}
|
package/test/utils.ts
CHANGED
|
@@ -238,18 +238,22 @@ export function createStubAdapter(): Adapter<SelectAst, SqlContract<SqlStorage>,
|
|
|
238
238
|
|
|
239
239
|
/**
|
|
240
240
|
* Creates a valid test contract without using validateContract.
|
|
241
|
-
* Ensures
|
|
241
|
+
* Ensures all required fields are present (mappings, capabilities, extensionPacks, meta, sources)
|
|
242
|
+
* and returns the contract with proper typing.
|
|
242
243
|
* This helper allows tests to create contracts without depending on sql-query.
|
|
243
244
|
*/
|
|
244
|
-
export function createTestContract<T extends SqlContract<SqlStorage>>(
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
|
|
245
|
+
export function createTestContract<T extends SqlContract<SqlStorage>>(
|
|
246
|
+
contract: Partial<T> &
|
|
247
|
+
Omit<T, 'mappings' | 'capabilities' | 'extensionPacks' | 'meta' | 'sources'>,
|
|
248
|
+
): T {
|
|
249
|
+
return {
|
|
250
|
+
...contract,
|
|
251
|
+
mappings: contract.mappings ?? { codecTypes: {}, operationTypes: {} },
|
|
252
|
+
capabilities: contract.capabilities ?? {},
|
|
253
|
+
extensionPacks: contract.extensionPacks ?? {},
|
|
254
|
+
meta: contract.meta ?? {},
|
|
255
|
+
sources: contract.sources ?? {},
|
|
256
|
+
} as T;
|
|
253
257
|
}
|
|
254
258
|
|
|
255
259
|
// Re-export generic utilities from test-utils
|