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

chore: save schema integers in INTEGER SQLite columns #531

Merged
merged 3 commits into from
Mar 28, 2024

Conversation

EvanHahn
Copy link
Contributor

@EvanHahn EvanHahn commented Mar 28, 2024

Depends on #530.

If we use the "integer" JSON Schema type, we should save that as an INTEGER column, not a REAL column. Both will work for many numbers, but larger integers (like 2**63) can only be safely stored in INTEGERs. This should be a bit more reliable.

As of this patch, we don't have any integer types in our schemas, so this has no effect. However, that may change as we address upcoming issues.

This is a test-only change (other than tweaking a comment).
If we use the ["integer" JSON Schema type][0], we should save that as an
INTEGER column, not a REAL column. Both will work for many numbers, but
larger integers (like `2**63`) can only be safely stored in INTEGERs.
This should be a bit more reliable.

As of this patch, we don't have any integer types in our schemas, so
this has no effect. However, that may change as we address [upcoming
issues][1].

[0]: https://json-schema.org/understanding-json-schema/reference/numeric#integer
[1]: #150
Copy link
Member

@gmaclennan gmaclennan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

must have missed that column type when implementing. Thanks.

Base automatically changed from test-schema-to-drizzle to main March 28, 2024 21:12
@EvanHahn EvanHahn merged commit d5bf570 into main Mar 28, 2024
2 of 4 checks passed
@EvanHahn EvanHahn deleted the save-ints-as-int branch March 28, 2024 21:14
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