Skip to main content

DuckDB (files)

We support files connection via DuckDB. To add a connection, click on the DuckDB option in Connect a data source section. connect

info
Supported File Formats:
  • CSV Files
  • JSON Files
  • Parquet Files
Supported Data Types:
  • BIGINT
  • BIT
  • BLOB
  • BOOLEAN
  • DATE
  • DECIMAL
  • DOUBLE
  • INTEGER
  • REAL
  • SMALLINT
  • TIMESTAMP
  • VARCHAR
  • ARRAY
    • BOOLEAN
    • INTEGER
    • DOUBLE
    • DECIMAL
    • VARCHAR
    • TIMESTAMP
    • DATE

Connect

Fill in the connection settings: duckdb

Display name

The display name for the database in the Wren AI interface.

Initial SQL Statements

The first step of connecting files is to load your data into DuckDB. DuckDB provides several data ingestion statements that allow you to fill up the database. Please refer to DuckDB documentations for methods of loading data from different file types.

Here are some examples:

CREATE TABLE new_tbl AS SELECT * FROM read_csv('input.csv', header = true);
info

You can read files from either a local path or a cloud storage URL (such as AWS S3).

Configuration options

DuckDB has a number of configuration options that can be used to change the behavior of the system. You can set the configurations in this section if needed or just leave blank to use default configurations. When filling in the configurations, please set each configuration name and value as a pair. Please refer to DuckDB documentations for details of configuration options.

Extensions

DuckDB has a flexible extension mechanism that allows for dynamically loading extensions. Built-In extensions and autoloadable extensions will be automatically loaded. You can add other extensions by filling in the extension names if needed. Please refer to DuckDB documentations for list of official extensions

Click Next to start connection and go to the next step.

Select Tables

All tables of your connected files will be listed in this step. Select which tables you want to use in Wren AI. Each selected table will be created as a data model. See the Modeling documentations to learn more about what is data models. select_table

Define relationships

Define the relationships among selected tables in this step. You can add relationships by clicking the Add relationships button on the table blocks. relationship

Define following properties in a relationship:

  • From: Select the left side table and column of this relationship.
  • To: Select the right side table and column of this relationship.
  • Relationship Type: Select the type of relationship. add_relationship

Find more information about relationship in Modeling - Working with Relationships

You can also skip this step and finish connection.