vercel / storage

Vercel Postgres, KV, Blob, and Edge Config
https://vercel.com/storage
Apache License 2.0
493 stars 55 forks source link

Support for kysely migration #325

Open volnei opened 1 year ago

volnei commented 1 year ago

I would be great if we can use kysely migrations. That should be achieved by disabling transactions

Currently we have this error

{
  error:  [VercelPostgresError: VercelPostgresError - 'kysely_transactions_not_supported': Transactions are not supported yet.] {
  code: 'kysely_transactions_not_supported',
  name: 'VercelPostgresError'
}

I think this could be useful

https://kysely-org.github.io/kysely-apidoc/interfaces/DialectAdapter.html#supportsTransactionalDdl

volnei commented 1 year ago

This could solve the issue

https://github.com/vercel/storage/pull/307#pullrequestreview-1575111153

marciomunhoz commented 1 year ago

Please help us! We need to finalize a project with this fix. 😬

volnei commented 1 year ago

@marciomunhoz

You can use this until vercel fixes this trivial

Object.defineProperty(
  db.getExecutor().adapter,
  'supportsTransactionalDdl',
  () => false,
)

although it is something absurdly horrible, it works.