diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2023-09-02 21:48:53 +0300 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2023-09-10 19:01:00 +0300 |
| commit | c13734f56e9b01a61cfb66019a71d46c3dfe6f86 (patch) | |
| tree | 155da5a7386a6fabf493640bd9d0eb9aa10313c2 /app/database.py | |
| parent | 4745449cf847f27c3cbbca5cef2f1d9d02103692 (diff) | |
Add tinydb
Diffstat (limited to 'app/database.py')
| -rw-r--r-- | app/database.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/database.py b/app/database.py new file mode 100644 index 0000000..fdeac1a --- /dev/null +++ b/app/database.py @@ -0,0 +1,16 @@ +from tinydb import TinyDB + +from app.AggroConfig import AggroConfig + + +def setup_db(config: AggroConfig): + global database_manager + database_manager = DatabaseManager(config) + + +class DatabaseManager: + def __init__(self, config: AggroConfig): + self.db = TinyDB(config.db_path) + + +database_manager: DatabaseManager |
