drizzle-team / drizzle-team/drizzle-orm
[BUG]: Cannot push to a Turso schema database with @libsql/client version greater than 0.6.0
- Dominant language
- TypeScript
- Stars
- 35.8k
- Forks
- 1.6k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 4
Description
### What version of `drizzle-orm` are you using?
0.31.2
### What version of `drizzle-kit` are you using?
0.22.8
### Describe the Bug
From drizzle-kit-mirror repo: https://github.com/drizzle-team/drizzle-kit-mirror/issues/484.
> 1. Have installed any version of `@libsql/client` greater than 0.6.0
>
> 2. Create a "schema" database on Turso
>
> * `turso db create schema-database --type schema`
>
> 3. Attempt to use `drizzle-kit push` to the schema database
>
>
> Upon completing step 3 I receive an error:
>
> ```
> ❯ pnpm drizzle-kit push --config .ts
> drizzle-kit: v0.22.8
> drizzle-orm: v0.31.2
>
> Custom config path was provided, using '.ts'
> Reading config file ''
> [⣷] Pulling schema from database...
> Error: No migrations found
> at getLastMigrationJob (file:////node_modules/.pnpm/@libsql+client@0.7.0/node_modules/@libsql/client/lib-esm/migrations.js:79:15)
> at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
> at async waitForLastMigrationJobToFinish (file:////node_modules/.pnpm/@libsql+client@0.7.0/node_modules/@libsql/client/lib-esm/migrations.js:97:30)
> at async file:////node_modules/.pnpm/@libsql+client@0.7.0/node_modules/@libsql/client/lib-esm/http.js:79:21
> at async Object.query (/node_modules/.pnpm/drizzle-kit@0.22.8/node_modules/drizzle-kit/bin.cjs:119857:27)
> at async fromDatabase3 (/node_modules/.pnpm/drizzle-kit@0.22.8/node_modules/drizzle-kit/bin.cjs:22311:23)
> ```
>
> I've tested and it works fine with `@libsql/client@0.6.0`.
>
> I do not know if this is an issue with drizzle or if it's an issue with `@libsql/client`.
>
> I suspect this commit ([tursodatabase/libsql-client-ts#206](https://github.com/tursodatabase/libsql-client-ts/pull/206)) which was added in `@libsql/client@0.6.1` is responsible for issue, though I have not done further digging/testing.
### Expected behavior
_No response_
### Environment & setup
_No response_
Contributor guide
Research direction
Start with the drizzle-kit push schema-pull path and the @libsql/client migrations.js call shown in the stack trace; compare behavior between versions 0.6.0 and 0.7.0, then inspect the referenced libsql-client change. Done means pushing to a Turso schema database succeeds with a client version greater than 0.6.0; verify using the listed versions and reproduction command.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sqlite, typescript
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100