How to configure your DuckDB database
DuckDB is a free and open-source SQL database that supports a wide range of data types and operations. It is designed to be fast, efficient, and easy to use, making it a popular choice for data analysis and manipulation.
In Latitude, DuckDB sources also has additional features like materialization, which allows you to store the results of your queries in a file so they can be used in other queries.
Run the following command to install the connector from the root of your project:
The sources files must be inside the queries/
folder.
To know how the source hierarchy works, please, visit How to configure sources.
To configure the connection with your DuckDB database follow these steps:
Create the source configuration file
Create a new .yaml
file in the queries
folder. There can only be one source configuration file per directory, so if you already have another source file in your root queries
folder, you will need to create a new subfolder for this source.
Add the duckdb type in the source configuration file
(optional) Add more details to connect to a remote duckdb database
Done!
To test the connection you can:
.sql
in the queries
directory that points to a table of your new connection in the FROM
clause. See the section SQL Syntax Basics to learn more.latitude run query_file_name
where query_file_name
is the name of your .sql
file. This will display the results in your terminal. See the section Running queries to learn more about how to query your data.Materialization allows you to store the results from any query to your Latitude server. Then, your DuckDB queries can access the materialized data instead of the original database. Read more about Materialized queries for more information.