Overview
This node enables interaction with a Turso database by executing various SQL operations. It supports running custom queries, batch queries, and common CRUD (Create, Read, Update, Delete) operations on tables within the database. The "Describe Table" operation specifically retrieves schema information about a selected table, such as its columns and their types.
Typical use cases include:
- Retrieving metadata about a database table to understand its structure before performing data operations.
- Automating database schema inspections in workflows.
- Integrating Turso database schema details into other systems or reports.
For example, a user might want to fetch the column names and types of a table named users to dynamically generate forms or validate input data.
Properties
| Name | Meaning |
|---|---|
| Table Name | The name of the table to describe. This is a required field and must be selected from existing tables in the database. |
Output
The output JSON contains a columns field which is an array of objects representing the schema of the specified table. Each object typically includes details such as column name, type, and other metadata returned by the database's PRAGMA table_info command.
Example output structure:
{
"columns": [
{
"cid": 0,
"name": "id",
"type": "INTEGER",
"notnull": 1,
"dflt_value": null,
"pk": 1
},
{
"cid": 1,
"name": "username",
"type": "TEXT",
"notnull": 0,
"dflt_value": null,
"pk": 0
}
// ... more columns
]
}
No binary data output is produced by this operation.
Dependencies
- Requires a Turso database connection configured with:
- A valid database URL.
- An authentication token (API key or similar).
- The node uses the
@libsql/clientlibrary to communicate with the Turso database. - Proper credentials must be set up in n8n for the node to connect successfully.
Troubleshooting
Common issues:
- Missing or invalid database URL or authentication token will cause connection errors.
- Selecting a non-existent or empty table name will result in an error.
- Network or permission issues may prevent successful connection to the Turso database.
Error messages and resolutions:
"Database URL and auth token are required": Ensure that both the database URL and authentication token are correctly configured in the node credentials."Table name cannot be empty": Make sure to select a valid table name before executing the operation."Error in 'Describe Table': <message>": Indicates a problem executing the schema query; check database connectivity and permissions."Connection error: <message>. Please check your credentials and database URL.": Verify network access and credential correctness.
If the node is set to continue on failure, errors will be returned in the output JSON under an
errorproperty.