How akgta/pydbmng works
This repository is a Python SQLite persistence engine, demonstrated by a small player-data application. The main workflow registers load/save callbacks, turns player state into a table payload, and asks the hook system to persist it; loading routes stored data back through the registered callback. The hook module also provides schema management, table cleanup, and a locked background sync loop. README-described timing and capabilities supplement the partial hook excerpt; encryption is present as a separate utility, but no connection to persistence is shown.
Main entry points: hook.py Hook API · main.py Player Application · database.db SQLite Database · debugger.py Debug Decorators
Components 15
Application Data
- Player Application
main.py - Player State
main.py
Persistence Engine
- Hook API
Module/hook.py - Callback Registry
Module/hook.py - Save Cache
Module/hook.py - Save Router
Module/hook.py - Load Router
Module/hook.py - Schema Manager
Module/hook.py - Table Cleanup
Module/hook.py - Background Worker
Module/hook.py - Database Lock
Module/hook.py - SQLite Engine
Module/hook.py - SQLite Database
database.db
Debugging
- Debug Decorators
Module/debugger.py
Crypto Utilities
- Encryption Utilities
Module/encrypt.py
Connections 21
- Player Application → Hook API: registers hooks
main.py - Player Application → Hook API: requests save
main.py - Player State → Player Application: provides save data
main.py - Hook API → Callback Registry: registers callbacks
README.txt - Hook API → Save Router: routes saves
Module/hook.py - Hook API → Load Router: routes loads
README.txt - Save Router → Callback Registry: calls save callback
Module/hook.py - Save Router → Save Cache: updates payload
Module/hook.py - Save Router → SQLite Engine: inserts rows
Module/hook.py - Load Router → SQLite Engine: queries rows
Module/hook.py - Load Router → Save Cache: stores results
Module/hook.py - Load Router → Callback Registry: calls load callback
Module/hook.py - SQLite Engine → Schema Manager: ensures columns
Module/hook.py - SQLite Engine → SQLite Database: reads and writes
README.txt - Table Cleanup → SQLite Database: drops table
Module/hook.py - Table Cleanup → Save Cache: clears state
Module/hook.py - Background Worker → Database Lock: locks cycles
Module/hook.py - Background Worker → Load Router: triggers periodic loads
Module/hook.py - Background Worker → Save Router: triggers periodic saves
README.txt - Hook API → Debug Decorators: decorated by
Module/hook.py - Encryption Utilities → Debug Decorators: uses decorators
Module/encrypt.py