Policy.from_database(): read tables and columns from a live database

Open
#28 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
mysql, postgresql, python, sqlalchemy, sqlite
Domain
databases

Research direction

Start in src/sqlguardllm/introspect.py and tests/test_introspect.py, and check pyproject.toml for how the db extra is declared. Read #5 first, since this issue depends on it, and skim docs/DESIGN.md for how Policy builds tables and schema. Done when Policy.from_database honors include/exclude, passes other options through, has a passing SQLite test in CI, and the PostgreSQL, MySQL and SQL Server URL forms are documented.

Written by the indexing model from the issue text.

Description

area:core size:s type:feature
Goal

Build an exact schema without writing it by hand.

Acceptance criteria
  • Policy.from_database(url, include=[...], exclude=[...], **options) using the SQLAlchemy inspector, in the optional extra sqlguardllm[db]
  • Fills tables and schema; other options are passed through
  • Tested against SQLite in CI; documented for PostgreSQL, MySQL and SQL Server URLs
Relevant files
  • src/sqlguardllm/introspect.py
  • tests/test_introspect.py
  • pyproject.toml
Size

S (up to half a day)

Notes
Dominant language
Python
Stars
0
Forks
0
Avg merge
1m
Merged PRs (30d)
2

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jmmana/sqlguardllm

All issues in jmmana/sqlguardllm

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.