Commit 0ae5516
committed
Refactor: Use SQLAlchemy Database Management & ORM
- Deleted the `__init__.py` file from
`stat_log_db/src/stat_log_db`.
- Refactored `db.py` to use the SQLAlchemy engine
- Removed deprecated Database sub-classes
MemDB and FileDB
- Removed deprecated Connection classes
- Created `modules` directory for organizing
different groups of SQLAlchemy models
- Created a new `BaseModel` class in
`modules/base/models/base.py` for ORM mapping.
- Added `Log`, `LogLevel`, and `LogType` models
in `modules/log/models/` with appropriate
relationships.
- Introduced `Tag` model in
`modules/tag/models/tag.py`.
- Implemented tests for database operations in
`test_db.py` and removed `test_sql_injection.py`.
- Updated `tools.sh` to improve cleanup script
functionality.1 parent 69c2d58 commit 0ae5516
File tree
14 files changed
+223
-634
lines changed- stat_log_db
- src/stat_log_db
- modules
- base
- models
- log
- models
- tag
- models
- tests
14 files changed
+223
-634
lines changedThis file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
4 | 7 | | |
5 | | - | |
| 8 | + | |
| 9 | + | |
6 | 10 | | |
7 | 11 | | |
8 | 12 | | |
| |||
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
21 | | - | |
22 | | - | |
23 | | - | |
| 25 | + | |
| 26 | + | |
24 | 27 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
36 | 50 | | |
37 | 51 | | |
38 | 52 | | |
| |||
0 commit comments