• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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 
16 #ifndef NATIVE_RDB_SQLITE_GLOBAL_CONFIG_H
17 #define NATIVE_RDB_SQLITE_GLOBAL_CONFIG_H
18 
19 #include <string>
20 
21 namespace OHOS {
22 namespace NativeRdb {
23 
24 class SqliteGlobalConfig {
25 public:
26     SqliteGlobalConfig();
27     ~SqliteGlobalConfig();
28     static void InitSqliteGlobalConfig();
29     static void SqliteLogCallback(const void *data, int err, const char *msg);
30     static int GetReadConnectionCount();
31     static std::string GetMemoryDbPath();
32     static int GetPageSize();
33     static std::string GetWalSyncMode();
34     static int GetJournalFileSize();
35     static int GetWalAutoCheckpoint();
36     static std::string GetDefaultJournalMode();
37 
38 private:
39     static const int SOFT_HEAP_LIMIT;
40     static const bool CALLBACK_LOG_SWITCH;
41     static const int CONNECTION_POOL_SIZE;
42     static const std::string MEMORY_DB_PATH;
43     static const int DB_PAGE_SIZE;
44     static const std::string DEFAULT_JOURNAL_MODE;
45     static const std::string WAL_SYNC_MODE;
46     static const int JOURNAL_FILE_SIZE;
47     static const int WAL_AUTO_CHECKPOINT;
48 };
49 
50 } // namespace NativeRdb
51 } // namespace OHOS
52 
53 #endif
54