Hydra brings the power of DuckDB analytics to your Postgres database. With pg_duckdb, SELECT queries are directly executed using DuckDB and returned to Postgres. These queries can access DuckDB features as well as read Postgres tables, views, and materialized views.

Try It Out

The easiest way to try out Hydra is using Docker.

docker compose with Drizzle Studio

git clone https://github.com/hydradatabase/actual_location # TODO
cd pg_duckdb
docker compose up

You can then access Drizzle Studio at https://local.drizzle.studio, or directly connect to Postgres on port 5432.

psql postgres://postgres:postgres@127.0.0.1:5432/postgres

For other ways to get started, see Install.

Setting up Postgres

To use pg_duckdb, you must install it into a specific Postgres database:

CREATE EXTENSION duckdb;

By default, DuckDB execution is not enabled. You must enable DuckDB execution by changing a setting:

SET duckdb.execution = true;

If you wish to enable execution permanently, you can do so at the system, database, or user level. For example:

-- enable everywhere
ALTER SYSTEM SET duckdb.execution = true;
-- enable for a specific database
ALTER DATABASE database_name SET duckdb.execution = true;
-- enable for a specific user
ALTER USER analytics SET duckdb.execution = true;