fixes #684 Add support for a user-defined primary key.