Files
genai-toolbox/docs/en/resources/tools/sqlite-sql.md
Yuan 1bf6003eae docs: add note to tools (#608)
Co-authored-by: Averi Kitsch <akitsch@google.com>
2025-05-28 15:38:18 +00:00

1.9 KiB

title, type, weight, description
title type weight description
sqlite-sql docs 1 Execute SQL statements against a SQLite database.

About

A sqlite-sql tool executes SQL statements against a SQLite database. It's compatible with any of the following sources:

SQLite uses the ? placeholder for parameters in SQL statements. Parameters are bound in the order they are provided.

The statement field supports any valid SQLite SQL statement, including SELECT, INSERT, UPDATE, DELETE, CREATE/ALTER/DROP table statements, and other DDL statements.

Note: This tool uses parameterized queries to prevent SQL injections. Query parameters can be used as substitutes for arbitrary expressions. Parameters cannot be used as substitutes for identifiers, column names, table names, or other parts of the query.

Example

tools:
  search-users:
    kind: sqlite-sql
    source: my-sqlite-db
    description: Search users by name and age
    parameters:
      - name: name
        type: string
        description: The name to search for
      - name: min_age
        type: integer
        description: Minimum age
    statement: SELECT * FROM users WHERE name LIKE ? AND age >= ?

Reference

field type required description
kind string Yes Must be "sqlite-sql"
source string Yes Name of a SQLite source configuration
description string Yes Description of what the tool does
parameters array No List of parameters for the SQL statement
statement string Yes The SQL statement to execute