Connect Luzmo to a DuckDB HTTP server, add datasets, and override connection properties when you embed dashboards.
In this article
To connect to DuckDB, navigate to the Connections page, select New Connection, then select DuckDB from the New Connection modal. You are 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 limit access so that only Luzmo can reach your DuckDB instance, whitelist Luzmo's range of static IP addresses as described in Luzmo's IP addresses.
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 see Preparing your data for analytics.
When you generate an authorization token to grant a user access to your embedded dashboards, you can override the data source properties in the authorization request so different properties are used dynamically. Find out more about connection overrides.
When you use connection overrides, the schema of the tables in the override must match the schema of the original datasets. Otherwise queries can fail because of 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 useful in a multi-tenant setup where you keep a single generic DuckDB connection in Luzmo and override the host and password per end user at authorization time, so each customer sees 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] |