Update db.py

finished db