allow database as optional connection parameter