Skip to content

fix: make NL2SQLTool dialect-aware for SQLite and PostgreSQL#5332

Open
Krithi-murugesan wants to merge 1 commit intocrewAIInc:mainfrom
Krithi-murugesan:main
Open

fix: make NL2SQLTool dialect-aware for SQLite and PostgreSQL#5332
Krithi-murugesan wants to merge 1 commit intocrewAIInc:mainfrom
Krithi-murugesan:main

Conversation

@Krithi-murugesan
Copy link
Copy Markdown

What

Fixed dialect compatibility issues in the NL2SQLTool to support SQLite and PostgreSQL.

Why

The original tool used hardcoded PostgreSQL queries on system tables like information_schema.tables.
This caused runtime errors on SQLite, which doesn’t have those tables.

How

Replaced hardcoded SQL with SQLAlchemy's dialect-agnostic inspect module to dynamically discover tables and columns.
This approach works across supported databases without errors.

@Krithi-murugesan
Copy link
Copy Markdown
Author

Hi maintainers 👋

Adding some context for this PR:

What I tested

Validated NL2SQLTool with both SQLite and PostgreSQL
Verified table/column discovery using SQLAlchemy inspect
Confirmed removal of information_schema dependency (fixes SQLite errors)
Ran sample NL→SQL queries across both dialects to ensure consistent behavior

Why this matters

Fixes runtime failures for SQLite users
Removes dialect-specific assumptions → more robust + portable
Improves developer experience for local/testing setups

Happy to add more tests or refine further if needed. Thanks!

OSContribution - Dialect.docx

@Krithi-murugesan
Copy link
Copy Markdown
Author

Please apply the llm-generated label as this contribution was assisted by an LLM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant