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

fix(driver): return Object for JSON columns and imply UTC for timestampz #43

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

omikader
Copy link
Contributor

@omikader omikader commented Jun 4, 2024

Summary

This PR does a couple of things:

  • Removes the yarn.lock file and references to yarn in the package.json scripts because this uses pnpm for the GitHub actions and everything else
  • Changes the DataApiConnection.executeQuery logic to be more type-savvy in the following ways:
    • The current implementation converts all date timestamp and timestamptz columns into Date objects. However, in Postgres, timestamptz columns are always stored in UTC and are converted to the system timezone upon retrieval. Therefore, implied UTC needs to be added to ensure that the Date object is correct Timestamp columns and Date values #34
    • The current implementation is capable of returning POJOs for json and jsonb columns. This relieves us of needing to use the ParseJSONResultsPlugin which incorrectly and eagerly convert non-JSON column types into JSON. Given that the column type is available here, I think it makes a lot of sense to use that information

Given that this changes the return types, I've opted for a major version bump.

Copy link

changeset-bot bot commented Jun 4, 2024

🦋 Changeset detected

Latest commit: 63c801b

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 Major

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

@jayair jayair requested a review from thdxr June 5, 2024 23:53
@thdxr thdxr merged commit f1de155 into sst:master Sep 25, 2024
@github-actions github-actions bot mentioned this pull request Sep 25, 2024
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