best way to get autogenerated primary key