Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add peewee for SQLite support #3

Open
JedHazaymeh opened this issue Dec 6, 2023 · 0 comments
Open

Add peewee for SQLite support #3

JedHazaymeh opened this issue Dec 6, 2023 · 0 comments

Comments

@JedHazaymeh
Copy link
Contributor

JedHazaymeh commented Dec 6, 2023

Blockbot needs support for persistent data across restarts, in order to add features for common use-cases.

Initially, a Postgres database was planned to be added as a dependency, but given the scope of the bot and the data requirement, an SQLite database was decided as a more appropriate solution.

In order to interact with the database using an object-oriented pattern, an object relational mapper (ORM) is required. For our use case, the Peewee module seems to be a suitable solution for a Python ORM.

Requirements

  • Install the latest version of peewee, with:
pip install peewee
pip freeze > requirements.txt
  • Create a blockbot.db file (the database) in the root directory.
  • In main.py, open and verify a connection to the database before starting the bot client.

Resources

@JedHazaymeh JedHazaymeh added enhancement New feature or request good first issue Good for newcomers and removed good first issue Good for newcomers enhancement New feature or request labels Dec 6, 2023
@JedHazaymeh JedHazaymeh self-assigned this Dec 8, 2023
@JedHazaymeh JedHazaymeh removed their assignment Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant