wired writer.py to abstract DB class