This PR changes the SQLite connection in the main.py file to point to the site.db file in the working directory. Currently, the connection string is set to sqlite:///site.db, which assumes that the database file is located in the same directory as the main.py file. However, we want to change the location of the database to the working directory. To achieve this, the code now uses the os module to get the path of the working directory and appends site.db to it.
Summary of Changes
Imported the os module at the top of the main.py file, if it was not already imported.
Replaced the line app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///site.db" with app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///" + os.path.join(os.getcwd(), "site.db").
Fixes #41.
To checkout this PR branch, run the following command in your terminal:
git checkout sweep/change-sqlite-connection_1
π Latest improvements to Sweep:
Use Sweep Map to break large issues into smaller sub-issues, perfect for large tasks like "Sweep (map): migrate from React class components to function components"
Getting Sweep to format before committing! Check out Sweep Sandbox Configs to set it up.
We released a demo of our chunker, where you can find the corresponding blog and code.
π‘ To get Sweep to edit this pull request, you can:
Leave a comment below to get Sweep to edit the entire PR
Leave a comment in the code will only modify the file
Edit the original issue to get Sweep to recreate the PR from scratch
Description
This PR changes the SQLite connection in the main.py file to point to the
site.db
file in the working directory. Currently, the connection string is set tosqlite:///site.db
, which assumes that the database file is located in the same directory as the main.py file. However, we want to change the location of the database to the working directory. To achieve this, the code now uses theos
module to get the path of the working directory and appendssite.db
to it.Summary of Changes
os
module at the top of the main.py file, if it was not already imported.app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///site.db"
withapp.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///" + os.path.join(os.getcwd(), "site.db")
.Fixes #41.
To checkout this PR branch, run the following command in your terminal:
π Latest improvements to Sweep:
π‘ To get Sweep to edit this pull request, you can: