opaldraggy
DTDrizzle Team
•Created by Gabriel Lucena on 11/18/2024 in #help
Running SQL statement manually for in-memory database
If you cant find an implementation that's exposed publicly by drizzle itself, try:
before your migrations, and then:
after.
25 replies
DTDrizzle Team
•Created by Gabriel Lucena on 11/18/2024 in #help
Running SQL statement manually for in-memory database
you can turn off foreign key constraints while you're doing the migration, and turn them back on after. I believe that's what some of the migration batching scripts do in drizzle.
25 replies
DTDrizzle Team
•Created by Gabriel Lucena on 11/18/2024 in #help
Running SQL statement manually for in-memory database
I think it's ~ documented here: https://orm.drizzle.team/docs/drizzle-kit-push
25 replies
DTDrizzle Team
•Created by Gabriel Lucena on 11/18/2024 in #help
Running SQL statement manually for in-memory database
But mentioning in case it's useful.
25 replies
DTDrizzle Team
•Created by Gabriel Lucena on 11/18/2024 in #help
Running SQL statement manually for in-memory database
I recently found out you can also "push" the entire schema to the DB at once instead of running individual migrations -- but I'm not sure whether that's exposed as its own API; and tbh, I personally trust it less.
25 replies
DTDrizzle Team
•Created by Gabriel Lucena on 11/18/2024 in #help
Running SQL statement manually for in-memory database
Aside: you may want to remove your email from being shared above. Depending on how much you like being spammed by bots that harvest emails from various public places.
25 replies
DTDrizzle Team
•Created by Gabriel Lucena on 11/18/2024 in #help
Running SQL statement manually for in-memory database
also: drizzle can make it a little hard to track down the actual sql errors; so if you can find a lower-level interface to run the sql, you might get better debugging info (like directly using libsql)
25 replies
DTDrizzle Team
•Created by Gabriel Lucena on 11/18/2024 in #help
Running SQL statement manually for in-memory database
I suspect that you need to
split
on --> statement-breakpoint
and run any non-empty results as separate statements.25 replies
DTDrizzle Team
•Created by Budi on 10/27/2024 in #help
How to keep dev and production DBs in sync?
@Budi more details would be useful about the migration you are trying to run. The error message implies a syntax error in the SQL that's being applied; so it would be useful to know which migration it's failing on. Have you tried applying the migrations one at a time until you find the failing one?
Also, I would consider minimizing changes per migration to be useful best practice. Limited to one easily-described logical change.
8 replies
DTDrizzle Team
•Created by opaldraggy on 10/27/2024 in #help
Json column type returning as plain string?
aand further debugging shows that drizzle is producing the correct
params
without doing any unnecessary escaping, so it's something I'm doing to the data after it comes out of drizzle and into my sqlite proxy. 🎉6 replies
DTDrizzle Team
•Created by opaldraggy on 10/27/2024 in #help
Json column type returning as plain string?
I'm on version
0.35.3
.6 replies
DTDrizzle Team
•Created by opaldraggy on 10/27/2024 in #help
Json column type returning as plain string?
The behavior seems eerily similar to https://github.com/drizzle-team/drizzle-orm/issues/724, but I'm not using
posgres-js
, but rather a sqlite text column and the proxy http driver.6 replies
DTDrizzle Team
•Created by opaldraggy on 10/27/2024 in #help
Json column type returning as plain string?
Confirmed: the data stored in sqlite is
"[\"Mary Shelley\"]"
; and regular string column data is also saved as "foo"
(instead of foo
and [\"Mary Shelley\"]
).6 replies
DTDrizzle Team
•Created by opaldraggy on 10/27/2024 in #help
Json column type returning as plain string?
🤔 given I'm using the proxy http driver, and given that I don't see other issues filed with this same error, I'm guessing it's not a widespread bug. Instead; I'm guessing that data is getting double-escaped somewhere on the way in, and then escaped only once on the way out.
6 replies