SQLite Node
AI-generatedSummary
Execute a custom SQL query on a local SQLite database file specified by its path, supporting query types CREATE, DELETE, INSERT, SELECT, and UPDATE with parameterized arguments.
Inputs
- Database Path (required) — Path to the SQLite database file on the local filesystem.
- Query Type (required) — Type of the SQL query to execute; can be AUTO (auto-detect), CREATE, DELETE, INSERT, SELECT, or UPDATE.
- Query (required) — The raw SQL query string to run on the database; supports parameter syntax with @ or $ placeholders.
- Args — JSON object containing parameter values to bind into the query.
- Spread Result — If true and query type is SELECT, spread each result row into separate output items.
- Additional Options — Options to customize database bindings, including using default or custom native better-sqlite3 bindings.
Output shape
a list of items
For SELECT queries, returns query results as item JSON objects; if "Spread Result" is enabled, each row is a separate item. For INSERT, UPDATE, DELETE queries, returns an object with changes count and last inserted id. For CREATE or other queries, returns a message string. Supports batched input items executing queries independently per item with paired item references.
Examples
Example 1: Run a parameterized SELECT query and spread results
Set Database Path to /path/to/db.sqlite, Query Type to SELECT, Query to 'SELECT * FROM users WHERE age > @age', Args to '{"age":30}', Spread Result to true
Example 2: Insert a new record
Set Database Path, Query Type to INSERT, Query to an insert SQL statement with placeholders, and provide values in Args as JSON.