-
Notifications
You must be signed in to change notification settings - Fork 24
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
Document how to use DML and DDL batches with PGAdapter #582
Comments
For me they just don't work, I tried with the following code:
|
Add tests to verify that DDL batches work for pgx. Related to #582
@ltoshev The error seems to indicate that your connection is in an active transaction. Spanner does not support DDL statements in a transaction, which is why you are getting this error. I've just added two tests using
|
Hi, yes I found out that I have to start the adapter with -ddl=AutocommitImplicitTransaction flag to be able to run the batches. It's good you added tests. Do you know when will be next release of the adapter and what could we expect as features? |
You're right that this flag will also fix the problem, however it does that by automatically committing the ongoing transaction before executing the DDL batch. Note that the test mentioned above does not use that flag. Instead, it just makes sure that there is no ongoing transaction on the connection before executing the DDL batch. The fact that you need the flag might indicate that there is something unexpected going on in your application. (Or are you using some framework on top of pgx that manages the transactions for you?)
The next release is likely to be early next week. There are no big features planned for the near future. One planned change is logging. Currently, all logs are sent to Are there any specific features you are looking for / missing? If so, please feel free to open a feature request in this repository. |
Add tests to verify that DDL batches work for pgx. Related to #582
DML and DDL batches are important features to improve the performance when working with PGAdapter. The documentation should clearly show how users can use these features.
The text was updated successfully, but these errors were encountered: