Skip to main content

Configure DuckDB

DuckDB is an open source database management system which supports either persisting databases or an in-memory mode. This setup page will demonstrate how to configure either of these options.

In-Memory Mode

  1. Install Dbeaver Community
  2. Open DBeaver and in the top left hand corner select the new connection button
image

  1. In the new window search for DuckDB, select and click next

image

  1. To connect to an in-memory version of DuckDB you will need to add :memory: to the path input field

image

  1. Click ok
  2. You will now see a new database on the left hand side (Database Navigator) called DuckDB

image

  1. You can now run queries against this database by:
  2. Right click the database
  3. Select SQL Editor
  4. select New SQL Script

image

Persistent Database

To use a persisted version of DuckDB please follow the same steps from the in-memory section however, at step 4 please see below;

  1. In the connect to database window select create.
  2. Now in the new window add SQL101.duckdb to the save as field and select the correct folder to save this in.

image

  1. Select finish
  2. You will now see a new database on the left hand side (Database Navigator) called SQL101.duckdb
  3. Please folow the remaining steps from the in-memory section

Creating the Database Schema

Now that the connections have been established you can create the database schema found here. To run this you will need to select all of the code and execute as DuckDB requires all the statements are run in a single trasnaction.

Notes

  • If you are using the in-memory mode you will need to re-create the database everytime you close the connect and re-establish.
  • With the persisted database after creating the schema you will need to run Use SQL101 first to be able to run the sql statements.