Closed dihmeetree closed 4 months ago
Why not both?
Why not both?
I don't think we should be allowing the use of Connection
, as it causes unwanted issues (especially around transactions). You can see an example of this here https://github.com/drizzle-team/drizzle-orm/issues/1743. I think enforcing the use of Client
(as the Drizzle team is now) should be the way forward. They'll get an type error in their IDE sure, but imo that's beneficial as they'll either have to fix it, or have to explicitly add a ts-ignore
or ts-expect-error
on their own.
That's a user-side problem, not the library's. It shouldn't be up to the adapter to enforce it.
That's a user-side problem, not the library's. It shouldn't be up to the adapter to enforce it.
No worries. I've gone ahead and added Connection
back in 👍🏻
Can you update the docs for PlanetScale as well?
Need this for migration too
Thanks!
It has been recently recommended by the PlanetScale team that a
Client
instance be used instead ofConnection
to make calls to the database.You can see the comment here on the Drizzle ORM issue here https://github.com/drizzle-team/drizzle-orm/issues/1743#issuecomment-1892634033 which highlights the reason for this change.
If you check the Drizzle Docs https://orm.drizzle.team/docs/get-started-mysql, they have already updated it with the change from:
to
I've gone ahead and replaced all instances of
Connection
withClient
to reflect this change.