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

feat: add configuration to store enums as pg custom domain types #292

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

prevostc
Copy link
Contributor

@prevostc prevostc commented Feb 7, 2024

Motivation: more efficient domain storage of enum data.

JSON Schema References:

Enums are stored as 1 or 2 bytes they are very space efficient when it's possible to use them.
Because enums have a lots of downsides too, this feature is behind a feature flag.

This can never be a full, specification accurate implementation, as a subset of valid jsonschema enum cannot map to a valid pg domain. Ex: {"enum": ["a", 3, null]} is a valid jsonschema.

@prevostc prevostc marked this pull request as ready for review February 12, 2024 15:02
@prevostc prevostc changed the title [WIP] feat: add configuration to store enums as pg custom domain types feat: add configuration to store enums as pg custom domain types Feb 12, 2024
@prevostc prevostc force-pushed the optimize_enums_for_storage branch from 2a223f1 to 46040b6 Compare February 12, 2024 21:30
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants