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
- Install Dbeaver Community
- Open DBeaver and in the top left hand corner select the new connection button
- In the new window search for
DuckDB
, select and clicknext
- To connect to an in-memory version of DuckDB you will need to add
:memory:
to the path input field
- Click ok
- You will now see a new database on the left hand side (Database Navigator) called
DuckDB
- You can now run queries against this database by:
- Right click the database
- Select
SQL Editor
- select
New SQL Script
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;
- In the
connect to database window
selectcreate
. - Now in the new window add
SQL101.duckdb
to the save as field and select the correct folder to save this in.
- Select finish
- You will now see a new database on the left hand side (Database Navigator) called
SQL101.duckdb
- 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.