Closed joodie closed 3 years ago
The idea was that DataScript does not support typing (yet), so we don’t allow type definitions. The only exception was db.type/ref because you need to know if something is a ref in some situations.
db.type/tuple seems like a reasonable and pretty isolated addition. I think we can allow it to be specified, seems like no harm in that. But not required, if we require it to be always present, that will break backwards compatibility.
I’ll happily accept a PR, thanks!
I'm working on some code that uses composite tuples. Looking at the datomic documentation, I was trying to define such a tuple as
But that fails with
Reading the datascript docs more closely it seems that I must not use db/valueType here; composite attributes are defined by having a :db/tupleAttrs attribute in their schema.
Is this difference in behavior intentional? I wouldn't mind providing a patch to allow a db.type/tuple in this specific case if that's a welcome addition.