Fork me on GitHub
#xtdb
<
2020-07-29
>
David Pham05:07:50

How does SQL and Datalog interop? Can you still perform datalog queries on SQL Tables?

refset06:07:15

Hi @UEQGQ6XH7, the SQL tables don't really exist in any sense until you run a query. Each table is backed by a single Datalog query, and that query isn't special in any way asides from that it will additionally filter based on the types of values (which you can also recreate in your own Datalog, if desired). SQL tables are essentially lightweight (and efficient) read-only views. We have some materials being released over the next week or so that will step through exactly what's going on and show what the generated Datalog looks like :)

David Pham06:07:45

Thanks :) if this can help you anyhow, my use case is I would like to introduce crux slowly in my workplace, and I really appreciate the SQL story as it would reduce the number of novelty, however I fear that it would reduce my ability to leverage crux with datalog. Thank for your answer!

🙏 3
refset07:07:08

That's great to hear - it is exactly the kind of situation we wanted to help with when we started writing the module! You will probably be pleased to know that we're working on JSON APIs next 😉

parrot 6
David Pham06:07:45

Thanks :) if this can help you anyhow, my use case is I would like to introduce crux slowly in my workplace, and I really appreciate the SQL story as it would reduce the number of novelty, however I fear that it would reduce my ability to leverage crux with datalog. Thank for your answer!

🙏 3
peter hull15:07:06

@jarohen On your 'Projection syntax' doc, first example, why does the :user/id value get returned if it isn't in the 2nd argument to eql/project ? (sorry if dumb question, I'm just having a quick look)

jarohen15:07:16

nope, good question - it shouldn't - will update 🙂