Install
Run the following command to install the connector from the root of your project:How to configure sources
The sources files must be inside thequeries/
folder.
To know how the source hierarchy works, please, visit How to configure sources.
Configuration
To configure the connection with your DuckDB database follow these steps:1
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.2
Add the duckdb type in the source configuration file
queries/duckdb/source.yaml
3
(optional) Add more details to connect to a remote duckdb database
queries/duckdb/source.yaml
4
Done!
Attributes
- URL → (Optional) This refers to the location of the DuckDB database file. DuckDB is an embedded database, so instead of connecting over a network, you specify the path to the database file on your local system or a shared filesystem. This path tells your application exactly where to find the DuckDB database you want to work with. In its absence, duckDB starts a new database in memory that will not get persisted once the connection is closed.
Testing the connection
To test the connection you can:- Create a query
.sql
in thequeries
directory that points to a table of your new connection in theFROM
clause. See the section SQL Syntax Basics to learn more. - Use the command line to run
latitude run query_file_name
wherequery_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.