Skip to content

Commit

Permalink
json query transaction mode (ydb-platform#5574) - merge stable-24-2 (y…
Browse files Browse the repository at this point in the history
  • Loading branch information
StekPerepolnen authored and uzhastik committed Sep 9, 2024
1 parent f8f340f commit bd05e4e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ydb/core/viewer/json_query.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,22 @@ class TJsonQuery : public TViewerPipeClient<TJsonQuery> {
}
}

void SetTransactionMode(NKikimrKqp::TQueryRequest& request) {
if (TransactionMode == "serializable-read-write") {
request.mutable_txcontrol()->mutable_begin_tx()->mutable_serializable_read_write();
request.mutable_txcontrol()->set_commit_tx(true);
} else if (TransactionMode == "online-read-only") {
request.mutable_txcontrol()->mutable_begin_tx()->mutable_online_read_only();
request.mutable_txcontrol()->set_commit_tx(true);
} else if (TransactionMode == "stale-read-only") {
request.mutable_txcontrol()->mutable_begin_tx()->mutable_stale_read_only();
request.mutable_txcontrol()->set_commit_tx(true);
} else if (TransactionMode == "snapshot-read-only") {
request.mutable_txcontrol()->mutable_begin_tx()->mutable_snapshot_read_only();
request.mutable_txcontrol()->set_commit_tx(true);
}
}

void SendKpqProxyRequest() {
if (QueryId) {
TActorId actorId = Viewer->FindRunningQuery(QueryId);
Expand Down

0 comments on commit bd05e4e

Please sign in to comment.