-
Notifications
You must be signed in to change notification settings - Fork 219
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
feat(js-connectors): use standard provider names ("mysql", "postgres", ...) #4141
Conversation
CodSpeed Performance ReportMerging #4141 will not alter performanceComparing Summary
|
I am trying to understand the rationale and I'm not sure I completely get the advantages.
The lower amount of effort will only apply strictly for connectors we can transparently treat as mysql or postgres — so the pg connector, but for example not a hypothetical d1 or mssql connector. That's pretty narrow.
I'm not familiar with the reasoning behind the current prisma client api (and I gather it is being iterated on) so I don't have an opinion here. Only that it doesn't sound extremely painful.
Also not familiar with this one, I'll let you weigh the tradeoff, but we should think about how we want to test this ultimately. Adding one axis of conditionals to engine initialization has clear downsides, we've worked hard to reduce that in the past.
This is the main point for me. With this PR, the query engine knows it has a JS connector on the other end (from the newly introduced connector mode), but it loses the information about which connector (neon vs. pg, for example). Not differentiating between these two may work for a proof of concept, but my hunch is that we will to have that information in the QE. Before this PR, we do have it, and we would lose it. Not saying that it's the only two alternatives, we could imagine something similar to the LSP initialization request for the JS connector to report more info to the query engine, and runtime dispatch on that for example. Beyond the QE, this PR removes the mechanism we would need to have different PSL validations for different node driver based connectors. Posting this with the caveat that I'm still not clear on where we are going with node drivers at the moment, how much tech debt we are willing to take on and what the scope of the current changes is, but assuming this is going to end up being shipped. wdyt? |
I wonder, why would the QE need to know we're using the The following holds:
Happy to correct my point of view, in case I've missed anything here |
I don't have concrete examples in mind, but my assumption would be that planetscale / neon have or will have features (extending the schema or client) or constraints (restricting the schema or client) in their server or their serverless clients that are different from stock mysql / postgres. That's equivalent to the question of whether these two should be separate connectors or not, regardless of how the connectors are implemented. The relevance of this to your bullet points would only be the first sentence in your second bullet point, where I would disagree that this will continue to be true. In the first and third bullet points, either the current solution in main or the one from this PR works, no arguing. For the fourth, I wasn't thinking of that part of the connector at all, but more about user-facing things: client and schema APIs. |
@tomhoule Ok, then let's keep this around as a reference PR, without merging it / reviewing it further until we have the tools for making a more informed decision. I'll prepare a separate PR that just allows using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're going in the direction (DX initiative) of keeping the exact same connectors and relying on matching behaviour from the different driver adapters, we can do this. Approved 👍
Closes https://github.com/prisma/team-orm/issues/303 (please read its description).
Contributes to https://github.com/prisma/team-orm/issues/327.