Unpacking a database of unknown type