import { DuckDBClass } from "../addon-bindings"; import { IDuckDBConfig, AccessMode, OrderType, OrderByNullType } from "../addon-types"; /** * The DuckDB class represents a DuckDB database instance. * @public */ export declare class DuckDB { /** * Returns the current version of the node-duckdb package (from package.json) * * @remarks * Useful for logging/debugging * * @public */ static getBindingsVersion(): Promise; private duckdb; /** * Represents a native instance of DuckDB. * @param config - optional configuration object of type {@link IDuckDBConfig | IDuckDBConfig}. * * * @example * Initializing a duckdb database in memory: * ```ts * import { DuckDB } from "node-duckdb"; * const db = new DuckDB(); * ``` * * @example * Initializing a duckdb database from file: * ```ts * import { DuckDB } from "node-duckdb"; * const db = new DuckDB({ path: join(__dirname, "./mydb") }); * ``` * * @example * Initializing a duckdb database from file and setting some additional options: * ```ts * import { DuckDB, OrderType } from "node-duckdb"; * const db = new DuckDB({ path: join(__dirname, "./mydb"), options: { defaultOrderType: OrderType.Descending, temporaryDirectory: false } }); * ``` * * @public */ constructor(config?: IDuckDBConfig); /** * Closes the underlying duckdb database, frees associated memory and renders it unusuable. * @remarks * Even though GC will automatically destroy the Database object at some point, DuckDB data is stored in the native address space, not the V8 heap, meaning you can easily have a Node.js process taking gigabytes of memory (more than the default heap size for Node.js) with V8 not triggering GC. So, definitely think about manually calling `close()`. * @public */ close(): void; /** * Returns underlying binding instance. * @internal */ get db(): DuckDBClass; /** * Returns true if the underlying database has been closed, false otherwise. * @public */ get isClosed(): boolean; /** * Returns the {@link AccessMode | access mode} used by the database. * @public */ get accessMode(): AccessMode; /** * Returns the checkpoint write ahead log size used by the database. * @public */ get checkPointWALSize(): number; /** * Returns the maximum memory limit for the database. * @public */ get maximumMemory(): number; /** * Returns true if the database uses a temporary directory for storing data that does not fit into memory, false otherwise. * @public */ get useTemporaryDirectory(): boolean; /** * Returns the temporary directory location for the database. * @public */ get temporaryDirectory(): string; /** * Returns the collation used by the database. * @public */ get collation(): string; /** * Returns the default {@link OrderType | sort order}. * @public */ get defaultOrderType(): OrderType; /** * Returns the default {@link OrderByNullType | sort order for null values}. * @public */ get defaultNullOrder(): OrderByNullType; } //# sourceMappingURL=duckdb.d.ts.map