-
Notifications
You must be signed in to change notification settings - Fork 110
Introduce option to setup transaction before executing queries #3471
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
Merged
+1,210
−43
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
4c31bba
Partially working yaml tests for transaction setup
ScottDugas aa6d8e9
Complete work of transactional yaml tests
ScottDugas 7d276ff
Revert to calling commit, like in main
ScottDugas 6e3b2ff
Don't manually commit transactional work
ScottDugas 0c051d8
Remove ExternalSingleServerConfig reverting back to Multi
ScottDugas 36c2389
Wrap the lines for the setup
ScottDugas f717e6d
Merge branch 'main' into yaml-transactions
ScottDugas dcbc0a0
Merge branch 'main' into yaml-transactions
ScottDugas c1b4e9c
Add new keywords to YAML-SQL.xml
ScottDugas f432f5b
Fix style/pmd warnings
ScottDugas c31aefc
Fixup and increase comments in transaction-tests.yamsql
ScottDugas 8d53304
Set supported_version in transaction-tests.yamsql
ScottDugas 2502c66
Add tests for transaction setup, includes some failing
ScottDugas 4af589e
Require transaction setups before everything else
ScottDugas fa4ec6f
Actually allow transaction_setups after setup
ScottDugas 51f3303
Actually, do not restrict ordering
ScottDugas 5ba668b
Better tests and explanation of duplicate references
ScottDugas 6dffe16
Fix some filenames in header comments
ScottDugas e16fbe0
Restrict transaction setups to temp functions
ScottDugas 071d1a0
Remove unused import
ScottDugas 5d8ca02
Fix setup-reference-after-results.yamsql ordering
ScottDugas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...c/main/java/com/apple/foundationdb/relational/yamltests/block/TransactionSetupsBlock.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* TransactionSetupsBlock.java | ||
* | ||
* This source file is part of the FoundationDB open source project | ||
* | ||
* Copyright 2015-2025 Apple Inc. and the FoundationDB project authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.apple.foundationdb.relational.yamltests.block; | ||
|
||
import com.apple.foundationdb.relational.yamltests.Matchers; | ||
import com.apple.foundationdb.relational.yamltests.YamlExecutionContext; | ||
|
||
import java.util.Map; | ||
|
||
public class TransactionSetupsBlock { | ||
public static final String TRANSACTION_SETUP = "transaction_setups"; | ||
|
||
public static Block parse(final int lineNumber, | ||
final Object document, | ||
final YamlExecutionContext executionContext) { | ||
final Map<?, ?> map = Matchers.map(document); | ||
for (final Map.Entry<?, ?> entry : map.entrySet()) { | ||
final String transactionSetupName = Matchers.string(entry.getKey(), "transaction setup name"); | ||
final String transactionSetupCommand = Matchers.string(entry.getValue(), "transaction setup command"); | ||
executionContext.registerTransactionSetup(transactionSetupName, transactionSetupCommand); | ||
} | ||
return new NoOpBlock(lineNumber); | ||
} | ||
|
||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We seem pretty incosistent in general about whether things should be
snake_case
orcamelCase