added preliminary support for database merges