Companion

Functions

Link copied to clipboard
fun convertFromSQLiteToDuckDb(pathToSQLiteFile: Path, dbName: String, dbDirectory: Path = KSL.dbDir, deleteIfExists: Boolean = true): DuckDb

Facilitates the creation of a database backed by DuckDb. The database will be loaded based on the SQLite database specified via the path.

Link copied to clipboard
open override fun createDatabase(dbName: String, dbDir: Path): Database

If the database already exists it is deleted

Link copied to clipboard
open override fun createDataSource(pathToDb: Path): DuckDbDataSource
Link copied to clipboard
open override fun deleteDatabase(pathToDb: Path)

Deletes a DuckDb database Strategy:

Link copied to clipboard
fun importFromLoadableCSV(exportedDbDir: Path, dbName: String, dbDirectory: Path = KSL.dbDir, deleteIfExists: Boolean = true): DuckDb

Facilitates the creation of a database backed by DuckDb. The database will be loaded based on the load scripts found in the exported database directory

Link copied to clipboard
fun importFromLoadableParquetFiles(exportedDbDir: Path, dbName: String, dbDirectory: Path = KSL.dbDir, deleteIfExists: Boolean = true): DuckDb

Facilitates the creation of a database backed by DuckDb. The database will be loaded based on the load scripts found in the exported database directory containing the parquet files.

Link copied to clipboard
open override fun isDatabase(path: Path): Boolean

Checks if a file is a valid DuckDb database Strategy:

open fun isDatabase(file: File): Boolean

A convenience method for those that use File instead of Path. Calls isEmbeddedDerbyDatabase(file.toPath())

Link copied to clipboard
open override fun openDatabase(pathToDb: Path): Database

The database file must already exist at the path

open fun openDatabase(fileName: String): Database

The database file must already exist within the KSLDatabase.dbDir directory It is opened for reading and writing.