Package com.kuzudb
Class Database
java.lang.Object
com.kuzudb.Database
- All Implemented Interfaces:
AutoCloseable
The Database class is the main class of KuzuDB. It manages all database
components.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the database and release the underlying resources.
-
Constructor Details
-
Database
public Database()Creates a database object. The database will be created in memory with default settings. -
Database
Creates a database object.- Parameters:
databasePath
- : Database path. If the database does not already exist, it will be created.
-
Database
public Database(String databasePath, long bufferPoolSize, boolean enableCompression, boolean readOnly, long maxDBSize, boolean autoCheckpoint, long checkpointThreshold) Creates a database object.- Parameters:
databasePath
- : Database path. If the path is empty, or equal to `:memory:`, the database will be created in memory.bufferPoolSize
- : Max size of the buffer pool in bytes.enableCompression
- : Enable compression in storage.readOnly
- : Open the database in READ_ONLY mode.maxDBSize
- : The maximum size of the database in bytes. Note that this is introduced temporarily for now to get around with the default 8TB mmap address space limit some environment.autoCheckpoint
- If true, the database will automatically checkpoint when the size of the WAL file exceeds the checkpoint threshold.checkpointThreshold
- The threshold of the WAL file size in bytes. When the size of the WAL file exceeds this threshold, the database will checkpoint if autoCheckpoint is true.
-
-
Method Details
-
close
Close the database and release the underlying resources. This method is invoked automatically on objects managed by the try-with-resources statement.- Specified by:
close
in interfaceAutoCloseable
- Throws:
ObjectRefDestroyedException
- If the database instance has been destroyed.
-