Skip to content

fix(adapter-neon): fix type parsing for PrismaNeonHTTP adapter - #25515

Merged
aqrln merged 4 commits into
prisma:mainfrom
andyjy:neon-http-types
Dec 3, 2024
Merged

aqrln merged 4 commits into
prisma:mainfrom
andyjy:neon-http-types

Conversation

@andyjy

@andyjy andyjy commented Oct 26, 2024 •

Copy link
Copy Markdown
Contributor

fixes #25514

requires bumping peer dep to latest @neondatabase/serverless version, once neondatabase/serverless#110 is merged and released
=> devDependency now bumped to @neondatabase/[email protected] to fix types

This PR simply duplicates passing the existing type parsers as already used for the PrismaNeon adapter.

should continue to work with any version of @neondatabase/serverless as a peer dep:

  • this fix will have no effect unless used with @neondatabase/serverless >= 0.9.5
  • for versions of @neondatabase/serverless < 0.9.5the addition oftypes` option will be silently ignored

The original PR adding type parsers to PrismaNeon didn't add tests for correct type conversion so I wasn't able to easily repurpose any existing tests for type conversion.

@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Oct 26, 2024
@codspeed

codspeed Bot commented Nov 6, 2024 •

Copy link
Copy Markdown

CodSpeed Performance Report

Merging #25515 will not alter performance

Comparing andyjy:neon-http-types (dbece9a) with main (84620ad)

Summary

✅ 3 untouched benchmarks

@aqrln

aqrln commented Nov 30, 2024

Copy link
Copy Markdown
Member

The #24434 didn't add tests for correct type conversion so I wasn't able to easily repurpose any existing tests for type conversion.

It should in theory be covered by the existing tests. I'm not sure though if the HTTP Neon client is used in tests at all since it doesn't support transactions.

@aqrln aqrln left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM if you can confirm this fixes the issue for you

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Nov 30, 2024
@aqrln aqrln changed the title fix type parsing for PrismaNeonHTTP adapter fix(adapter-neon): fix type parsing for PrismaNeonHTTP adapter Nov 30, 2024
@socket-security

Copy link
Copy Markdown

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@antfu/[email protected] environment, filesystem, shell 0 465 kB antfu
npm/@codspeed/[email protected] eval Transitive: environment, filesystem, network, unsafe +2 6.62 MB art049
npm/@eslint/[email protected] None 0 49.2 kB eslintbot
npm/@eslint/[email protected] filesystem, unsafe 0 668 kB eslintbot
npm/@eslint/[email protected] None 0 14.2 kB eslintbot
npm/@faker-js/[email protected] None 0 10.2 MB shinigami92
npm/@fast-check/[email protected] None 0 35.6 kB ndubien
npm/@inquirer/[email protected] Transitive: environment +17 2.47 MB sboudrias
npm/@jest/[email protected] environment, filesystem +5 145 kB simenb
npm/@microsoft/[email protected] Transitive: environment, eval, filesystem, shell, unsafe +13 10.3 MB microsoft1es, odspnpm
npm/@neondatabase/[email protected] network 0 349 kB pffigueiredo
npm/@neondatabase/[email protected] network 0 345 kB jawj
npm/@opentelemetry/[email protected] None 0 1.22 MB pichlermarc
npm/@opentelemetry/[email protected] unsafe 0 59.3 kB dyladan
npm/@opentelemetry/[email protected] filesystem +2 603 kB pichlermarc
npm/@opentelemetry/[email protected] filesystem +2 638 kB dyladan
npm/@opentelemetry/[email protected] Transitive: environment, unsafe +2 6.8 MB bogdandrutu, dyladan, pichlermarc
npm/@opentelemetry/[email protected] Transitive: environment, filesystem, shell +3 7.58 MB pichlermarc
npm/@opentelemetry/[email protected] Transitive: environment, unsafe +2 7.04 MB dyladan
npm/@opentelemetry/[email protected] None 0 6.25 MB dyladan
npm/@planetscale/[email protected] network 0 49.9 kB ayrton
npm/@prisma/[email protected] None 0 12.7 kB aqrln, pirix-gh, prismabot
npm/@prisma/[email protected] environment, eval, filesystem, network, shell, unsafe 0 2.09 MB aqrln
npm/@prisma/prisma-schema-wasm@6.1.0-3.025d69d4aa1362e128e0bcc53b5147a416dfebad None 0 2.94 MB aqrln, jkomyno, pirix-gh, ...1 more
npm/@prisma/query-engine-wasm@6.1.0-3.025d69d4aa1362e128e0bcc53b5147a416dfebad None 0 6.35 MB prismabot
npm/@prisma/[email protected] network Transitive: environment, eval +4 312 kB prismabot
npm/@prisma/[email protected] None 0 2.91 MB prismabot
npm/@sindresorhus/[email protected] None +1 30.3 kB sindresorhus
npm/@size-limit/[email protected] filesystem 0 3.6 kB ai
npm/@slack/[email protected] Transitive: network +2 2.24 MB e-zim
npm/@snaplet/[email protected] None 0 1.87 MB justinvdm
npm/@swc-node/[email protected] environment, filesystem +3 205 kB broooooklyn
npm/@swc/[email protected] environment, filesystem 0 532 kB kdy1
npm/@swc/[email protected] environment, filesystem, shell +1 307 kB kdy1
npm/@swc/[email protected] None 0 13.4 kB kdy1, kwonoj
npm/@timsuchanek/[email protected] filesystem Transitive: shell +2 272 kB timsuchanek
npm/@types/[email protected] None 0 3.83 kB types
npm/@types/[email protected] None 0 9.24 kB types
npm/@types/[email protected] None 0 4.85 kB types
npm/@types/[email protected] None +1 9.33 kB types
npm/@types/[email protected] None 0 27.9 kB types
npm/@types/[email protected] None 0 5.46 kB types
npm/@types/[email protected] None 0 78.8 kB types
npm/@types/[email protected] None 0 2.9 kB types
npm/@types/[email protected] None +1 59 kB types
npm/@types/[email protected] None 0 1.97 MB types
npm/@types/[email protected] None 0 2.03 MB types
npm/@types/[email protected] None 0 16.1 kB types
npm/@types/[email protected] None 0 6.51 kB types
npm/@types/[email protected] None 0 7.96 kB types
npm/@types/[email protected] None 0 60.4 kB types
npm/@types/[email protected] None 0 10.1 kB types
npm/@types/[email protected] None +2 26.6 kB types
npm/@types/[email protected] None 0 7.08 kB types
npm/@typescript-eslint/[email protected] None +6 4.68 MB jameshenry
npm/@typescript-eslint/[email protected] None +4 1.4 MB jameshenry
npm/@typescript-eslint/[email protected] None +5 2.04 MB jameshenry
npm/[email protected] filesystem +2 876 kB ctalkington
npm/[email protected] None 0 13.7 kB leerobinson
npm/[email protected] None 0 16.7 kB glebec
npm/[email protected] eval 0 91.1 kB jdalton
npm/[email protected] None +1 101 kB feross
npm/[email protected] environment, eval, filesystem, shell 0 834 kB prismabot
npm/[email protected] environment, filesystem +1 139 kB paulmillr
npm/[email protected] environment 0 27.3 kB sibiraj-s
npm/[email protected] None 0 10.4 kB sindresorhus
npm/[email protected] environment, filesystem, shell 0 16.1 kB satazor
npm/[email protected] None 0 218 kB mikemcl
npm/[email protected] None 0 283 kB mikemcl

🚮 Removed packages: npm/@cloudflare/[email protected], npm/@prisma/[email protected], npm/@prisma/[email protected], npm/[email protected]

View full report↗︎

@socket-security

Copy link
Copy Markdown

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteCI
Critical CVE npm/@babel/[email protected] ⚠︎

View full report↗︎

Next steps

What is a critical CVE?

Contains a Critical Common Vulnerability and Exposure (CVE).

Remove or replace dependencies that include known critical CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

@andyjy

andyjy commented Dec 1, 2024

Copy link
Copy Markdown
Contributor Author

LGTM if you can confirm this fixes the issue for you

Thanks! Yes this fixes the issue; I have been using this successfully via a patch in the interim.

@aqrln aqrln added this to the 6.1.0 milestone Dec 1, 2024
@aqrln
aqrln merged commit 8939f97 into prisma:main Dec 3, 2024
@aqrln

aqrln commented Dec 3, 2024

Copy link
Copy Markdown
Member

Cool! I'll go ahead and merge it then.

@andyjy
andyjy deleted the neon-http-types branch December 4, 2024 11:29
aqrln added a commit that referenced this pull request Dec 5, 2024
The devDependency was updated in
#25515 but the version in the
bundled drivers for engine tests wasn't, causing problems because both
were imported from different packages and `instanceof` check failed.

Fixes: prisma/team-orm#1443
aqrln added a commit that referenced this pull request Dec 5, 2024
The devDependency was updated in
#25515 but the version in the
bundled drivers for engine tests wasn't, causing problems because both
were imported from different packages and `instanceof` check failed.

Fixes: prisma/team-orm#1443
aqrln added a commit that referenced this pull request Dec 5, 2024
The devDependency was updated in
#25515 but the version in the
bundled drivers for engine tests wasn't, causing problems because both
were imported from different packages and `instanceof` check failed.

Fixes: prisma/team-orm#1443
jkomyno pushed a commit that referenced this pull request Dec 6, 2024
The devDependency was updated in
#25515 but the version in the
bundled drivers for engine tests wasn't, causing problems because both
were imported from different packages and `instanceof` check failed.

Fixes: prisma/team-orm#1443
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PrismaNeonHTTP adapter breaks on some types e.g. timestamp

2 participants