1 /*
2 * Copyright (c) 2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15 #include "rdb_store.h"
16
17 #include "sqlite_sql_builder.h"
18 #include "sqlite_utils.h"
19 #include "traits.h"
20 namespace OHOS::NativeRdb {
ModifyTime(std::shared_ptr<ResultSet> result,std::map<std::vector<uint8_t>,PRIKey> hashKeys,bool isFromRowId)21 RdbStore::ModifyTime::ModifyTime(
22 std::shared_ptr<ResultSet> result, std::map<std::vector<uint8_t>, PRIKey> hashKeys, bool isFromRowId)
23 : result_(std::move(result)), hash_(std::move(hashKeys)), isFromRowId_(isFromRowId)
24 {
25 for (auto &[_, priKey] : hash_) {
26 if (priKey.index() != Traits::variant_index_of_v<std::string, PRIKey>) {
27 break;
28 }
29 auto *val = Traits::get_if<std::string>(&priKey);
30 if (val != nullptr && maxOriginKeySize_ <= val->length()) {
31 maxOriginKeySize_ = val->length() + 1;
32 }
33 }
34 }
35
operator std::map<PRIKey,Date>()36 RdbStore::ModifyTime::operator std::map<PRIKey, Date>()
37 {
38 if (result_ == nullptr) {
39 return {};
40 }
41 int count = 0;
42 if (result_->GetRowCount(count) != E_OK || count <= 0) {
43 return {};
44 }
45 std::map<PRIKey, Date> result;
46 for (int i = 0; i < count; i++) {
47 result_->GoToRow(i);
48 int64_t timeStamp = 0;
49 result_->GetLong(1, timeStamp);
50 PRIKey index = 0;
51 if (isFromRowId_) {
52 int64_t rowid = 0;
53 result_->GetLong(0, rowid);
54 index = rowid;
55 } else {
56 std::vector<uint8_t> hashKey;
57 result_->GetBlob(0, hashKey);
58 index = hash_[hashKey];
59 }
60 result[index] = Date(timeStamp);
61 }
62 return result;
63 }
64
operator std::shared_ptr<ResultSet>()65 RdbStore::ModifyTime::operator std::shared_ptr<ResultSet>()
66 {
67 return result_;
68 }
69
GetOriginKey(const std::vector<uint8_t> & hash)70 RdbStore::PRIKey RdbStore::ModifyTime::GetOriginKey(const std::vector<uint8_t> &hash)
71 {
72 auto it = hash_.find(hash);
73 return it != hash_.end() ? it->second : std::monostate();
74 }
75
GetMaxOriginKeySize()76 size_t RdbStore::ModifyTime::GetMaxOriginKeySize()
77 {
78 return maxOriginKeySize_;
79 }
80
NeedConvert() const81 bool RdbStore::ModifyTime::NeedConvert() const
82 {
83 return !hash_.empty();
84 }
85
ToValues(const std::vector<std::string> & args)86 static std::vector<ValueObject> ToValues(const std::vector<std::string> &args)
87 {
88 std::vector<ValueObject> newArgs;
89 std::for_each(args.begin(), args.end(), [&newArgs](const auto &it) {
90 newArgs.push_back(ValueObject(it));
91 });
92 return newArgs;
93 }
94
ColHasSpecificField(const std::vector<std::string> & columns)95 static bool ColHasSpecificField(const std::vector<std::string> &columns)
96 {
97 for (const std::string &column : columns) {
98 if (column.find(SqliteUtils::REP) != std::string::npos) {
99 return true;
100 }
101 }
102 return false;
103 }
104
Insert(const std::string & table,const Row & row,Resolution resolution)105 std::pair<int, int64_t> RdbStore::Insert(const std::string &table, const Row &row, Resolution resolution)
106 {
107 (void)table;
108 (void)row;
109 (void)resolution;
110 return { E_NOT_SUPPORT, -1 };
111 }
112
Insert(int64_t & outRowId,const std::string & table,const Row & row)113 int RdbStore::Insert(int64_t &outRowId, const std::string &table, const Row &row)
114 {
115 auto [errCode, rowid] = Insert(table, row, NO_ACTION);
116 if (errCode == E_OK) {
117 outRowId = rowid;
118 }
119 return errCode;
120 }
121
InsertWithConflictResolution(int64_t & outRowId,const std::string & table,const Row & row,Resolution resolution)122 int RdbStore::InsertWithConflictResolution(
123 int64_t &outRowId, const std::string &table, const Row &row, Resolution resolution)
124 {
125 auto [errCode, rowid] = Insert(table, row, resolution);
126 if (errCode == E_OK) {
127 outRowId = rowid;
128 }
129 return errCode;
130 }
131
Replace(int64_t & outRowId,const std::string & table,const Row & row)132 int RdbStore::Replace(int64_t &outRowId, const std::string &table, const Row &row)
133 {
134 auto [errCode, rowid] = Insert(table, row, Resolution::ON_CONFLICT_REPLACE);
135 if (errCode == E_OK) {
136 outRowId = rowid;
137 }
138 return errCode;
139 }
140
BatchInsert(int64_t & outInsertNum,const std::string & table,const Rows & rows)141 int RdbStore::BatchInsert(int64_t &outInsertNum, const std::string &table, const Rows &rows)
142 {
143 ValuesBuckets refRows;
144 for (auto &row : rows) {
145 refRows.Put(row);
146 }
147 auto [errCode, count] = BatchInsert(table, refRows);
148 if (errCode == E_OK) {
149 outInsertNum = count;
150 }
151 return errCode;
152 }
153
BatchInsert(const std::string & table,const RefRows & rows)154 std::pair<int, int64_t> RdbStore::BatchInsert(const std::string &table, const RefRows &rows)
155 {
156 return { E_NOT_SUPPORT, -1 };
157 }
158
BatchInsertWithConflictResolution(const std::string & table,const RdbStore::RefRows & rows,RdbStore::Resolution resolution)159 std::pair<int, int64_t> RdbStore::BatchInsertWithConflictResolution(
160 const std::string &table, const RdbStore::RefRows &rows, RdbStore::Resolution resolution)
161 {
162 return { E_NOT_SUPPORT, -1 };
163 }
164
Update(const std::string & table,const Row & row,const std::string & where,const Values & args,Resolution resolution)165 std::pair<int, int> RdbStore::Update(
166 const std::string &table, const Row &row, const std::string &where, const Values &args, Resolution resolution)
167 {
168 (void)table;
169 (void)row;
170 (void)where;
171 (void)args;
172 (void)resolution;
173 return { E_NOT_SUPPORT, 0 };
174 }
175
Update(int & changedRows,const std::string & table,const Row & row,const std::string & whereClause,const Values & args)176 int RdbStore::Update(
177 int &changedRows, const std::string &table, const Row &row, const std::string &whereClause, const Values &args)
178 {
179 auto [errCode, changes] = Update(table, row, whereClause, args, NO_ACTION);
180 if (errCode == E_OK) {
181 changedRows = changes;
182 }
183 return errCode;
184 }
185
Update(int & changedRows,const Row & row,const AbsRdbPredicates & predicates)186 int RdbStore::Update(int &changedRows, const Row &row, const AbsRdbPredicates &predicates)
187 {
188 return Update(changedRows, predicates.GetTableName(), row, predicates.GetWhereClause(), predicates.GetBindArgs());
189 }
190
Update(int & changedRows,const std::string & table,const Row & row,const std::string & whereClause,const Olds & args)191 int RdbStore::Update(
192 int &changedRows, const std::string &table, const Row &row, const std::string &whereClause, const Olds &args)
193 {
194 return Update(changedRows, table, row, whereClause, ToValues(args));
195 };
196
UpdateWithConflictResolution(int & changedRows,const std::string & table,const Row & row,const std::string & whereClause,const Olds & args,Resolution resolution)197 int RdbStore::UpdateWithConflictResolution(int &changedRows, const std::string &table, const Row &row,
198 const std::string &whereClause, const Olds &args, Resolution resolution)
199 {
200 auto [errCode, changes] = Update(table, row, whereClause, ToValues(args), resolution);
201 if (errCode == E_OK) {
202 changedRows = changes;
203 }
204 return errCode;
205 }
206
UpdateWithConflictResolution(int & changedRows,const std::string & table,const Row & row,const std::string & whereClause,const Values & args,Resolution resolution)207 int RdbStore::UpdateWithConflictResolution(int &changedRows, const std::string &table, const Row &row,
208 const std::string &whereClause, const Values &args, Resolution resolution)
209 {
210 auto [errCode, changes] = Update(table, row, whereClause, args, resolution);
211 if (errCode == E_OK) {
212 changedRows = changes;
213 }
214 return errCode;
215 }
216
Delete(int & deletedRows,const std::string & table,const std::string & whereClause,const Olds & args)217 int RdbStore::Delete(int &deletedRows, const std::string &table, const std::string &whereClause, const Olds &args)
218 {
219 return Delete(deletedRows, table, whereClause, ToValues(args));
220 }
221
Delete(int & deletedRows,const AbsRdbPredicates & predicates)222 int RdbStore::Delete(int &deletedRows, const AbsRdbPredicates &predicates)
223 {
224 return Delete(deletedRows, predicates.GetTableName(), predicates.GetWhereClause(), predicates.GetBindArgs());
225 }
226
Query(int & errCode,bool distinct,const std::string & table,const Fields & columns,const std::string & whereClause,const Values & args,const std::string & groupBy,const std::string & indexName,const std::string & orderBy,const int & limit,const int & offset)227 std::shared_ptr<AbsSharedResultSet> RdbStore::Query(int &errCode, bool distinct, const std::string &table,
228 const Fields &columns, const std::string &whereClause, const Values &args, const std::string &groupBy,
229 const std::string &indexName, const std::string &orderBy, const int &limit, const int &offset)
230 {
231 std::string sql;
232 errCode = SqliteSqlBuilder::BuildQueryString(
233 distinct, table, "", columns, whereClause, groupBy, indexName, orderBy, limit, offset, sql);
234 if (errCode != E_OK) {
235 return nullptr;
236 }
237 return QuerySql(sql, args);
238 }
239
Query(const AbsRdbPredicates & predicates,const Fields & columns)240 std::shared_ptr<AbsSharedResultSet> RdbStore::Query(const AbsRdbPredicates &predicates, const Fields &columns)
241 {
242 std::string sql;
243 std::pair<bool, bool> queryStatus = { ColHasSpecificField(columns), predicates.HasSpecificField() };
244 if (queryStatus.first || queryStatus.second) {
245 std::string table = predicates.GetTableName();
246 std::string logTable = GetLogTableName(table);
247 sql = SqliteSqlBuilder::BuildCursorQueryString(predicates, columns, logTable, queryStatus);
248 } else {
249 sql = SqliteSqlBuilder::BuildQueryString(predicates, columns);
250 }
251 return QuerySql(sql, predicates.GetBindArgs());
252 }
253
QuerySql(const std::string & sql,const Olds & args)254 std::shared_ptr<AbsSharedResultSet> RdbStore::QuerySql(const std::string &sql, const Olds &args)
255 {
256 return QuerySql(sql, ToValues(args));
257 }
258
QueryByStep(const std::string & sql,const Olds & args)259 std::shared_ptr<ResultSet> RdbStore::QueryByStep(const std::string &sql, const Olds &args)
260 {
261 return QueryByStep(sql, ToValues(args));
262 }
263
QueryByStep(const AbsRdbPredicates & predicates,const RdbStore::Fields & columns,bool preCount)264 std::shared_ptr<ResultSet> RdbStore::QueryByStep(const AbsRdbPredicates &predicates, const RdbStore::Fields &columns,
265 bool preCount)
266 {
267 std::string sql;
268 if (predicates.HasSpecificField()) {
269 std::string table = predicates.GetTableName();
270 std::string logTable = GetLogTableName(table);
271 sql = SqliteSqlBuilder::BuildLockRowQueryString(predicates, columns, logTable);
272 } else {
273 sql = SqliteSqlBuilder::BuildQueryString(predicates, columns);
274 }
275 return QueryByStep(sql, predicates.GetBindArgs(), preCount);
276 }
277
RemoteQuery(const std::string & device,const AbsRdbPredicates & predicates,const Fields & columns,int & errCode)278 std::shared_ptr<ResultSet> RdbStore::RemoteQuery(
279 const std::string &device, const AbsRdbPredicates &predicates, const Fields &columns, int &errCode)
280 {
281 (void)device;
282 (void)predicates;
283 (void)columns;
284 errCode = E_NOT_SUPPORT;
285 return nullptr;
286 }
287
QuerySharingResource(const AbsRdbPredicates & predicates,const Fields & columns)288 std::pair<int32_t, std::shared_ptr<ResultSet>> RdbStore::QuerySharingResource(
289 const AbsRdbPredicates &predicates, const Fields &columns)
290 {
291 (void)predicates;
292 (void)columns;
293 return { E_NOT_SUPPORT, nullptr };
294 }
295
ExecuteSql(const std::string & sql,const Values & args)296 int RdbStore::ExecuteSql(const std::string &sql, const Values &args)
297 {
298 auto [errCode, value] = Execute(sql, args, 0);
299 return errCode;
300 }
301
Execute(const std::string & sql,const Values & args,int64_t trxId)302 std::pair<int32_t, ValueObject> RdbStore::Execute(const std::string &sql, const Values &args, int64_t trxId)
303 {
304 return { E_NOT_SUPPORT, ValueObject() };
305 }
306
ExecuteAndGetLong(int64_t & outValue,const std::string & sql,const Values & args)307 int RdbStore::ExecuteAndGetLong(int64_t &outValue, const std::string &sql, const Values &args)
308 {
309 auto [errCode, value] = Execute(sql, args);
310 if (errCode == E_OK) {
311 outValue = static_cast<int64_t>(value);
312 }
313 return errCode;
314 }
315
ExecuteAndGetString(std::string & outValue,const std::string & sql,const Values & args)316 int RdbStore::ExecuteAndGetString(std::string &outValue, const std::string &sql, const Values &args)
317 {
318 auto [errCode, value] = Execute(sql, args);
319 if (errCode == E_OK) {
320 outValue = static_cast<std::string>(value);
321 }
322 return errCode;
323 }
324
ExecuteForLastInsertedRowId(int64_t & outValue,const std::string & sql,const Values & args)325 int RdbStore::ExecuteForLastInsertedRowId(int64_t &outValue, const std::string &sql, const Values &args)
326 {
327 auto [errCode, value] = Execute(sql, args);
328 if (errCode == E_OK) {
329 (void)value.GetLong(outValue);
330 }
331 return errCode;
332 }
333
ExecuteForChangedRowCount(int64_t & outValue,const std::string & sql,const Values & args)334 int RdbStore::ExecuteForChangedRowCount(int64_t &outValue, const std::string &sql, const Values &args)
335 {
336 auto [errCode, value] = Execute(sql, args);
337 if (errCode == E_OK) {
338 (void)value.GetLong(outValue);
339 }
340 return errCode;
341 }
342
Backup(const std::string & databasePath,const std::vector<uint8_t> & encryptKey)343 int RdbStore::Backup(const std::string &databasePath, const std::vector<uint8_t> &encryptKey)
344 {
345 (void)databasePath;
346 (void)encryptKey;
347 return E_NOT_SUPPORT;
348 }
349
Attach(const std::string & alias,const std::string & pathName,const std::vector<uint8_t> encryptKey)350 int RdbStore::Attach(const std::string &alias, const std::string &pathName, const std::vector<uint8_t> encryptKey)
351 {
352 (void)alias;
353 (void)pathName;
354 (void)encryptKey;
355 return E_OK;
356 }
357
Count(int64_t & outValue,const AbsRdbPredicates & predicates)358 int RdbStore::Count(int64_t &outValue, const AbsRdbPredicates &predicates)
359 {
360 (void)outValue;
361 (void)predicates;
362 return E_NOT_SUPPORT;
363 }
364
CreateTransaction(int32_t type)365 std::pair<int32_t, std::shared_ptr<Transaction>> RdbStore::CreateTransaction(int32_t type)
366 {
367 (void)type;
368 return { E_NOT_SUPPORT, nullptr };
369 }
370
BeginTransaction()371 int RdbStore::BeginTransaction()
372 {
373 return E_NOT_SUPPORT;
374 }
375
BeginTrans()376 std::pair<int, int64_t> RdbStore::BeginTrans()
377 {
378 return { E_NOT_SUPPORT, 0 };
379 }
380
RollBack()381 int RdbStore::RollBack()
382 {
383 return E_NOT_SUPPORT;
384 }
385
RollBack(int64_t trxId)386 int RdbStore::RollBack(int64_t trxId)
387 {
388 (void)trxId;
389 return E_NOT_SUPPORT;
390 }
391
Commit()392 int RdbStore::Commit()
393 {
394 return E_NOT_SUPPORT;
395 }
396
Commit(int64_t trxId)397 int RdbStore::Commit(int64_t trxId)
398 {
399 (void)trxId;
400 return E_NOT_SUPPORT;
401 }
402
IsInTransaction()403 bool RdbStore::IsInTransaction()
404 {
405 return true;
406 }
407
GetPath()408 std::string RdbStore::GetPath()
409 {
410 return "";
411 }
412
IsHoldingConnection()413 bool RdbStore::IsHoldingConnection()
414 {
415 return true;
416 }
417
IsOpen() const418 bool RdbStore::IsOpen() const
419 {
420 return true;
421 }
422
IsReadOnly() const423 bool RdbStore::IsReadOnly() const
424 {
425 return false;
426 }
427
IsMemoryRdb() const428 bool RdbStore::IsMemoryRdb() const
429 {
430 return false;
431 }
432
Restore(const std::string & backupPath,const std::vector<uint8_t> & newKey)433 int RdbStore::Restore(const std::string &backupPath, const std::vector<uint8_t> &newKey)
434 {
435 (void)backupPath;
436 (void)newKey;
437 return E_NOT_SUPPORT;
438 }
439
SetDistributedTables(const std::vector<std::string> & tables,int32_t type,const DistributedRdb::DistributedConfig & distributedConfig)440 int RdbStore::SetDistributedTables(
441 const std::vector<std::string> &tables, int32_t type, const DistributedRdb::DistributedConfig &distributedConfig)
442 {
443 (void)tables;
444 (void)type;
445 (void)distributedConfig;
446 return E_NOT_SUPPORT;
447 }
448
ObtainDistributedTableName(const std::string & device,const std::string & table,int & errCode)449 std::string RdbStore::ObtainDistributedTableName(const std::string &device, const std::string &table, int &errCode)
450 {
451 errCode = E_NOT_SUPPORT;
452 return table + "_" + device;
453 }
454
Sync(const SyncOption & option,const AbsRdbPredicates & predicate,const AsyncBrief & async)455 int RdbStore::Sync(const SyncOption &option, const AbsRdbPredicates &predicate, const AsyncBrief &async)
456 {
457 (void)option;
458 (void)predicate;
459 (void)async;
460 return E_NOT_SUPPORT;
461 }
462
Sync(const SyncOption & option,const std::vector<std::string> & tables,const AsyncDetail & async)463 int RdbStore::Sync(const SyncOption &option, const std::vector<std::string> &tables, const AsyncDetail &async)
464 {
465 (void)option;
466 (void)tables;
467 (void)async;
468 return E_NOT_SUPPORT;
469 }
470
Sync(const SyncOption & option,const AbsRdbPredicates & predicate,const AsyncDetail & async)471 int RdbStore::Sync(const SyncOption &option, const AbsRdbPredicates &predicate, const AsyncDetail &async)
472 {
473 (void)option;
474 (void)predicate;
475 (void)async;
476 return E_NOT_SUPPORT;
477 }
478
Subscribe(const SubscribeOption & option,RdbStoreObserver * observer)479 int RdbStore::Subscribe(const SubscribeOption &option, RdbStoreObserver *observer)
480 {
481 (void)option;
482 (void)observer;
483 return E_NOT_SUPPORT;
484 }
485
UnSubscribe(const SubscribeOption & option,RdbStoreObserver * observer)486 int RdbStore::UnSubscribe(const SubscribeOption &option, RdbStoreObserver *observer)
487 {
488 (void)option;
489 (void)observer;
490 return E_NOT_SUPPORT;
491 }
492
SubscribeObserver(const SubscribeOption & option,const std::shared_ptr<RdbStoreObserver> & observer)493 int RdbStore::SubscribeObserver(const SubscribeOption &option, const std::shared_ptr<RdbStoreObserver> &observer)
494 {
495 (void)option;
496 (void)observer;
497 return E_NOT_SUPPORT;
498 }
499
UnsubscribeObserver(const SubscribeOption & option,const std::shared_ptr<RdbStoreObserver> & observer)500 int RdbStore::UnsubscribeObserver(const SubscribeOption &option, const std::shared_ptr<RdbStoreObserver> &observer)
501 {
502 (void)option;
503 (void)observer;
504 return E_NOT_SUPPORT;
505 }
506
RegisterAutoSyncCallback(std::shared_ptr<DetailProgressObserver> observer)507 int RdbStore::RegisterAutoSyncCallback(std::shared_ptr<DetailProgressObserver> observer)
508 {
509 (void)observer;
510 return E_NOT_SUPPORT;
511 }
512
UnregisterAutoSyncCallback(std::shared_ptr<DetailProgressObserver> observer)513 int RdbStore::UnregisterAutoSyncCallback(std::shared_ptr<DetailProgressObserver> observer)
514 {
515 (void)observer;
516 return E_NOT_SUPPORT;
517 }
518
Notify(const std::string & event)519 int RdbStore::Notify(const std::string &event)
520 {
521 (void)event;
522 return E_NOT_SUPPORT;
523 }
524
IsSlaveDiffFromMaster() const525 bool RdbStore::IsSlaveDiffFromMaster() const
526 {
527 return false;
528 }
529
GetDbType() const530 int32_t RdbStore::GetDbType() const
531 {
532 return DB_SQLITE;
533 }
534
LockCloudContainer()535 std::pair<int32_t, uint32_t> RdbStore::LockCloudContainer()
536 {
537 return { E_OK, 0 };
538 }
539
UnlockCloudContainer()540 int32_t RdbStore::UnlockCloudContainer()
541 {
542 return E_OK;
543 }
544
InterruptBackup()545 int RdbStore::InterruptBackup()
546 {
547 return E_OK;
548 }
549
GetBackupStatus() const550 int32_t RdbStore::GetBackupStatus() const
551 {
552 return SlaveStatus::UNDEFINED;
553 }
554
GetModifyTime(const std::string & table,const std::string & column,std::vector<PRIKey> & keys)555 RdbStore::ModifyTime RdbStore::GetModifyTime(
556 const std::string &table, const std::string &column, std::vector<PRIKey> &keys)
557 {
558 (void)table;
559 (void)column;
560 (void)keys;
561 return {};
562 }
563
CleanDirtyData(const std::string & table,uint64_t cursor)564 int RdbStore::CleanDirtyData(const std::string &table, uint64_t cursor)
565 {
566 (void)table;
567 (void)cursor;
568 return E_NOT_SUPPORT;
569 }
570
GetRebuilt(RebuiltType & rebuilt)571 int RdbStore::GetRebuilt(RebuiltType &rebuilt)
572 {
573 (void)rebuilt;
574 return E_NOT_SUPPORT;
575 }
576
Attach(const RdbStoreConfig & config,const std::string & attachName,int32_t waitTime)577 std::pair<int32_t, int32_t> RdbStore::Attach(
578 const RdbStoreConfig &config, const std::string &attachName, int32_t waitTime)
579 {
580 (void)config;
581 (void)attachName;
582 (void)waitTime;
583 return { E_NOT_SUPPORT, 0 };
584 }
585
Detach(const std::string & attachName,int32_t waitTime)586 std::pair<int32_t, int32_t> RdbStore::Detach(const std::string &attachName, int32_t waitTime)
587 {
588 (void)attachName;
589 (void)waitTime;
590 return { E_NOT_SUPPORT, 0 };
591 }
592
ModifyLockStatus(const AbsRdbPredicates & predicates,bool isLock)593 int RdbStore::ModifyLockStatus(const AbsRdbPredicates &predicates, bool isLock)
594 {
595 (void)predicates;
596 (void)isLock;
597 return E_NOT_SUPPORT;
598 }
599
SetSearchable(bool isSearchable)600 int RdbStore::SetSearchable(bool isSearchable)
601 {
602 (void)isSearchable;
603 return E_NOT_SUPPORT;
604 }
605
GetLogTableName(const std::string & tableName)606 std::string RdbStore::GetLogTableName(const std::string &tableName)
607 {
608 return "naturalbase_rdb_aux_" + tableName + "_log";
609 }
610 } // namespace OHOS::NativeRdb