Add support for primary key different from id