Package com.kuzudb

Class Database

java.lang.Object
com.kuzudb.Database
All Implemented Interfaces:
AutoCloseable

public class Database extends Object implements AutoCloseable
The Database class is the main class of KuzuDB. It manages all database components.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a database object.
    Database(String databasePath)
    Creates a database object.
    Database(String databasePath, long bufferPoolSize, boolean enableCompression, boolean readOnly, long maxDBSize, boolean autoCheckpoint, long checkpointThreshold)
    Creates a database object.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Close the database and release the underlying resources.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Database

      public Database()
      Creates a database object. The database will be created in memory with default settings.
    • Database

      public Database(String databasePath)
      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