---
title: "Execute SQL"
description: "Local-first visual environment for building and running AI workflows. Build agents visually, deploy anywhere, privacy by design."
canonical: https://docs.nodetool.ai/nodes/lib/sqlite/executesql
markdown: https://docs.nodetool.ai/nodes/lib/sqlite/executesql.md
product: NodeTool
source: https://github.com/nodetool-ai/nodetool/blob/main/docs/nodes/lib/sqlite/executesql.md
---

# Execute SQL

**Type:** `lib.sqlite.ExecuteSQL`

**Namespace:** `lib.sqlite`

## Description

Execute arbitrary SQL statements for advanced operations.
    sqlite, database, sql, execute, custom

    Use cases:
    - Complex queries with joins
    - Aggregate functions (COUNT, SUM, AVG)
    - Custom SQL operations

## Properties

| Property | Type | Description | Default |
|----------|------|-------------|---------|
| database_name | `str` | Name of the SQLite database file | `memory.db` |
| sql | `str` | SQL statement to execute | `SELECT * FROM flashcards` |
| parameters | `list[any]` | Parameters for parameterized queries (use ? in SQL) | `[]` |

## Outputs

| Output | Type | Description |
|--------|------|-------------|
| rows_affected | `int` |  |
| last_row_id | `int` |  |
| message | `str` |  |
| rows | `list[dict[str, any]]` |  |
| count | `int` |  |

## Related Nodes

Browse other nodes in the [lib.sqlite](./) namespace.
