© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•2y ago•
4 replies
zidawg

Turso Schema Database migration with drizzle-orm/libsql/migrator

hi all, having this issue with migrations using drizzle for turso schema databases (--type schema), is this somehow affected by turso running these migrations as transactions internally, and drizzle trying to run the migrations in transactions too, causing "the migration is already run within a transaction" error?

6 | rawCode;
7 | constructor(message, code, rawCode, cause) {
8 | if (code !== undefined) {
9 | message =
${code}: ${message}
${code}: ${message}
;
10 | }
11 | super(message, { cause });
^
LibsqlError: SCHEMA_MIGRATION_ERROR: Schema migration error: migration is invalid: it contains transaction items (BEGIN, COMMIT, SAVEPOINT...) which are not allowed. The migration is already run within a transaction
code: "SCHEMA_MIGRATION_ERROR"

at new LibsqlError (/node_modules/@libsql/core/lib-esm/api.js:11:9)
at mapHranaError (/node_modules/@libsql/client/lib-esm/hrana.js:257:16)
at /node_modules/@libsql/client/lib-esm/http.js:85:19

1 | / Generic error produced by the Hrana client. */
2 | export class ClientError extends Error {
3 | /
@private */
4 | constructor(message) {
^
ResponseError: Schema migration error: migration is invalid: it contains transaction items (BEGIN, COMMIT, SAVEPOINT...) which are not allowed. The migration is already run within a transaction
code: "SCHEMA_MIGRATION_ERROR"

at /node_modules/@libsql/hrana-client/lib-esm/errors.js:4:11
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Unable to use drizzle-orm migrator with drizzle-kit
Drizzle TeamDTDrizzle Team / help
2y ago
LibSQL type errors when using `drizzle-orm/libsql` import
Drizzle TeamDTDrizzle Team / help
15mo ago
Count issues with libsql (Turso)
Drizzle TeamDTDrizzle Team / help
12mo ago
"drizzle-orm/planetscale-serverless/migrator" in cf workers
Drizzle TeamDTDrizzle Team / help
3y ago