Add support for multiple types db
Merge remote-tracking branch 'dhchen/master'