DRY up the two database adaptors

refactor MysqlAdaptor and PostgresAdaptor to inherit from a shared BaseAdaptor