This article covers:
To make a connection to DuckDB, navigate to the Connections page, select New Connection, then select DuckDB from the New Connection modal. You'll be asked to provide a host, port, and password:
X-API-Key HTTP header with every request. Your HTTP endpoint should use this value to identify the caller and return the appropriate client-specific data.To ensure that only the Luzmo application can access your DuckDB instance, it is highly recommended to whitelist Luzmo's range of static IP addresses as described here.
Please refer to the examples in our developer documentation to find out how to create a connection to DuckDB via our API.
{{metadata.<parameter name>|<default value>}}. Find out more about parameterized SQL datasets.Also make sure to check out this article on Preparing your data for analytics.
When generating an authorization token to grant a user access to your embedded dashboards, it is possible to override the data source properties in the authorization request to dynamically use different properties. Find out more about connection overrides.
When doing connection overrides, it's important that the schema of the tables in the override conforms to the same schema as the original datasets to avoid query failures due to schema mismatches.
The fields available for overriding a DuckDB connection are as follows:
X-API-Key header, used by your endpoint to serve client-specific data.This is particularly useful in a multi-tenant setup where you maintain a single generic DuckDB connection in Luzmo and override the host and password per end user at authorization time, allowing each customer to see only their own data from their DuckDB instance.
Example of connection overrides in an authorization request:
{
"type": "embed",
"username": "< a unique and immutable identifier for your user >",
"name": "< user name >",
"email": "< user email >",
"suborganization": "< a suborganization name >",
"access": {
"collections": [
{
"id": "<collection_id>",
"inheritRights": "use"
}
]
},
"account_overrides": {
"<duckdb_generic_connection_id>": {
"host": "<tenant_specific_duckdb_host_url>",
"port": "<optional_port_override>",
"password": "<client_specific_api_key>"
}
}
}
| Data type in DuckDB | Data type in Luzmo |
|---|---|
| TINYINT | numeric |
| TINYINT[] | array[numeric] |
| SMALLINT | numeric |
| SMALLINT[] | array[numeric] |
| INTEGER | numeric |
| INTEGER[] | array[numeric] |
| BIGINT | numeric |
| BIGINT[] | array[numeric] |
| HUGEINT | numeric |
| HUGEINT[] | array[numeric] |
| UTINYINT[] | array[numeric] |
| USMALLINT[] | array[numeric] |
| UINTEGER[] | array[numeric] |
| UBIGINT[] | array[numeric] |
| FLOAT | numeric |
| FLOAT[] | array[numeric] |
| DOUBLE | numeric |
| DOUBLE[] | array[numeric] |
| REAL | numeric |
| REAL[] | array[numeric] |
| NUMERIC | numeric |
| NUMERIC[] | array[numeric] |
| DECIMAL | numeric |
| DECIMAL[] | array[numeric] |
| VARCHAR | hierarchy |
| VARCHAR[] | array[hierarchy] |
| BOOL | hierarchy |
| BOOLEAN | hierarchy |
| BOOLEAN[] | array[hierarchy] |
| INTERVAL | hierarchy |
| INTERVAL[] | array[hierarchy] |
| UUID | hierarchy |
| UUID[] | array[hierarchy] |
| JSON | hierarchy |
| JSON[] | array[hierarchy] |
| BLOB | hierarchy |
| BLOB[] | array[hierarchy] |
| DATE | datetime |
| DATE[] | array[datetime] |
| TIME | datetime |
| TIME[] | array[datetime] |
| TIMESTAMP | datetime |
| TIMESTAMP[] | array[datetime] |
| GEOMETRY | spatial |
| GEOMETRY[] | array[spatial] |