ashishsinha1602 / schemagate
Text-to-SQL access control: schema selection that gives the LLM only the tables the caller is allowed to read. Row-level-security-aware table pruning for LangChain, MCP and any SQL agent. Postgres, Oracle, MySQL, SQL Server. 75% fewer prompt tokens.
Why this job: works in the areas we cover, but does not say which job it does


What it does
Most text-to-SQL prompts carry the whole schema, and on a big database that is most of the prompt, on every question. schemagate sends the model only the tables the question needs: 91.1% fewer schema tokens (median) on databases with 50+ tables (benchmark). It filters by the caller's grants first, so restricted tables are absent from the prompt rather than ranked low. Works with LangChain, LlamaIndex, MCP, or any SQL agent, on Postgres, Oracle, MySQL, SQL Server and SQLite.
Get started
pip install schemagate- Maintenance
- Active
- Last commit 2 days ago
- Stars
- 135
- +4 this week
- Licence
- Apache-2.0
- Allows business use
- Downloads for
- None listed
- No release files
- Latest version
- v1.18.0
- Released yesterday
- Built with
- Python
- 78% of the code
Is it looked after?
- Contributors
- 3
- Last 90 days
- Issues
- 100% closed
- 0 still open
- Pull requests
- 207 merged
- 2 waiting
- Releases
- 87
- 30+ in the last year
More: languages, topics and project record
Languages
- Python 78%
- HTML 20%
- Shell 1%
- HCL 1%
Topics
- access-control
- ai-agents
- data-engineering
- database
- langchain
- llm
- mcp
- mcp-server
- mysql
- nl2sql
- oracle
- postgresql
Project record
- JobOther AI tools
- StatusListed
- Commits433
- Forks4
- Watching1
- Stars in 28 days+81
- CreatedSep 6, 2026
- First seen by usNov 7, 2026
- CheckedNov 9, 2026
