Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/modern-cycles-work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@electric-sql/pglite': minor
---

Upgraded to PostgreSQL 18.3
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
"wasm:copy-initdb": "mkdir -p ./packages/pglite/release && cp ./postgres-pglite/dist/bin/initdb.* ./packages/pglite/release",
"wasm:copy-pgdump": "mkdir -p ./packages/pglite-tools/release && cp ./postgres-pglite/dist/bin/pg_dump.* ./packages/pglite-tools/release",
"wasm:copy-pglite": "mkdir -p ./packages/pglite/release/ && cp ./postgres-pglite/dist/bin/pglite.* ./packages/pglite/release/ && cp ./postgres-pglite/dist/extensions/*.tar.gz ./packages/pglite/release/",
"wasm:build": "cd postgres-pglite && ./build-with-docker.sh && cd .. && pnpm wasm:copy-pglite && pnpm wasm:copy-pgdump && pnpm wasm:copy-initdb && pnpm wasm:copy-postgis",
"wasm:build": "cd postgres-pglite && PGLITE_VERSION=$(pnpm -s pglite:version) ./build-with-docker.sh && cd .. && pnpm wasm:copy-pglite && pnpm wasm:copy-pgdump && pnpm wasm:copy-initdb && pnpm wasm:copy-postgis",
"wasm:build:debug": "DEBUG=true pnpm wasm:build",
"build:all": "pnpm wasm:build && pnpm ts:build",
"build:all:debug": "DEBUG=true pnpm build:all",
"prepare": "husky"
"prepare": "husky",
"pglite:version": "pnpm -s -C packages/pglite version"
},
"devDependencies": {
"@changesets/cli": "^2.27.9",
Expand Down
8 changes: 7 additions & 1 deletion packages/pglite-tools/src/pg_dump.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,13 @@ export async function pgDump({
)
}

const file = new File([execResult.fileContents], fileName, {
// remove \\restrict and \\unrestrict commands https://www.postgresql.org/docs/17/app-psql.html#APP-PSQL-META-COMMAND-RESTRICT
const contentsPruned = execResult.fileContents.replace(
/^(?:\\(?:un)?restrict\b.*\r?\n?)/gim,
'',
)

const file = new File([contentsPruned], fileName, {
type: 'text/plain',
})

Expand Down
3 changes: 2 additions & 1 deletion packages/pglite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@
"format": "prettier --write ./src ./tests",
"typecheck": "tsc --noEmit",
"stylecheck": "pnpm lint && prettier --check ./src ./tests",
"prepublishOnly": "pnpm check:exports"
"prepublishOnly": "pnpm check:exports",
"version": "echo $npm_package_version"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.18.1",
Expand Down
2 changes: 2 additions & 0 deletions packages/pglite/src/pglite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ export class PGlite
'max_parallel_workers=0',
'-c',
'max_parallel_workers_per_gather=0',
'-c',
'io_method=sync',
]

/**
Expand Down
7 changes: 7 additions & 0 deletions packages/pglite/tests/basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -715,5 +715,12 @@ await testEsmCjsAndDTC(async (importType) => {

expect(process.exitCode).toEqual(origExitCode)
})

it('PGlite version', async () => {
const db = await PGlite.create()
const version = await db.query<{ version: string }>(`select version();`)
const re = /\PGlite \d+\.\d+\.\d+\b/
expect(re.test(version.rows[0].version)).toBeTruthy()
})
})
})
12 changes: 6 additions & 6 deletions packages/pglite/tests/contrib/amcheck.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ it('amcheck', async () => {
{
bt_index_check: '',
relname: 'pg_proc_proname_args_nsp_index',
relpages: 32,
relpages: 33,
},
{
bt_index_check: '',
relname: 'pg_description_o_c_o_index',
relpages: 23,
relpages: 24,
},
{
bt_index_check: '',
relname: 'pg_attribute_relid_attnam_index',
relpages: 15,
relpages: 16,
},
{
bt_index_check: '',
Expand All @@ -67,17 +67,17 @@ it('amcheck', async () => {
},
{
bt_index_check: '',
relname: 'pg_amop_fam_strat_index',
relname: 'pg_operator_oprname_l_r_n_index',
relpages: 6,
},
{
bt_index_check: '',
relname: 'pg_operator_oprname_l_r_n_index',
relname: 'pg_amop_fam_strat_index',
relpages: 6,
},
{
bt_index_check: '',
relname: 'pg_amop_opr_fam_index',
relname: 'pg_class_relname_nsp_index',
relpages: 6,
},
])
Expand Down
2 changes: 1 addition & 1 deletion postgres-pglite
Submodule postgres-pglite updated 3904 files