DEDUPED Hot AI repos, turned into use cases Get the Monday 5

How to use Schemagate: what you can do with it

schemagate is a Python library and local studio page that filters a text-to-SQL schema by the caller's grants, so restricted tables never reach the LLM prompt.

Trended earlier

View repo on GitHub

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer

5 use cases

  • See which tables a caller is blocked from

    Compare the same question for two callers and confirm restricted tables leave the prompt, with no database needed.

    View prompt
    Install schemagate with pip, then run `schemagate demo "salary by employee"` and again with `--principal okta:hr --role payroll`. Report which tables appear in each result and confirm hr_compensation is absent for the first caller and present for the second.
  • Select tables for one role on your own database

    Run schema selection against a real Postgres database as a named principal and get the prompt fragment for that role.

    View prompt
    Install schemagate with the postgres extra, then run `schemagate select "revenue by month" --url <postgres-url> --principal okta:jdoe --role finance`. Return the selected table names and state whether any table is one the finance role should not read.
  • Gate the schema inside a SQL agent's Python code

    Load a catalog, restrict a table to one role, and pass only the selected schema fragment into your agent prompt.

    View prompt
    Using the schemagate Python API, bootstrap a Catalog from <database-url>, restrict the table <restricted-table> to the role <role>, and select tables for the question <question> for a Principal with that role. Return sel.prompt_fragment() and confirm the restricted table name does not appear in it.
  • Measure how many prompt tokens selection saves

    Compare the DDL a model gets with and without Schemagate for one question on the bundled schema.

    View prompt
    Install schemagate, then run `schemagate demo "late shipments by carrier" --prompt` and `schemagate demo "which customers owe us money"`. Report the number of selected objects and the approximate prompt token count for each, and state the total object count of the bundled schema.
  • Tune table hints in the Studio page

    Open the local Studio page, try questions, and add hints to steer selection toward the right tables.

    View prompt
    Run `schemagate studio --url <postgres-url>`, ask the question <question>, add a hint to the table <table-name>, and re-run the question. Report which tables were selected before and after the hint and whether the target table now appears.

Quick start with Schemagate

  1. Check you have what it needs: Python and pip installed; For your own database: a reachable Postgres, Oracle, MySQL or SQL Server URL, and the matching schemagate extra; Optional: a model key only if you want generated answers or AI descriptions.
  2. Open ashishsinha1602/schemagate on GitHub and read the README and license.
  3. Run pip install schemagate to install the library.
  4. Run schemagate demo "salary by employee" and confirm hr_compensation is absent from the result.
  5. Run schemagate demo "salary by employee" --principal okta:hr --role payroll and confirm the table now appears first.
  6. Run schemagate demo "salary by employee" --prompt if you want to read the DDL the model would receive. (inferred, check the README)

These steps come from our top use case, See which tables a caller is blocked from, which also has a copy-paste agent prompt.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for ashishsinha1602/schemagate

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Schemagate alternatives · Best AI repos for Data and analytics

About this repo

Requirements

  • Python and pip installed
  • For your own database: a reachable Postgres, Oracle, MySQL or SQL Server URL, and the matching schemagate extra
  • Optional: a model key only if you want generated answers or AI descriptions

Add this badge to your README

Maintain Schemagate? Show readers where to find these use cases. Use cases on Deduped

Markdown

[![Use cases on Deduped](https://dedupedai.com/badge/ashishsinha1602/schemagate.svg)](https://dedupedai.com/use-cases/ashishsinha1602-schemagate/?utm_source=github&utm_medium=badge&utm_campaign=ashishsinha1602-schemagate)

HTML

<a href="https://dedupedai.com/use-cases/ashishsinha1602-schemagate/?utm_source=github&amp;utm_medium=badge&amp;utm_campaign=ashishsinha1602-schemagate"><img src="https://dedupedai.com/badge/ashishsinha1602/schemagate.svg" alt="Use cases on Deduped" height="20"></a>

A static image, no tracking script. About the badge

Questions about Schemagate

What is Schemagate?

schemagate is a Python library and local studio page that filters a text-to-SQL schema by the caller's grants, so restricted tables never reach the LLM prompt. It is an open-source project on GitHub: https://github.com/ashishsinha1602/schemagate.

Who is Schemagate for?

Data engineers and developers building text-to-SQL agents who need the model to see only the tables each user is allowed to read.

What can I do with Schemagate?

5 use cases so far, for example: See which tables a caller is blocked from; Select tables for one role on your own database; Gate the schema inside a SQL agent's Python code. Each has steps and a copy-paste agent prompt.

What do I need to run Schemagate?

Python and pip installed; For your own database: a reachable Postgres, Oracle, MySQL or SQL Server URL, and the matching schemagate extra; Optional: a model key only if you want generated answers or AI descriptions.

What are alternatives to Schemagate?

Other hot AI repos in Data and analytics: DSH Usage, Asobeast, Coreclaw API Directory, Quail, Nexus Pilot.

Is Schemagate safe to run?

Deduped does not own, audit or vouch for it. Read the README and license, run it on your own systems first and review every command before you run it.