Skip to content

feat: support force_autocommit - #541

Merged
olavloite merged 3 commits into
postgresql-dialectfrom
force-autocommit
Dec 12, 2022
Merged

olavloite merged 3 commits into
postgresql-dialectfrom
force-autocommit

Conversation

@olavloite

@olavloite olavloite commented Dec 9, 2022 •

Copy link
Copy Markdown
Collaborator

Add support for the spanner.force_autocommit session configuration that can be used to force a connection to use autocommit for all statements. A connection that has activated this configuration option will ignore any transaction statements and execute all statements in autocommit. This option can be used in combination with the spanner.autocommit_dml_mode setting to force all DML statements to use Partitioned DML. Insert statements do not support PDML, and if both these two options have been set, PGAdapter will automatically execute insert statements using normal transactions to prevent errors from occurring.

go/pgadapter-force_autocommit

Add support for the `spanner.force_autocommit` session configuration that
can be used to force a connection to use autocommit for all statements. A
connection that has activated this configuration option will ignore any
transaction statements and execute all statements in autocommit. This
option can be used in combination with the `spanner.autocommit_dml_mode`
setting to force all DML statements to use Partitioned DML. Insert
statements do not support PDML, and if both these two options have been
set, PGAdapter will automatically execute insert statements using normal
transactions to prevent errors from occurring.
@codecov

codecov Bot commented Dec 9, 2022 •

Copy link
Copy Markdown

Codecov Report

Merging #541 (477521d) into postgresql-dialect (b64cc7c) will decrease coverage by 0.05%.
The diff coverage is 91.66%.

@@                   Coverage Diff                    @@
##             postgresql-dialect     #541      +/-   ##
========================================================
- Coverage                 88.39%   88.33%   -0.06%     
- Complexity                 2063     2066       +3     
========================================================
  Files                       122      122              
  Lines                      6771     6783      +12     
  Branches                    949      954       +5     
========================================================
+ Hits                       5985     5992       +7     
- Misses                      558      560       +2     
- Partials                    228      231       +3     
Flag Coverage Δ
all_tests 88.33% <91.66%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...panner/pgadapter/statements/BackendConnection.java 92.97% <90.90%> (-0.05%) ⬇️
.../cloud/spanner/pgadapter/session/SessionState.java 95.58% <100.00%> (+0.02%) ⬆️
...gle/cloud/spanner/pgadapter/ConnectionHandler.java 86.60% <0.00%> (-0.86%) ⬇️
...om/google/cloud/spanner/pgadapter/ProxyServer.java 80.81% <0.00%> (-0.59%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@olavloite
olavloite marked this pull request as ready for review December 9, 2022 20:26
@olavloite
olavloite merged commit 52fba80 into postgresql-dialect Dec 12, 2022
@olavloite
olavloite deleted the force-autocommit branch December 12, 2022 20:21
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

Successfully merging this pull request may close these issues.

2 participants