database: fix open db from JS