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

Convert string for fields marked as TIMESTAMP to Date #29

Merged
merged 1 commit into from
Aug 14, 2023

Conversation

c-st
Copy link
Contributor

@c-st c-st commented Jul 28, 2023

We noticed that when using a Kysely schema using Date, writing and then reading the value would result in a string instead of a Date. This is a different behaviour than what we observed with the built-in postgres-dialect (where TIMESTAMP fields are returned as Date).

This adds a check for the field's typeName and performs the conversion to Date accordingly.

@changeset-bot
Copy link

changeset-bot bot commented Jul 28, 2023

🦋 Changeset detected

Latest commit: 1e5a527

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
kysely-data-api Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@c-st c-st force-pushed the convert-timestamp-to-date branch from bf90477 to 1e5a527 Compare July 28, 2023 12:13
@dan-turner
Copy link

Looks like this one has been approved. Any reason it's not yet been merged?

@KennethWussmann
Copy link

My approval doesn't count. It needs a maintainer.

@c-st
Copy link
Contributor Author

c-st commented Aug 10, 2023

Hi @thdxr. It seems you have been merging previous PRs. Any chance you could have a look at this one, too? We're planning to use Kysely in a serverless environment but are somewhat blocked without this.

@jayair
Copy link
Contributor

jayair commented Aug 11, 2023

Yeah let me ping Dax as well.

@thdxr thdxr merged commit a2c26d4 into sst:master Aug 14, 2023
@github-actions github-actions bot mentioned this pull request Aug 14, 2023
@c-st c-st deleted the convert-timestamp-to-date branch August 29, 2023 07:52
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.

5 participants