Chooses from the runtime type of the existing keys rather than coercing
them to numbers. Coercion was the old bug: Number('a3f9-...') is NaN,
|| 0 collapsed it to 0, and every created row came back as 1 -
duplicate keys, and update/remove then resolving to the wrong record.
numeric keys -> highest + 1
digit-like strings -> highest + 1, kept as a string
any other string -> a fresh UUID
empty dataset -> 1, matching the previous behaviour for the common case
Mixed or non-primitive key types cannot be continued safely, so those throw
rather than silently colliding. Pass an explicit generator for those.
Default identity policy for in-memory sources.
Chooses from the runtime type of the existing keys rather than coercing them to numbers. Coercion was the old bug:
Number('a3f9-...')isNaN,|| 0collapsed it to0, and every created row came back as1- duplicate keys, andupdate/removethen resolving to the wrong record.1, matching the previous behaviour for the common caseMixed or non-primitive key types cannot be continued safely, so those throw rather than silently colliding. Pass an explicit generator for those.