ignore .metadata/*
Add some database methods to DbConnection
fix errors in models.