electric-sql / electric-sql/pglite

Error:[tyeporm migration] cannot insert multiple commands into a prepared statement

Open
#627 9 comments 0 reactions 0 assignees View on GitHub
bug compatibility
Dominant language
TypeScript
Stars
16k
Forks
442
Avg merge
20h 19m
Merged PRs (30d)
7

Description

Summary
If I run typeorm migration, i have cannot insert multiple commands into a prepared statement, I dig into typeorm code and find out it use `driver's query `function. and pglite `query` seems not support multiple commands, whilte `exec` function support multiple command.

Example
```
const db = new PGlite()
// typeorm uses query function in migration code.
await db.query(`
CREATE TABLE IF NOT EXISTS test1 (
id SERIAL PRIMARY KEY,
name TEXT
);
CREATE TABLE IF NOT EXISTS test2 (
id SERIAL PRIMARY KEY,
name TEXT
);
`)
})
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.