This is the Datomic/Clojure dialect of Datalog. I had an easier time learning a stand-alone datalog variant. I think compiling Datalog to SQL is an interesting idea.
I wrote a toy Datalog -> SQLite compiler: https://percival.jake.tl/
Other Datalog -> SQL compilers I know of:
- Originally from Mozilla, now independent: https://github.com/qpdb/mentat
- From Google: https://logica.dev/