Skip to content

Auto-increment field #60

Description

@xixixao
// 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"]),

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions