Skip to content

[BUG]:beta20 Migration to Cloudflare D1 fails #5602

@Kanahiro

Description

@Kanahiro

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?

1.0.0-beta.20

What version of drizzle-kit are you using?

1.0.0-beta.20

Other packages

No response

Describe the Bug

Hi folks. I'm using drizzle in some project and catching up newest release.
I found drizzle-kit migrate fails when using it with Cloudflare D1.
I researched codebase:

  1. Remote SQLite like Cloudflare D1 doesn't support transaction and therefore drizzle has sqlite-proxy module. In this module additional function batch is implemented.
  2. In migration process, session.transaction called.
    await session.transaction(async (tx) => {
  3. SQLiteRemoteSession implements transaction but it starts with begin statement. This is unsupported in Cloudflare D1.
    override async transaction<T>(

IMHO, there are two ways:

  1. use batch in transaction(): modify sqlite-proxy/session.ts
  2. implement another up-migration as up-migration/sqlite-proxy.ts and use it from sqlite-proxy/migrator.ts.

Do you have any plan to handle this?

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