patrick
patrick
Explore posts from servers
DTDrizzle Team
Created by patrick on 10/18/2024 in #help
Rollup failed to resolve import vite-plugin-node-polyfills/shims/buffer from drizzle-orm/sqlite-core
I just started getting this error: drizzle-orgm: 0.35.2 vite-plugin-node-polyfills: 0.22.0 [vite]: Rollup failed to resolve import "vite-plugin-node-polyfills/shims/buffer" from "/tmp/seed/source/packages/core/node_modules/drizzle-orm/sqlite-core/columns/blob.js". it works locally, but fails when building in seed (via SST).
1 replies
DTDrizzle Team
Created by patrick on 7/23/2024 in #help
update multiple rows with uuid id's
I found a great post by @Andrew Sherman from 2023 describing how to construct a case/when for updating multiple rows in one update. My id's are uuid, and a simple translation of his example (which uses integer ids), fails with the dreaded "operator does not exist: uuid = character varying" error. i've tried adding cast ( as uuid) in several places and can't seem to find it. Here's the toSQL() of a simple single entry update... can anyone spot what i'm missing? Thanks! query { sql: 'update "shows" set "gross" = (case when "shows"."id" = :1 then :2 end) where "shows"."id" in (:3)', params: [ '397ac0a7-d8e3-4a2e-8dcf-789ee99638a5', 1, '397ac0a7-d8e3-4a2e-8dcf-789ee99638a5' ] }
3 replies
DTDrizzle Team
Created by patrick on 5/23/2024 in #help
I made a change, yet generate says "No schema changes, nothing to migrate"
i added a column to a table balance: integer("balance") and drizzle-kit generate:pg generated the correct migration: ALTER TABLE "mytable" ADD COLUMN "balance" integer; then i went and backfilled in the values into the mytable since i really wanted it to be notNull(). then I came back and added .notNull(): balance: integer("balance").notNull() when I rerun drizzle-kit generate:pg it says "No schema changes, nothing to migrate" is this a bug? drizzle-kit 0.21.2
4 replies
DTDrizzle Team
Created by patrick on 2/5/2024 in #help
order by case clause possible?
No description
2 replies
DTDrizzle Team
Created by patrick on 9/6/2023 in #help
drizzle-kit failing with Top-level await is currently not supported with the "cjs" output format
Can't seem to get drizzle-kit generate to run? PS \sst\packages\core> node --version v18.17.1 PS \sst\packages\core> yarn drizzle-kit generate:pg yarn run v1.22.19 warning package.json: No license field $ \sst\node_modules.bin\drizzle-kit generate:pg drizzle-kit: v0.19.13 drizzle-orm: v0.28.5 No config path provided, using default 'drizzle.config.ts' Reading config file 'C:\git\triad\sst-triad\packages\core\drizzle.config.ts' Error: Transform failed with 1 error: C:\git\triad\sst-triad\node_modules\sst\node\util\index.js:15:21: ERROR: Top-level await is currently not supported with the "cjs" output format
6 replies