Add database connection utility#1
Open
rachel11026725 with Copilot wants to merge 3 commits into
Open
Conversation
Reviewed By: bigfootjon Differential Revision: D32665161 fbshipit-source-id: b3854dc4b5cadbcf66a66765ba44b15a107f5a56
Agent-Logs-Url: https://github.com/rachel11026725/.github/sessions/bc7843d4-0c6c-4fa5-a1c2-03aa5d61fc7b Co-authored-by: rachel11026725 <73807073+rachel11026725@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add functionality to connect to database
Add database connection utility
Apr 11, 2026
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.
Adds a minimal Python database connection utility to address the "connect to database" request.
Changes
db_connect.py—get_connection(db_url=None)/close_connection(conn)APIDB_PATHenv var (no extra deps)requirements.txt— commented-out optional drivers (SQLAlchemy, psycopg2, mysqlclient)README.md— usage docs for both SQLite and SQLAlchemy-backed databases.gitignore— excludes*.dbfiles and Python cacheUsage
DB_PATHenv var overrides the default SQLite path (database.db).