mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-20 19:16:08 +00:00
fix(db): store no NUL character on either engine
Postgres text cannot hold U+0000, so any write or filter carrying one (a request body, a query string, an import, a feed, a forwarded mail, a plugin's own SQL) answered a 500 on Postgres while SQLite stored it. Both engines now drop the character where every value leaves for the database (src/db/nul-free.ts): the MikroORM platforms when they inline a string or serialize a JSON value, the Kysely dialects for every parameter, a plugin's own SQLite file for its arguments, and the move from SQLite, which used to refuse such text. The same request now answers the same status and leaves the same row on both engines, so the places NUL suite runs on Postgres as well and leaves SQLITE_ONLY.
This commit is contained in:
@@ -73,10 +73,6 @@ export const SQLITE_ONLY: Readonly<Record<string, string>> = {
|
||||
'tests/integration/legacy-upgrade-v205.test.ts': LEGACY_UPGRADE,
|
||||
'tests/integration/legacy-upgrade-v242.test.ts': LEGACY_UPGRADE,
|
||||
'tests/integration/legacy-upgrade-v244.test.ts': LEGACY_UPGRADE,
|
||||
'tests/integration/places-nul-sqlite.test.ts':
|
||||
'About SQLite value quoting of a NUL byte (U+0000) in a user string; Postgres text cannot hold that ' +
|
||||
'character, so the round-trip it asserts does not exist there. The other control characters run on ' +
|
||||
'both engines in places.test.ts.',
|
||||
};
|
||||
|
||||
const SNAPSHOT_BASELINE_FILE = path.join(__dirname, 'snapshot-suites-baseline.json');
|
||||
|
||||
Reference in New Issue
Block a user