Add postgresql adapter for Kysely
The original problem I had which triggered this change was this error when running migrations as documented in https://kysely.dev/docs/migrations
VercelPostgresKyselyError [VercelPostgresError]: VercelPostgresError - 'kysely_transactions_not_supported': Transactions are not supported yet.
Which we get because we haven't properly signaled to Kysely that we don't support transactions. The Kysely migrator checks supportsTransactionalDdl to decide whether to run migrations in a transaction or not, so this adds that.
It also overrides the default migration lock functions from https://github.com/kysely-org/kysely/blob/master/src/dialect/postgres/postgres-adapter.ts to use pg_advisory_lock and then unlock with pg_advisory_unlock since we can't rely on transactions auto-dropping now.
Fixes #325
⚠️ No Changeset found
Latest commit: e5209bb048b61bfe8177d356b9a01043b448035e
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
@marcus-kepler is attempting to deploy a commit to the Curated Tests Team on Vercel.
A member of the Team first needs to authorize it.
Tests on this currently failing due to lack of https://github.com/kysely-org/kysely/issues/456 being officially released.
Have un-extended the postgresql adapter and implemented the single remaining method in https://github.com/vercel/storage/pull/307/commits/20d17bed8f3e03cb387e42632a629c3e9bc614bd which has got tests passing.
Can someone explain what I can do to have this working?
Hey there, getting back to this. We're investigating how much value our Kysely plugin provides versus a community one: https://github.com/seveibar/kysely-neon. Have any of you tried kysely-neon? We're wondering if we should deprecate our own adapter and delegate it to the community.
As you can tell, we have not been very active in this issue (apologies), which is why we're wondering if it should be owned by the community.
Let us know if https://github.com/seveibar/kysely-neon could work for you, and if not I can re-review this PR.
Hey there, getting back to this. We're investigating how much value our Kysely plugin provides versus a community one: https://github.com/seveibar/kysely-neon. Have any of you tried kysely-neon? We're wondering if we should deprecate our own adapter and delegate it to the community.
As you can tell, we have not been very active in this issue (apologies), which is why we're wondering if it should be owned by the community.
Let us know if https://github.com/seveibar/kysely-neon could work for you, and if not I can re-review this PR.
I agree with you since the kysely neon is an active project and cover all behaviours that vercel kysely do. Can we ensure that? Otherwise I prefer to mantain current with this fixes that I think that is the only problem.
Thanks