Skip to content

Commit 6690e02

Browse files
committed
test(sqlite): build the symbol-codec stub on a SQLite codec registry
SqliteControlAdapter takes a SqliteCodecRegistry, so the structured-error DDL test composes its stub over createSqliteBuiltinCodecLookup() and overrides only get(). The DDL default-rendering path reads codecs through get() alone, so the exercised behavior is unchanged. Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
1 parent 80eb633 commit 6690e02

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

packages/3-targets/6-adapters/sqlite/test/structured-errors.test.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import type { Codec, CodecRegistry } from '@prisma-next/framework-components/codec';
2-
import { emptyCodecLookup } from '@prisma-next/framework-components/codec';
1+
import type { Codec } from '@prisma-next/framework-components/codec';
32
import type { SqlControlDriverInstance } from '@prisma-next/sql-contract/types';
43
import {
54
CheckExpressionConstraint,
@@ -20,7 +19,7 @@ import { createSqliteAdapter, sqliteRawCodecInferer } from '../src/core/adapter'
2019
import { createSqliteBuiltinCodecLookup } from '../src/core/codec-lookup';
2120
import { SqliteControlAdapter } from '../src/core/control-adapter';
2221
import { decodeSqliteMarkerRow } from '../src/core/marker-ledger';
23-
import type { SqliteContract } from '../src/core/types';
22+
import type { SqliteCodecRegistry, SqliteContract } from '../src/core/types';
2423

2524
const contract = {} as SqliteContract;
2625
const runtimeAdapter = createSqliteAdapter();
@@ -131,8 +130,8 @@ describe('structured error codes', () => {
131130
encode: async () => Symbol('wire'),
132131
decode: async (wire: unknown) => wire,
133132
} as unknown as Codec;
134-
const lookup: CodecRegistry = {
135-
...emptyCodecLookup,
133+
const lookup: SqliteCodecRegistry = {
134+
...createSqliteBuiltinCodecLookup(),
136135
get: (id) => (id === 'test/symbol@1' ? symbolCodec : undefined),
137136
forCodecRef: () => {
138137
throw new Error('not used in DDL tests');

0 commit comments

Comments
 (0)