Motherduck
Using Hydra Postgres, you can leverage MotherDuck without leaving Hydra.
In addition to a generous free tier, MotherDuck has a free trial where you can get started for 30 days without a credit card. To get started, sign up for MotherDuck. Next, you’ll need to generate and retrieve an access token for authentication.
To make Hydra work with MotherDuck, retrieve your motherduck_token
and open a support ticket with Hydra. We will connect MotherDuck to your Hydra Postgres database.
Create a MotherDuck access token
- Go to the MotherDuck UI
- In top left click on organization name and then
Settings
- Click
+ Create token
- Specify a name for the token that you’ll recognize (like “DuckDB CLI on my laptop”)
- Choose whether you want the token to expire and then click on
Create token
- Copy the access token token to your clipboard by clicking on the copy icon
Once you have an access token, contact us and we’ll set up Motherduck for you. Please include for which project and Postgres database you would like Motherduck enabled.
Using MotherDuck
Now within your Hydra Postgres database, you can start querying MotherDuck databases or shares. The below query uses a sample_data
share database accessible by all MotherDuck users.
You can join your data in MotherDuck with your live data in Hydra Postgres, and you can also easily copy data from one to the other.
For instance, if you create a table by using the USING duckdb
keyword it will be created in MotherDuck, and otherwise it will be in Postgres.
Let’s take the same above query using MotherDuck but now creating a Postgres table :
If we display the existing tables in PostgreSQL, we’ll see this one stored as PostgreSQL table (Access method
is heap
).
Now, we can also copy this Postgres table to MotherDuck using: