DuckDB
Run analytical SQL queries with embedded DuckDB.
Connect
Auth type: No credentials (none). Nothing to connect: the actions run without credentials.
- From your agent: integrations {action: "connect", piece, credentials, env} stores the credentials for dev, prod or all. Answers name the fields, never the values.
- Or set the integration's project secrets with the secrets tool (SLACK_BOT_TOKEN, DISCORD_WEBHOOK_URL, TELEGRAM_BOT_TOKEN, TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN …): a call uses the connection, else those secrets. integrations {action: "catalog", piece} lists which ones work.
- Try one action now with integrations {action: "call", piece, piece_action, input}. It really sends.
Call it from a workflow
step.ctx.integrations.invoke("duckdb", action, input) resolves with the provider's answer and rejects when DuckDB isn't connected or refuses. Wrap it in step.run so a retry sends once. See step.ctx. Its actions run through the integration runner, which the server's operator turns on: integrations {action: "catalog", piece: "duckdb"} says whether yours can call it.
// workflows/notify.ts: call DuckDB when a booking is confirmed
import { on } from "@appbricx/workflows";
export const tellDuckdb = on.transition("booking", "status", "confirmed", async (_event, step) => {
// Recorded once: a retry doesn't send it twice. Rejects when DuckDB isn't connected.
const output = await step.run("DuckDB", () =>
step.ctx.integrations.invoke("duckdb", "createAndQueryDB", {
"tables": [],
"query": "<query>"
}),
);
step.ctx.log("DuckDB answered", output);
});{
"name": "integrations",
"arguments": {
"project_id": "<project-id>",
"action": "call",
"piece": "duckdb",
"piece_action": "createAndQueryDB",
"input": {
"tables": [],
"query": "<query>"
},
"env": "dev"
}
}curl -X POST "$APP_ORIGIN/__appbricx/connector-proxy/duckdb/createAndQueryDB" \
-H "Authorization: Bearer $APP_KEY" \
-H "content-type: application/json" \
-d '{"props":{"tables":[],"query":"<query>"}}'Actions
createAndQueryDB
Create and Query DB. Create DB from data and run query
| Input | Type | Description |
|---|---|---|
tablesrequired | array | List of tables to create in the database |
queryrequired | text | Please use $1, $2, etc. for parameterized queries to avoid SQL injection. |
argsoptional | array | Arguments to be used in the query |
Details
- Id
duckdb- Category
- Data and storage
- Tags
- database, sql, analytics, embedded, olap
- Package
@activepieces/piece-duckdb@0.0.5- Runs
- Through the integration runner