Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Support for Strict Schema Definition and/or Attribute Creation Responses #301

Open
jeremy302 opened this issue Jan 12, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@jeremy302
Copy link

Description

The current schema-on-write data model is great for many use cases. However, this isn't always a desireable behavior for some projects.

I propose two potential features to address such use cases:

  • Strict Schema Support: Add an option for strict schema enforcement. either on the db level or on a per-transaction basis.
    Transactions may error out or ignore unknown attributes.
  • Attribute Creation Response: If in non-strict mode, transaction responses may contain info about attributes it created.

Use Cases and Benefits

  1. Strict Schema: New projects can save the time and effort of having to enforce in user code.
  2. Errors: Errors from the likes of inadvertent typos or incorrect data types can be caught early.
  3. Attribute Creation Response: Knowing which new attributes were created during a transaction can help with debugging, auditing, and understanding the evolution of the data model.
@huahaiy huahaiy added the enhancement New feature or request label Jan 12, 2025
@huahaiy
Copy link
Contributor

huahaiy commented Jan 18, 2025

We already have :closed-schema? option that errors out with unknown attributes, and :validate-data? option that throw if data type does not match schema. So the remaining issue is to add created attributes to the transaction report.

@jeremy302
Copy link
Author

Indeed. :validate-date? and :closed-schema? provide the most important guardrails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants