nuxt-hub / core

Build full-stack applications with Nuxt on CloudFlare, with zero configuration.
https://hub.nuxt.com
Apache License 2.0
992 stars 57 forks source link

Use `state.storage.transaction()` API instead of the `SQL BEGIN TRANSACTION` #81

Closed jjjrmy closed 7 months ago

jjjrmy commented 7 months ago
 ERROR  To execute a transaction, please use the state.storage.transaction() API instead of the SQL BEGIN TRANSACTION or SAVEPOINT statements. The JavaScript API is safer because it will automatically roll back on exceptions, and because it interacts correctly with Durable Objects' automatic atomic write coalescing.

 ERROR  Database migrations failed D1_ERROR: not authorized

  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  at SQLiteD1Session.transaction (node_modules/src/d1/session.ts:174:3)
  at SQLiteAsyncDialect.migrate (node_modules/src/sqlite-core/dialect.ts:795:3)
  at migrate (node_modules/src/d1/migrator.ts:10:2)
  at <anonymous> (server/plugins/migrations.ts:9:1)
  at async Promise.all (index 0)
  at <anonymous> (/node_modules/@nuxthub/core/src/module/runtime/ready.dev.ts:5:1)
rennokki commented 6 months ago

For those that had issues: upgrade to latest drizzle-orm