Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ydb/_grpc/grpcwrapper/ydb_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ def to_proto(self) -> ydb_query_pb2.TransactionSettings:
return ydb_query_pb2.TransactionSettings(online_read_only=self.tx_mode.to_proto())
if self.tx_mode.name == "stale_read_only":
return ydb_query_pb2.TransactionSettings(stale_read_only=self.tx_mode.to_proto())
if self.tx_mode.name == "snapshot_read_write":
return ydb_query_pb2.TransactionSettings(snapshot_read_write=self.tx_mode.to_proto())
raise ValueError(f"Unknown transaction mode: {self.tx_mode.name}")


@dataclass
Expand Down
18 changes: 18 additions & 0 deletions ydb/_grpc/grpcwrapper/ydb_query_public_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,21 @@ def name(self):

def to_proto(self) -> ydb_query_pb2.StaleModeSettings:
return ydb_query_pb2.StaleModeSettings()


class QuerySnapshotReadWrite(BaseQueryTxMode):
"""Snapshot isolation mode with read-write support.
All read operations within a transaction access the database snapshot.
The snapshot is taken when the transaction begins.
Write operations are also allowed in this mode.
"""

def __init__(self):
self._name = "snapshot_read_write"

@property
def name(self) -> str:
return self._name

def to_proto(self) -> ydb_query_pb2.SnapshotRWModeSettings:
return ydb_query_pb2.SnapshotRWModeSettings()
176 changes: 175 additions & 1 deletion ydb/_grpc/v3/protos/ydb_formats_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

252 changes: 182 additions & 70 deletions ydb/_grpc/v3/protos/ydb_query_pb2.py

Large diffs are not rendered by default.

306 changes: 175 additions & 131 deletions ydb/_grpc/v3/protos/ydb_table_pb2.py

Large diffs are not rendered by default.

486 changes: 265 additions & 221 deletions ydb/_grpc/v3/protos/ydb_topic_pb2.py

Large diffs are not rendered by default.

Loading
Loading