feat: add SQLite schema and db.py for scan findings#14
Merged
ionfwsrijan merged 4 commits intoJun 1, 2026
Conversation
Contributor
Author
|
Hey @ionfwsrijan, u can review and merge the PR , if all are okay Thank you for all your help throughout the process (: |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces persistent SQLite storage for scan findings in the FastAPI backend by adding a database module, initializing schema creation on server startup, and documenting the schema.
Changes:
- Added
backend/app/db.pywith SQLite schema initialization (init_db) and a database connection helper (get_db) usingaiosqlite. - Initialized the database on API startup via a FastAPI startup hook in
backend/app/main.py. - Documented the
jobsandfindingstables inbackend/README.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| backend/app/db.py | Adds SQLite path, schema initialization, and DB connection helper. |
| backend/app/main.py | Calls init_db() on application startup. |
| backend/README.md | Documents the SQLite schema and where the DB file is created. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Owner
|
@khushboo-khatoon Failing checks |
Owner
|
@khushboo-khatoon LGTM. Great work. Merging this now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1
What this PR does
Adds persistent SQLite storage for scan findings. Creates
backend/app/db.pywithinit_db()andget_db()functions, initializes the database on server startup, and documents the schema inbackend/README.md.Type of change
ML tier (if applicable)
Changes
Backend
backend/app/db.pywithinit_db()andget_db()usingaiosqlite@app.on_event("startup")inmain.pyto callinit_db()on bootbackend/README.mdwith full schema documentationNew dependencies
aiosqlite— async SQLite driver for non-blocking DB access in FastAPIDatabase / schema changes
findings(id, job_id, rule_id, severity, category, file_path, line_number, cwe, scanner, message, created_at)jobs(job_id, project_name, scan_method, created_at)patchpilot.dbauto-created inbackend/on first server bootTesting
Started server locally —
patchpilot.dbwas created automatically inbackend/on first boot.Checklist
console.erroror unhandled Python exceptions introducedrequirements.txtupdated withaiosqliteAnything reviewers should focus on
db.pyimplementation — especiallyget_db()andinit_db()functions.