hugo
hugo
DTDrizzle Team
Created by hugo on 6/29/2024 in #help
Anyone had luck with copilot?
No description
2 replies
DTDrizzle Team
Created by hugo on 11/16/2023 in #help
Unable to generate migration for sqlite
Hello! After upgrading to drizzle-kit 0.20.2 from 0.19.13 I can't generate migrations anymore. I'm using libsql and the error when running
drizzle-kit generate:sqlite --schema=./src/schema/main.ts --out ./drizzle/migrations
drizzle-kit generate:sqlite --schema=./src/schema/main.ts --out ./drizzle/migrations
is about postgres:
Error: Cannot find module 'drizzle-orm/pg-core'
Error: Cannot find module 'drizzle-orm/pg-core'
Any ideas? Did the command changed? I'm not using drizzle.config file Thanks in advance!
"drizzle-kit": "^0.20.2",
"drizzle-orm": "^0.29.0",
"drizzle-kit": "^0.20.2",
"drizzle-orm": "^0.29.0",
My schema uses
import { InferSelectModel, sql } from 'drizzle-orm'
import { sqliteTable, text, blob, index } from 'drizzle-orm/sqlite-core'
import { InferSelectModel, sql } from 'drizzle-orm'
import { sqliteTable, text, blob, index } from 'drizzle-orm/sqlite-core'
If I try to downgrade to the working version, it won't allow me:
drizzle-kit: v0.19.13
drizzle-orm: v0.29.0

This version of drizzle-kit is outdated
Please update drizzle-kit package to the latest version 👍
drizzle-kit: v0.19.13
drizzle-orm: v0.29.0

This version of drizzle-kit is outdated
Please update drizzle-kit package to the latest version 👍
7 replies
DTDrizzle Team
Created by hugo on 10/31/2023 in #help
[SOLVED] How to add new column?
Hello! Any ideas how to add a new column to an existing table? What I did so far: 1. Updated the schema to add a new column:
website: text('website')
website: text('website')
2. Generated migration files, and it did create the correct SQL statement, but for some reason I don't understand, it is not applicable:
/*
SQLite does not support "Set default to column" out of the box, we do not generate automatic migration for that, so it has to be done manually
Please refer to: https://www.techonthenet.com/sqlite/tables/alter_table.php
https://www.sqlite.org/lang_altertable.html
https://stackoverflow.com/questions/2083543/modify-a-columns-type-in-sqlite3

Due to that we don't generate migration automatically and it has to be done manually
*/--> statement-breakpoint
ALTER TABLE sfdc_opportunities ADD `website` text;
/*
SQLite does not support "Set default to column" out of the box, we do not generate automatic migration for that, so it has to be done manually
Please refer to: https://www.techonthenet.com/sqlite/tables/alter_table.php
https://www.sqlite.org/lang_altertable.html
https://stackoverflow.com/questions/2083543/modify-a-columns-type-in-sqlite3

Due to that we don't generate migration automatically and it has to be done manually
*/--> statement-breakpoint
ALTER TABLE sfdc_opportunities ADD `website` text;
3. Running the migration fails with:
RangeError: The supplied SQL string contains no statements
at Database.prepare
RangeError: The supplied SQL string contains no statements
at Database.prepare
I'm using '@libsql/client' connected to Turso.
5 replies
DTDrizzle Team
Created by hugo on 10/2/2023 in #help
Query vs Select
Hello! I'm reading through the docs and absolutely loving Drizzle! One thing is still not clear to me is when to use query (https://orm.drizzle.team/docs/rqb) vs using select (https://orm.drizzle.team/docs/select). Are there performance implications, am I'm missing some differences in behavior, or it's just matter of preference? Thanks a lot!!
3 replies