@@ -136,12 +136,6 @@ def callee(session):
136
136
with session .transaction ().execute (
137
137
"""
138
138
PRAGMA TablePathPrefix("{}");
139
-
140
- DECLARE $seriesId AS Uint64;
141
- DECLARE $seasonId AS Uint64;
142
- DECLARE $episodeId AS Uint64;
143
- DECLARE $title AS Utf8;
144
-
145
139
UPSERT INTO episodes (series_id, season_id, episode_id, title) VALUES (2, 6, 1, "TBD");
146
140
""" .format (
147
141
path
@@ -157,11 +151,6 @@ def select_with_parameters(pool, path, series_id, season_id, episode_id):
157
151
def callee (session ):
158
152
query = """
159
153
PRAGMA TablePathPrefix("{}");
160
-
161
- DECLARE $seriesId AS Uint64;
162
- DECLARE $seasonId AS Uint64;
163
- DECLARE $episodeId AS Uint64;
164
-
165
154
$format = DateTime::Format("%Y-%m-%d");
166
155
SELECT
167
156
title,
@@ -175,7 +164,7 @@ def callee(session):
175
164
with session .transaction (ydb .QuerySerializableReadWrite ()).execute (
176
165
query ,
177
166
{
178
- "$seriesId" : series_id , # could be defined implicit in case of int, str, bool
167
+ "$seriesId" : ( series_id , ydb . PrimitiveType . Uint64 ),
179
168
"$seasonId" : (season_id , ydb .PrimitiveType .Uint64 ), # could be defined via tuple
180
169
"$episodeId" : ydb .TypedValue (
181
170
episode_id , ydb .PrimitiveType .Uint64
@@ -201,11 +190,6 @@ def explicit_tcl(pool, path, series_id, season_id, episode_id):
201
190
def callee (session ):
202
191
query = """
203
192
PRAGMA TablePathPrefix("{}");
204
-
205
- DECLARE $seriesId AS Uint64;
206
- DECLARE $seasonId AS Uint64;
207
- DECLARE $episodeId AS Uint64;
208
-
209
193
UPDATE episodes
210
194
SET air_date = CAST(CurrentUtcDate() AS Uint64)
211
195
WHERE series_id = $seriesId AND season_id = $seasonId AND episode_id = $episodeId;
@@ -220,7 +204,11 @@ def callee(session):
220
204
# Transaction control settings continues active transaction (tx)
221
205
with tx .execute (
222
206
query ,
223
- {"$seriesId" : series_id , "$seasonId" : season_id , "$episodeId" : episode_id },
207
+ {
208
+ "$seriesId" : (series_id , ydb .PrimitiveType .Uint64 ),
209
+ "$seasonId" : (season_id , ydb .PrimitiveType .Uint64 ),
210
+ "$episodeId" : (episode_id , ydb .PrimitiveType .Uint64 ),
211
+ },
224
212
) as _ :
225
213
pass
226
214
0 commit comments