Further improve multi db support