client-ts icon indicating copy to clipboard operation
client-ts copied to clipboard

[Experimental] Support for prisma

Open SferaDev opened this issue 2 years ago • 7 comments

TODO:

  • Testing
  • Proper type conversion (I've removed a lot that will need to be handpicked)
  • Add support for wire protocol via websockets

SferaDev avatar Oct 11 '23 15:10 SferaDev

⚠️ No Changeset found

Latest commit: 841feab08f9465b1c635bc09328afd0c0ba7367b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

changeset-bot[bot] avatar Oct 11 '23 15:10 changeset-bot[bot]

size-limit report 📦

Path Size
packages/client/dist/index.mjs 17.94 KB (+0.08% 🔺)
packages/client/dist/index.cjs 19.29 KB (+0.08% 🔺)
packages/codegen/dist/index.mjs 2.58 MB (+0.01% 🔺)
packages/codegen/dist/index.cjs 2.58 MB (+0.01% 🔺)

github-actions[bot] avatar Oct 11 '23 15:10 github-actions[bot]

Your pull request has been published to npm.

You can install @xata.io/client by running:

npm install @xata.io/[email protected]

Other packages are published like this:

npm install @xata.io/[email protected]

To test the CLI, run:

npx @xata.io/[email protected]

[Pull request has been updated, please wait for latest changes to be pushed to npm...]

github-actions[bot] avatar Oct 12 '23 15:10 github-actions[bot]

👋 Heyho from Prisma.

If you want, you can do a temporary PR similar to https://github.com/prisma/prisma-engines/pull/4342, which should make it simpler to run the Prisma test suites against the driver adapter. We are unfortunately not ready yet with a more general approach for that, but I am happy to work with getting that run in this temporary way. (Unless of course you have figured out a better way already)

janpio avatar Oct 13 '23 18:10 janpio

Hey @janpio!

We indeed want to move our adapter to prisma-engines, I actually took a heavy inspiration from the existing ones when building the first version.

We are currently working on polishing some parts of our postgres connector internally, and we would like to finish that before moving the code to your side. (For example, right now we are injecting to the adapter the schema, but we want to forward the postgres row metadata via the http adapter, in order that joins and projections fully work).

Happy to connect via email or GitHub if you have any suggestions 😉

SferaDev avatar Oct 25 '23 14:10 SferaDev

Actually, the driver living in your repo is the right spot - but temporarily (via a PR) having a copy in our test setup can be useful for you I think. But we are currently also moving things around (soon the driver adapters live in prisma/prisma...), so maybe we wait a few days until we tackle that.

How do you think about transactions? As far I know your client does not support that yet. Many Prisma Client queries use transactions under the hood (at least as soon as the queries become a tiny bit complex). Would you want those to be not working, or are you ok skipping the transaction guarantees for your users?

janpio avatar Oct 27 '23 00:10 janpio

We are working to offer full postgres compatibility, including transactions in the near future. We will even expose a TCP wire protocol connection string and likely have two adapters HTTP and wire protocol. But all of that is blocked until we ship the full thing.

SferaDev avatar Oct 27 '23 05:10 SferaDev