SQL many statements?

Any ideas on how to debug this?
Task migrations deno run -A src/lib/db/migrations.ts
error: Uncaught (in promise) LibsqlError: SQL_MANY_STATEMENTS: SQL string contains more than one statement
at mapHranaError (file:///Users/fharris/Projects/jobasaurus-crawler/node_modules/.deno/@libsql+client@0.4.3/node_modules/@libsql/client/lib-esm/hrana.js:257:16)
at HttpTransaction.batch (file:///Users/fharris/Projects/jobasaurus-crawler/node_modules/.deno/@libsql+client@0.4.3/node_modules/@libsql/client/lib-esm/hrana.js:105:19)
at Object.runMicrotasks (ext:core/01_core.js:642:26)
at processTicksAndRejections (ext:deno_node/_next_tick.ts:39:10)
at runNextTicks (ext:deno_node/_next_tick.ts:48:3)
at eventLoopTick (ext:core/01_core.js:175:21)
at async file:///Users/fharris/Projects/jobasaurus-crawler/node_modules/.deno/drizzle-orm@0.28.6/node_modules/drizzle-orm/session-afae3551.mjs:926:25
at async LibSQLSession.transaction (file:///Users/fharris/Projects/jobasaurus-crawler/node_modules/.deno/drizzle-orm@0.28.6/node_modules/drizzle-orm/libsql/index.mjs:86:28)
at async SQLiteAsyncDialect.migrate (file:///Users/fharris/Projects/jobasaurus-crawler/node_modules/.deno/drizzle-orm@0.28.6/node_modules/drizzle-orm/session-afae3551.mjs:922:9)
at async file:///Users/fharris/Projects/jobasaurus-crawler/src/lib/db/migrations.ts:4:1
Caused by: ResponseError: SQL string contains more than one statement
Task migrations deno run -A src/lib/db/migrations.ts
error: Uncaught (in promise) LibsqlError: SQL_MANY_STATEMENTS: SQL string contains more than one statement
at mapHranaError (file:///Users/fharris/Projects/jobasaurus-crawler/node_modules/.deno/@libsql+client@0.4.3/node_modules/@libsql/client/lib-esm/hrana.js:257:16)
at HttpTransaction.batch (file:///Users/fharris/Projects/jobasaurus-crawler/node_modules/.deno/@libsql+client@0.4.3/node_modules/@libsql/client/lib-esm/hrana.js:105:19)
at Object.runMicrotasks (ext:core/01_core.js:642:26)
at processTicksAndRejections (ext:deno_node/_next_tick.ts:39:10)
at runNextTicks (ext:deno_node/_next_tick.ts:48:3)
at eventLoopTick (ext:core/01_core.js:175:21)
at async file:///Users/fharris/Projects/jobasaurus-crawler/node_modules/.deno/drizzle-orm@0.28.6/node_modules/drizzle-orm/session-afae3551.mjs:926:25
at async LibSQLSession.transaction (file:///Users/fharris/Projects/jobasaurus-crawler/node_modules/.deno/drizzle-orm@0.28.6/node_modules/drizzle-orm/libsql/index.mjs:86:28)
at async SQLiteAsyncDialect.migrate (file:///Users/fharris/Projects/jobasaurus-crawler/node_modules/.deno/drizzle-orm@0.28.6/node_modules/drizzle-orm/session-afae3551.mjs:922:9)
at async file:///Users/fharris/Projects/jobasaurus-crawler/src/lib/db/migrations.ts:4:1
Caused by: ResponseError: SQL string contains more than one statement
The generate SQL its trying to run is
ALTER TABLE `job` ADD `min_salary` integer;--> statement-breakpoint
ALTER TABLE `job` ADD `max_salary` integer;--> statement-breakpoint
ALTER TABLE `job` DROP COLUMN `salary`;
ALTER TABLE `job` ADD `min_salary` integer;--> statement-breakpoint
ALTER TABLE `job` ADD `max_salary` integer;--> statement-breakpoint
ALTER TABLE `job` DROP COLUMN `salary`;
Using sqlite/turso and deno. Thanks!
H
hirefrank14d ago
I've upgraded to the last versions of libsql, drizzle-kit and drizzle-orm but keep getting the same error any ideas folks?
S
ShaneCodes7d ago
Running into the same issue.
AS
Andrii Sherman7d ago
Looking into it
A
Angelelz6d ago
Isn't that the purpose of the breakpoints?
AS
Andrii Sherman6d ago
yes, strange it didn't work --> statement-breakpoint should do the trick
Want results from more Discord servers?
Add your server
More Posts
Querying a materialized view: relation does not existI define a materialized view as such: ``` export const usersMv = pgMaterializedView("users_mv").as( default to empty object for sqlite text field with JSON modeHow can I default a `mode: 'json'` text type to an empty object in sqlite? The following in a `sqliConverting a field from X type to Serial causes errorsI'm attempting to convert a field from type `text` to type `serial`. Here's the error I'm seeing: `Return type is only "with" types, ignores "columns" typesNot sure if I'm using it wrong but the return type of a relational query is just the columns from thonUpdateupdatedAt: timestamp('updated_at', { mode: 'date', precision: 3 }) .defaultNow() .$onUpdate(Struggling with subqueriesI want to basically do this query in drizzle: SELECT o.id, o.date, t.currency FROM "Operations" o LENot clear what happens during migrateI have a sandbox project and have properly created a migrate that created the initial schema, and apmax connections time out```typescript import { Injectable, Scope } from '@nestjs/common'; import { Pool, PoolConfig } from 'CI/CD check if schema matches databaseHi, is there a way use drizzle-kit or drizzle itself to check if the database structure matches the 'drizzle-kit introspect:pg' generates invalid Typerscript syntax ("::character varying", "NULL")When I use , it generates my schema.ts file, but includes syntax that is invalid, such as: ``` expoCan I create a one to one relationship that would actually fetch the last item?The relationship is actually a one to many but only want to retrieve the last one. goal: one(goalclasses to access dbIs this code possible? Copilot says it's valid but I cannot find it in the documentation ``` importQuery "with" not populatedI have a collection relation and a file relation. I want to query a collection and all their files. Duplicate parentHey, I have a large schema with many tables and many relations. I would like to duplicate a parent rDynamic read replicasI have a use case that read replicas are dynamically located using Service Discovery and I need to sSQLite functions not being calledI think I might've found a bug. At least in Studio, maybe in orm as well. Could someone please verif