// schema
experiments: defineEnt()
.field("name", v.number(), { autoIncrement: true})
// write
ctx.table("experiments").insert({});
but what if you need unique or autoincrement when there's another identifying field (happens often in hieararchies)?
This is a general pattern that would be nice to tackle:
.index("byNumber", ["experimentGroupId", "number"])
.index("byLastUpdateTime", ["experimentGroupId", "lastUpdateTime"])
.index("byAuthorEmail", ["experimentGroupId", "authorEmail"]),
but what if you need
uniqueorautoincrementwhen there's another identifying field (happens often in hieararchies)?This is a general pattern that would be nice to tackle: