use whatever database is passed
add #tables. fixes #2.