fulcrologic / fulcro-rad-sql

SQL Plugin for Fulcro RAD
MIT License
4 stars 12 forks source link

Support both native and generated IDs #4

Closed awkay closed 4 years ago

awkay commented 4 years ago

Support an ::sql/native-id? true setting that mirrors RAD Datomic's functionality. I'm hoping that most SQL databases have a way to pre-fetch IDs like PostgreSQL does (where you can just pull the next from a serial). If not, there will probably need to be some post-processing of each insert to retrieve the assigned ID as you go. Should design this into the general save logic so a "driver" can be plugged in without having to use a diff algorithm.

awkay commented 4 years ago

This should be working in latest versions without any marker. The native ID marker is needed in Datomic because you are aliasing :db/id. No such marker is needed in SQL where you can freely name your ID.