Add optional db authentication to default code generator runner

supersedes #612
review by @szeiger is this LGTM?