deanery db as example
refactored
sql file for script run
correct autoclosing