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

[pg] fix int8 precision loss in relations (bigint, bigserial and custom int8) #4166

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

valeriancure
Copy link

  • Fixes a bug where bigint was serialized as number in relation, losing precision.
  • Native bigserial and bigint types are automatically casted to text.
  • Allows custom types to also be casted via castInRelation: 'text'.
  • Added tests for native and custom types, with one and many relations.

There are probably edge cases not covered, my understanding of drizzle's internals being limited.

Related (pg) : #3267, #813
Related (other dialect) : #1688

…om int8)

Fixes a bug where bigint was serialized as number in relation, losing
precision.
Native bigserial and bigint types are automatically casted to string.
Allows custom int8 types to also be casted via `castInRelation: 'text'`.
Added tests for native and custom types, with `one` and `many`
relations.
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.

1 participant