build db for mate in one and use it in test