Skip to content

No compile-time check that entities sharing a collection compose the same partition key #59

Description

@mvhenten

ElectroDB requires every access pattern sharing a collection name to compose the same partition key (https://electrodb.dev/en/modeling/collections/). Nothing in src/decorators/$index.ts or src/emitter.ts checks this at compile time — a mismatch currently only surfaces at runtime, when ElectroDB's Service constructor throws.

Requesting a compile-time diagnostic: when two @index access patterns on entities in the same service declare the same collection but a different composite partition key, tsp compile should report it directly, rather than deferring the failure to whenever the generated code first constructs the Service.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions