xtdb

ander 2025-02-21T14:31:20.372889Z

I'm trying to do some graph modeling in XTDBv2. I found this relevant discussion: https://discuss.xtdb.com/t/xtdbs-sweet-spot/52/9 I am trying to figure out how to use XTQL to pull the full document of the related node across potentially disparate tables. It doesn't look like the table is available to the binding specifications, and I can't seem to find an example of using pull with just an entity ID without also specifying the table. I suppose I can put all the entities I intend to model this graph relationship with (`nodes`) and include some :kind key in there to distinguish them, but it seems like that might not be the XTDBv2 way.

refset 2025-02-22T13:41:58.002559Z

Hey @ander I think my advice here would vary quite a lot based on the use case. For instance if you have existing data you're trying to make sense of, then one-big-table may be a good idea. But if you have complete control over the data model then I would instead recommend sticking to 3NF, or even 6NF (one ''attribute' per table, per Datomic). That said, I can think of exceptions for both of those statements. > it doesn't look like the table is available to the binding specifications This is correct, in v2 all tables and columns must be known and enumerated prior to the query being compiled. The workaround is to compile many queries and stitch together the results outside

ander 2025-02-24T13:45:23.273259Z

I appreciate the response! In this case it's for a new application, I have complete control over the data model. Are there any examples of implementing 6NF in XTDB?

👍 1
refset 2025-02-25T12:23:46.307079Z

Out of curiosity, how come you prefer to chat here instead of continuing the thread on Discuss? 🙂