28struct ExtensionOptions;
32class StorageExtension;
36struct ExtensionOption;
65 explicit SystemConfig(uint64_t bufferPoolSize = -1u, uint64_t maxNumThreads = 0,
66 bool enableCompression =
true,
bool readOnly =
false, uint64_t maxDBSize = -1u,
67 bool autoCheckpoint =
true, uint64_t checkpointThreshold = 16777216 );
108 std::vector<std::unique_ptr<function::Function>> functionSet);
113 std::unique_ptr<storage::StorageExtension> storageExtension);
130 using construct_bm_func_t =
131 std::function<std::unique_ptr<storage::BufferManager>(
const Database&)>;
133 struct QueryIDGenerator {
134 uint64_t queryID = 0;
135 std::mutex queryIDLock;
138 static std::unique_ptr<storage::BufferManager> initBufferManager(
const Database& db);
139 void initMembers(std::string_view dbPath, construct_bm_func_t initBmFunc = initBufferManager);
142 static std::unique_ptr<Database> construct(std::string_view databasePath,
143 SystemConfig systemConfig, construct_bm_func_t constructFunc);
146 void initAndLockDBDir();
149 std::string databasePath;
151 std::unique_ptr<common::VirtualFileSystem> vfs;
152 std::unique_ptr<storage::BufferManager> bufferManager;
153 std::unique_ptr<storage::MemoryManager> memoryManager;
154 std::unique_ptr<processor::QueryProcessor> queryProcessor;
155 std::unique_ptr<catalog::Catalog> catalog;
156 std::unique_ptr<storage::StorageManager> storageManager;
157 std::unique_ptr<transaction::TransactionManager> transactionManager;
158 std::unique_ptr<common::FileInfo> lockFile;
159 std::unique_ptr<extension::ExtensionOptions> extensionOptions;
160 std::unique_ptr<DatabaseManager> databaseManager;
162 QueryIDGenerator queryIDGenerator;
#define KUZU_API
Definition api.h:25
Contain client side configuration. We make profiler associated per query, so profiler is not maintain...
Definition client_context.h:57
Connection is used to interact with a Database instance. Each Connection is thread-safe....
Definition connection.h:14
Database class is the main class of KùzuDB. It manages all database components.
Definition database.h:81
KUZU_API void addExtensionOption(std::string name, common::LogicalTypeID type, common::Value defaultValue)
friend class testing::PrivateGraphTest
Definition database.h:87
friend struct extension::ExtensionUtils
Definition database.h:89
KUZU_API void registerStorageExtension(std::string name, std::unique_ptr< storage::StorageExtension > storageExtension)
const DBConfig & getConfig() const
Definition database.h:122
ExtensionOption * getExtensionOption(std::string name) const
common::case_insensitive_map_t< std::unique_ptr< storage::StorageExtension > > & getStorageExtensions()
friend class EmbeddedShell
Definition database.h:82
KUZU_API ~Database()
Destructs the database object.
uint64_t getNextQueryID()
void addTableFunction(std::string name, std::vector< std::unique_ptr< function::Function > > functionSet)
friend class testing::BaseGraphTest
Definition database.h:86
KUZU_API Database(std::string_view databasePath, SystemConfig systemConfig=SystemConfig())
Creates a database object.
KUZU_API catalog::Catalog * getCatalog()
Definition database.h:118
KUZU_API void registerFileSystem(std::unique_ptr< common::FileSystem > fs)
Definition storage_driver.h:13
Definition transaction_context.h:32
std::unordered_map< std::string, T, CaseInsensitiveStringHashFunction, CaseInsensitiveStringEquality > case_insensitive_map_t
Definition case_insensitive_map.h:22
LogicalTypeID
Definition types.h:167
Definition array_utils.h:7
Definition db_config.h:53
Definition db_config.h:44
Stores runtime configuration for creating or opening a Database.
Definition database.h:43
bool readOnly
Definition database.h:72
uint64_t maxNumThreads
Definition database.h:70
uint64_t checkpointThreshold
Definition database.h:75
bool autoCheckpoint
Definition database.h:74
uint64_t bufferPoolSize
Definition database.h:69
SystemConfig(uint64_t bufferPoolSize=-1u, uint64_t maxNumThreads=0, bool enableCompression=true, bool readOnly=false, uint64_t maxDBSize=-1u, bool autoCheckpoint=true, uint64_t checkpointThreshold=16777216)
Creates a SystemConfig object.
uint64_t maxDBSize
Definition database.h:73
bool enableCompression
Definition database.h:71