Skip to content
New issue

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

Transaction isolation level not supported #268

Open
rhlsthrm opened this issue Sep 19, 2022 · 5 comments
Open

Transaction isolation level not supported #268

rhlsthrm opened this issue Sep 19, 2022 · 5 comments

Comments

@rhlsthrm
Copy link

rhlsthrm commented Sep 19, 2022

Describe the bug

Running a simple transaction with isolation level breaks pg-mem.

     Error: 💔 Your query failed to parse.
This is most likely due to a SQL syntax error. However, you might also have hit a bug, or an unimplemented feature of pg-mem.
If this is the case, please file an issue at https://github.com/oguimbal/pg-mem along with a query that reproduces this syntax error.

👉 Failed query:

    START TRANSACTION ISOLATION LEVEL SERIALIZABLE;

💀 Syntax error at line 1 col 19:

  START TRANSACTION ISOLATION
                    ^
Unexpected word token: "isolation". Instead, I was expecting to see one of the following:

    - A "semicolon" token

To Reproduce

START TRANSACTION ISOLATION LEVEL SERIALIZABLE;

pg-mem version

"version": "2.6.3",

My PG library Zapatos uses isolation levels and it would be really useful to have this supported.

@MyNameIsOka
Copy link

I just started setting up pg-mem for our project and ran into the same error.
Is there anything I can do as a workaround (except ditching isolation)?

@rhlsthrm
Copy link
Author

I just started setting up pg-mem for our project and ran into the same error. Is there anything I can do as a workaround (except ditching isolation)?

This was a dealbreaker for me so I moved off this project and I'm running Postgres directly in our unit tests in CI.

@MyNameIsOka
Copy link

Thank you for the quick reply! Sad to hear this as this repo looks quite convenient.

@rhlsthrm
Copy link
Author

It is quite convenient if your PG queries are quite basic I think.

@smcclure17
Copy link

smcclure17 commented Apr 12, 2024

Having this same issue sadly, I was hoping to use a pg-mem adapter with Drizzle ORM, but the Drizzle migrations cause this issue.

It looks like this library uses https://github.com/oguimbal/pgsql-ast-parser to parse SQL queries. There's an open issue for supporting SET TRANSACTION ... queries, but it's been open for a long time oguimbal/pgsql-ast-parser#76

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants