orez 0.0.53 → 0.0.54
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "orez",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.54",
|
|
4
4
|
"description": "PGlite-powered zero-sync development backend. No Docker required.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@electric-sql/pglite": "^0.2.17",
|
|
50
50
|
"@electric-sql/pglite-tools": "0.2.4",
|
|
51
51
|
"@rocicorp/zero": ">=0.1.0",
|
|
52
|
-
"bedrock-sqlite": "0.0.
|
|
52
|
+
"bedrock-sqlite": "0.0.47",
|
|
53
53
|
"citty": "^0.2.0",
|
|
54
54
|
"pg-gateway": "0.3.0-beta.4",
|
|
55
55
|
"pgsql-parser": "^17.9.11",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { join } from 'node:path'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { beforeAll, describe, expect, it } from 'vitest'
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
encodeBegin,
|
|
@@ -370,16 +370,20 @@ describe('pgoutput-encoder', () => {
|
|
|
370
370
|
// this validates the fundamental contract between orez and zero-cache
|
|
371
371
|
describe('roundtrip: orez encoder → zero-cache parser', () => {
|
|
372
372
|
// relative path bypasses package.json exports restriction
|
|
373
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
374
373
|
const parserPath = join(
|
|
375
374
|
import.meta.dirname,
|
|
376
375
|
'../../node_modules/@rocicorp/zero/out/zero-cache/src/services/change-source/pg/logical-replication/pgoutput-parser.js'
|
|
377
376
|
)
|
|
378
|
-
const { PgoutputParser } = require(parserPath)
|
|
379
377
|
|
|
380
378
|
// mock type parsers: unknown OIDs default to String (identity for text)
|
|
381
379
|
const typeParsers = { getTypeParser: () => String }
|
|
382
380
|
|
|
381
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
382
|
+
let PgoutputParser: any
|
|
383
|
+
beforeAll(async () => {
|
|
384
|
+
PgoutputParser = (await import(parserPath)).PgoutputParser
|
|
385
|
+
})
|
|
386
|
+
|
|
383
387
|
function makeParser() {
|
|
384
388
|
return new PgoutputParser(typeParsers)
|
|
385
389
|
}
|
|
@@ -558,7 +562,7 @@ describe('pgoutput-encoder', () => {
|
|
|
558
562
|
expect(rel.name).toBe('clients')
|
|
559
563
|
})
|
|
560
564
|
|
|
561
|
-
it('LSN ordering: slot < streaming changes', () => {
|
|
565
|
+
it('LSN ordering: slot < streaming changes', async () => {
|
|
562
566
|
// validates that streaming changes will be seen as "new" by zero-cache
|
|
563
567
|
let testLsn = 0x1000000n
|
|
564
568
|
const next = () => {
|
|
@@ -574,18 +578,16 @@ describe('pgoutput-encoder', () => {
|
|
|
574
578
|
expect(commitLsn).toBeGreaterThan(beginLsn)
|
|
575
579
|
|
|
576
580
|
// verify lexi version ordering is preserved
|
|
577
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
578
581
|
const lexiPath = join(
|
|
579
582
|
import.meta.dirname,
|
|
580
583
|
'../../node_modules/@rocicorp/zero/out/zero-cache/src/types/lexi-version.js'
|
|
581
584
|
)
|
|
582
|
-
const { versionToLexi } =
|
|
583
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
585
|
+
const { versionToLexi } = await import(lexiPath)
|
|
584
586
|
const lsnPath = join(
|
|
585
587
|
import.meta.dirname,
|
|
586
588
|
'../../node_modules/@rocicorp/zero/out/zero-cache/src/services/change-source/pg/lsn.js'
|
|
587
589
|
)
|
|
588
|
-
const { toBigInt: lsnToBigInt } =
|
|
590
|
+
const { toBigInt: lsnToBigInt } = await import(lsnPath)
|
|
589
591
|
|
|
590
592
|
const slotHex = `00000000/${slotLsn.toString(16).padStart(8, '0')}`.toUpperCase()
|
|
591
593
|
const beginHex = `00000000/${beginLsn.toString(16).padStart(8, '0')}`.toUpperCase()
|