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 use CSV files directly within a Latitude project, we use the DuckDB adapter. Make sure to configure the connection through DuckDB by following these steps:1
Create the source `.yaml` file within the `queries` folder if you haven't already
/queries/source.yml2
Add the following code for your DuckDB connection
3
Done, now you can test your connection
Add your files
Simply add your CSV files anywhere in thequeries directory. You can also create subdirectories to organize your files.
Test connection
To test the connection you can:- Create a query
.sqlin thequeriesdirectory that points to the CSV file in theFROMclause using theread_csv_auto()DuckDB function. Here’s an example:
- Use the command line to run
latitude run query_file_namewherequery_file_nameis the name of your.sqlfile. This will display the results in your terminal. See the section Running queries to learn more about how to query your data.