We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have a use-case where I have a DDL script to initialise the database. Something similar to below:
CREATE DATABASE dbName with owner dbuser ; CREATE TABLE IF NOT EXISTS table ( col1 VARCHAR(255) NOT NULL, col2 VARCHAR(255) NOT NULL, );
I'm trying to use it as below:
await (sql`${sql.unsafe(sqlScript)}` as any).simple();
which results in the following error:
Error creating database PostgresError: CREATE DATABASE cannot run inside a transaction block
EDIT: I realize this is not possible to do in postgresql since one cannot switch a database without re-initializing the connection (aka backend).
simple
The text was updated successfully, but these errors were encountered:
Add simple() type definition
simple()
a509c8d
Fixes porsager#714.
Have a look at https://github.com/porsager/postgres/issues/198 – looks like a similar case 👍
Sorry, something went wrong.
2b85ea7
No branches or pull requests
Problem
I have a use-case where I have a DDL script to initialise the database. Something similar to below:
I'm trying to use it as below:
which results in the following error:
EDIT: I realize this is not possible to do in postgresql since one cannot switch a database without re-initializing the connection (aka backend).
Questions:
simple
method?The text was updated successfully, but these errors were encountered: