Skip to content

API Reference parrot.tools.databasequery.sources.sqlite

github-actions[bot] edited this page Nov 5, 2026 · 4 revisions

parrot.tools.databasequery.sources.sqlite

View source

SQLite database source for DatabaseToolkit.

Implements AbstractDatabaseSource for SQLite using the asyncdb sqlite driver. Uses PRAGMA table_info() and sqlite_master for metadata discovery (SQLite does not have information_schema). Inherits SQL validation from the base class via sqlglot_dialect = "sqlite".

Part of FEAT-062 — DatabaseToolkit.

Alias AbstractDatabaseSource

Re-exported from parrot.tools.databasequery.base.AbstractDatabaseSource.

Alias ColumnMeta

Re-exported from parrot.tools.databasequery.base.ColumnMeta.

Alias MetadataResult

Re-exported from parrot.tools.databasequery.base.MetadataResult.

Alias QueryResult

Re-exported from parrot.tools.databasequery.base.QueryResult.

Alias RowResult

Re-exported from parrot.tools.databasequery.base.RowResult.

Class SQLiteSource

SQLite database source.

Uses the asyncdb sqlite driver. Validates queries with the sqlite sqlglot dialect. Discovers schema via PRAGMA and sqlite_master.

Method SQLiteSource.get_default_credentials

Return default SQLite credentials from environment variables.

Reads SQLITE_DATABASE from navconfig (default: :memory:).

get_default_credentials() -> dict[str, Any]

Returns: dict[str, Any] — Dict with database key for the SQLite file path or :memory: for in-memory operation.

Method SQLiteSource.get_metadata

Discover SQLite schema via PRAGMA table_info() and sqlite_master.

get_metadata(credentials: dict[str, Any], tables: list[str] | None = None) -> MetadataResult

Parameter Type Default Description
credentials dict[str, Any] Connection credentials (database key for file path).
tables list[str] | None None Optional list of specific table names to inspect.

Returns: MetadataResult — MetadataResult with table and column metadata.

Method SQLiteSource.query

Execute a SQL query and return all results.

query(credentials: dict[str, Any], sql: str, params: dict[str, Any] | None = None) -> QueryResult

Parameter Type Default Description
credentials dict[str, Any] Connection credentials.
sql str SQL query string.
params dict[str, Any] | None None Optional query parameters.

Returns: QueryResult — QueryResult with rows and execution metadata.

Method SQLiteSource.query_row

Execute a SQL query and return the first row.

query_row(credentials: dict[str, Any], sql: str, params: dict[str, Any] | None = None) -> RowResult

Parameter Type Default Description
credentials dict[str, Any] Connection credentials.
sql str SQL query string.
params dict[str, Any] | None None Optional query parameters.

Returns: RowResult — RowResult with a single row or found=False.

Alias TableMeta

Re-exported from parrot.tools.databasequery.base.TableMeta.

Alias register_source

Re-exported from parrot.tools.databasequery.sources.register_source.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally