Database

List, create, and query workspace databases

da

Databases group the tables in your workspace. Every table belongs to exactly one database, and table names are unique within their database. The Database block lets workflows discover databases and their tables, create databases on the fly, and run read-only queries with a SQL-like syntax.

Why Use the Database Block?

  • Organize tables: Group related tables together (e.g., a CRM database holding leads, accounts, and contacts)
  • Discover from workflows: List databases and tables without hardcoding IDs
  • Query without filter objects: Run read-only SELECT queries instead of building MongoDB-style filters

The Default database: every workspace has a fallback database — its oldest active one, named Default unless renamed. Tables created before databases existed were moved into it, and API or tool calls that omit a database target it.

For creating and managing databases from the UI, see the Databases guide. For row-level reads and writes, use the Table block.

Usage Instructions

Work with workspace databases as table containers. List databases, create databases, list tables inside a database, or run read-only database queries.

Query Syntax

The Query Database operation accepts a single read-only statement:

SELECT * FROM table_name
  [WHERE condition [AND condition ...]]
  [ORDER BY column [asc|desc]]
  [LIMIT n] [OFFSET n]
ElementSupported
ProjectionSELECT * only — no column lists
TablesOne table per query — no joins
WHERE operators=, !=, <>, >, >=, <, <=, LIKE, ILIKE, CONTAINS
Combining conditionsAND only — no OR
ORDER BYA single column, asc or desc
LiteralsSingle- or double-quoted strings, numbers, true, false, null

Examples:

SELECT * FROM leads WHERE status = "active" LIMIT 100
SELECT * FROM orders WHERE total >= 100 ORDER BY created_at DESC LIMIT 50

Queries are strictly read-only — invalid or unsupported syntax returns a parse error. Use the Table block to insert, update, or delete rows.

Tools

table_list_databases

List table databases in the workspace with table counts

Input

No parameters — the workspace comes from the execution context.

Output

ParameterTypeDescription
successbooleanWhether operation succeeded
databasesarrayList of databases
totalCountnumberTotal number of databases

table_create_database

Create a database for grouping workspace tables

Input

ParameterTypeRequiredDescription
namestringYesDatabase name
descriptionstringNoOptional database description
colorstringNoOptional hex color like #6B7280

Output

ParameterTypeDescription
successbooleanWhether database was created
databasejsonCreated database metadata
messagestringStatus message

table_list

List all tables in the workspace, optionally filtered to a single database

Input

ParameterTypeRequiredDescription
databaseIdstringNoDatabase ID to list tables from. When omitted, lists all tables.

Output

ParameterTypeDescription
successbooleanWhether operation succeeded
tablesarrayList of tables
totalCountnumberTotal number of tables

table_query_database

Run a read-only SELECT * query against one table in a database

Input

ParameterTypeRequiredDescription
databaseIdstringYesDatabase ID
querystringYesRead-only query, for example: SELECT * FROM table_name WHERE status = "active" LIMIT 100

Output

ParameterTypeDescription
successbooleanWhether query succeeded
tablejsonQueried table metadata
rowsarrayQuery result rows
rowCountnumberNumber of rows returned
totalCountnumberTotal rows matching filter
limitnumberLimit used in query
offsetnumberOffset used in query

Notes

  • Category: blocks
  • Type: database
  • Up to 50 databases per workspace; database names are limited to 50 characters
  • Viewing databases and tables requires workspace access; creating a database requires Write or Admin permission
  • table_query_database is read-only — use the Table block for inserts, updates, upserts, and deletes
  • Renaming and deleting databases is done from the Databases UI, not from this block

On this page