Skip to content

[BUG]: Drizzle can no longer run on Durable Objects #4586

@ezShroom

Description

@ezShroom

Report hasn't been filed before.

  • I have verified that the bug I'm about to report hasn't been filed before.

What version of drizzle-orm are you using?

0.44.0

What version of drizzle-kit are you using?

0.31.1

Other packages

No response

Describe the Bug

I upgraded my Cloudflare Worker, which uses Durable Objects, to 0.44.0, at which point migrations would fail (with a Rollback error).

This is common when migrations have been generated in the wrong order, but I had already corrected this and it was still happening.

Migrations into a regular SQLite file using the same generated SQL would work, however.

I instead made a loop to apply the migrations manually, and then on the first query, this error would throw:

 [ERROR] Uncaught (in promise) TypeError: cache.strategy is not a function

      at SQLitePreparedQuery
  (file:///Users/a/Documents/folder/node_modules/src/sqlite-core/session.ts:63:22)
      at SQLiteDOPreparedQuery
  (file:///Users/a/Documents/folder/node_modules/src/durable-sqlite/session.ts:115:3)
      at prepareQuery
  (file:///Users/a/Documents/folder/node_modules/src/durable-sqlite/session.ts:52:10)
      at prepareOneTimeQuery
  (file:///Users/a/Documents/folder/node_modules/src/sqlite-core/session.ts:251:15)
      at _prepare
  (file:///Users/a/Documents/folder/node_modules/src/sqlite-core/query-builders/select.ts:913:85)
      at all
  (file:///Users/a/Documents/folder/node_modules/src/sqlite-core/query-builders/select.ts:947:15)
      at execute
  (file:///Users/a/Documents/folder/node_modules/src/sqlite-core/query-builders/select.ts:959:15)
      at then
  (file:///Users/a/Documents/folder/node_modules/src/query-promise.ts:31:15)

Presumably, the new cache module has made it impossible to run any queries on a Durable Object. This error makes it impossible to use.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions