@@ -20,10 +20,10 @@ TApplication::TApplication(const TOptions& options)
2020
2121 Driver.emplace (config);
2222 TopicClient.emplace (*Driver);
23- TableClient .emplace (*Driver);
23+ QueryClient .emplace (*Driver);
2424
2525 CreateTopicReadSession (options);
26- CreateTableSession ();
26+ CreateQuerySession ();
2727
2828 TablePath = options.TablePath ;
2929}
@@ -40,15 +40,15 @@ void TApplication::CreateTopicReadSession(const TOptions& options)
4040 std::cout << " Topic session was created" << std::endl;
4141}
4242
43- void TApplication::CreateTableSession ()
43+ void TApplication::CreateQuerySession ()
4444{
45- NYdb::NTable ::TCreateSessionSettings settings;
45+ NYdb::NQuery ::TCreateSessionSettings settings;
4646
47- auto result = TableClient ->GetSession (settings).GetValueSync ();
47+ auto result = QueryClient ->GetSession (settings).GetValueSync ();
4848
49- TableSession = result.GetSession ();
49+ QuerySession = result.GetSession ();
5050
51- std::cout << " Table session was created" << std::endl;
51+ std::cout << " Query session was created" << std::endl;
5252}
5353
5454void TApplication::Run ()
@@ -104,10 +104,10 @@ void TApplication::Finalize()
104104void TApplication::BeginTransaction ()
105105{
106106 Y_ABORT_UNLESS (!Transaction);
107- Y_ABORT_UNLESS (TableSession );
107+ Y_ABORT_UNLESS (QuerySession );
108108
109- auto settings = NYdb::NTable ::TTxSettings::SerializableRW ();
110- auto result = TableSession ->BeginTransaction (settings).GetValueSync ();
109+ auto settings = NYdb::NQuery ::TTxSettings::SerializableRW ();
110+ auto result = QuerySession ->BeginTransaction (settings).GetValueSync ();
111111
112112 Transaction = result.GetTransaction ();
113113}
@@ -116,7 +116,7 @@ void TApplication::CommitTransaction()
116116{
117117 Y_ABORT_UNLESS (Transaction);
118118
119- NYdb::NTable ::TCommitTxSettings settings;
119+ NYdb::NQuery ::TCommitTxSettings settings;
120120
121121 auto result = Transaction->Commit (settings).GetValueSync ();
122122
@@ -173,20 +173,16 @@ void TApplication::InsertRowsIntoTable()
173173
174174 auto params = builder.Build ();
175175
176- NYdb::NTable::TExecDataQuerySettings settings;
177- settings.KeepInQueryCache (true );
178-
179- auto runQuery = [this , &query, ¶ms, &settings](NYdb::NTable::TSession) -> NYdb::TStatus {
176+ auto runQuery = [this , &query, ¶ms](NYdb::NQuery::TSession) -> NYdb::TStatus {
180177 auto result =
181- Transaction->GetSession ().ExecuteDataQuery (query,
182- NYdb::NTable::TTxControl::Tx (*Transaction),
183- params,
184- settings).GetValueSync ();
178+ Transaction->GetSession ().ExecuteQuery (query,
179+ NYdb::NQuery::TTxControl::Tx (*Transaction),
180+ params).GetValueSync ();
185181
186182 return result;
187183 };
188184
189- TableClient-> RetryOperationSync (runQuery);
185+ QueryClient-> RetryQuerySync (runQuery);
190186}
191187
192188void TApplication::AppendTableRow (const NYdb::NTopic::TReadSessionEvent::TDataReceivedEvent::TMessage& message)
0 commit comments