What's Changed
Expose Model._$idKeys for a model's identifier field keys by @tarag in #654
Code that builds raw SQL against a model — e.g. an upsert with an
ON CONFLICTtarget — needs the databaseFieldKeys of the model’s identifier, and must handle both@IDand@CompositeID. The only way to get them generically today is to reach the internalanyIDproperty.Add a public
_$idKeys: [FieldKey]accessor, mirroring the existing_$idExistsescape hatch: it works for both@IDand@CompositeID, whereas_$idtraps on composite models.AnyIDis refined toAnyDatabaseProperty— bothIDPropertyandCompositeIDPropertyalready conform — so the accessor readsanyID.keyswithout a cast whileAnyIDandanyIDstay internal.
This patch was released by @gwynne
Full Changelog: 1.56.0...1.57.0