Skip to content

Commit 708c7eb

Browse files
fix: add system view fallback chain for Redshift schema discovery (#37)
On some Redshift clusters (data sharing, Lake Formation, Serverless), svv_tables returns empty results. Add auto-detection at init time with fallback chain: svv_tables -> svv_all_tables -> information_schema. - Probe each source with COUNT query, pick first with rows > 0 - Handle column name differences (table_schema vs schema_name) - Filter svv_all_tables by current_database() to avoid cross-DB noise - Add db_filter to _get_table_columns for cross-DB isolation - Extract _process_bulk_rows and _get_tables_bulk_information_schema to avoid state mutation in fallback (concurrency safe) - Skip caching empty results to prevent 24h dead cache - Normalize schema name to lowercase - Add 8 unit tests for detection chain and row processing Closes #37 Bump version to 0.2.0rc11.
1 parent 695a629 commit 708c7eb

5 files changed

Lines changed: 343 additions & 123 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "nlp2sql"
3-
version = "0.2.0rc10"
3+
version = "0.2.0rc11"
44
description = "Enterprise-ready Natural Language to SQL converter with multi-provider support. Built for production scale (1000+ tables) with Clean Architecture."
55
readme = "README.md"
66
license = {text = "MIT"}

src/nlp2sql/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from .schema.example_store import ExampleStore
2121
from .services.query_service import QueryGenerationService
2222

23-
__version__ = "0.2.0rc10"
23+
__version__ = "0.2.0rc11"
2424
__author__ = "Luis Carbonel"
2525
__email__ = "devhighlevel@gmail.com"
2626

0 commit comments

Comments
 (0)