SteveS
SteveS
DTDrizzle Team
Created by SteveS on 6/11/2024 in #help
Why is it the case that my IDE says `await` does nothing on pretty much every single function?
I'm trying to setup a startup script that creates a local db and seeds it when I start my project. I'm running into an error where db is just not defined or has undefined columns. I'm debugging, and I can't help but notice that my IDE says await does nothing on the migrate function or any of the db.select() calls.
2 replies
DTDrizzle Team
Created by SteveS on 3/7/2024 in #help
Missing module "pg-core" when attempting to push?
Title says most of it. I can provide details, but I'm following the example pretty closely.
1 replies
DTDrizzle Team
Created by SteveS on 10/17/2023 in #help
How to get better errors?
On line 44 in the image, there is an error where I compared the userTable to the storedToken instead of the emailVerificationTokenTable. Since this would never work, shouldn't the error be more clear? The error it throws says that the column user.id does not exist. Of course, that column does exist, it just doesn't exist on the emailVerificationTokenTable. Is there any way to get errors that reflect this kind of mistake?
2 replies
DTDrizzle Team
Created by SteveS on 10/14/2023 in #help
zod schemas, main schema, and relations in separate files
I assume it's fine to put relations, zod schemas, and the main schema in separate files, right? If I'm understanding correctly, zod schemas aren't needed by the client, so they can be wherever and migrations don't need relations, so as long as I add the relations and main schema to the client everything should work. Any unforseen issues here?
1 replies
DTDrizzle Team
Created by SteveS on 10/14/2023 in #help
drizzle-zod: remove ID from insert schema type
It doesn't seem super clear from the docs, but is there a way to remove autoIncremented values like ids from the schema?
4 replies
DTDrizzle Team
Created by SteveS on 8/16/2023 in #help
Error following push
SQLITE_UNKNOWN: SQLite error: no such table: main.__old_push_resume Not sure what to do about this. Any thoughts?
4 replies
DTDrizzle Team
Created by SteveS on 8/15/2023 in #help
How to handle adding new columns to schema?
I have a schema, but I've decided I need to add a new column. I change the schema.ts file, push, and get the error
LibsqlError: SQLITE_UNKNOWN: SQLite error: table work_experience has 7 columns but 6 values were supplied
at mapHranaError (/Users/steves/repos/side-projects/resume-builder-2/node_modules/drizzle-kit/index.cjs:48352:12)
at HranaClient.execute (/Users/steves/repos/side-projects/resume-builder-2/node_modules/drizzle-kit/index.cjs:48392:17)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async TursoSqlite.run (/Users/steves/repos/side-projects/resume-builder-2/node_modules/drizzle-kit/index.cjs:42848:9)
at async Command.<anonymous> (/Users/steves/repos/side-projects/resume-builder-2/node_modules/drizzle-kit/index.cjs:53386:9) {
code: 'SQLITE_UNKNOWN',
[cause]: [ResponseError: SQLite error: table work_experience has 7 columns but 6 values were supplied] {
code: 'SQLITE_UNKNOWN',
proto: {
message: 'SQLite error: table work_experience has 7 columns but 6 values were supplied',
code: 'SQLITE_UNKNOWN'
}
}
}
LibsqlError: SQLITE_UNKNOWN: SQLite error: table work_experience has 7 columns but 6 values were supplied
at mapHranaError (/Users/steves/repos/side-projects/resume-builder-2/node_modules/drizzle-kit/index.cjs:48352:12)
at HranaClient.execute (/Users/steves/repos/side-projects/resume-builder-2/node_modules/drizzle-kit/index.cjs:48392:17)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async TursoSqlite.run (/Users/steves/repos/side-projects/resume-builder-2/node_modules/drizzle-kit/index.cjs:42848:9)
at async Command.<anonymous> (/Users/steves/repos/side-projects/resume-builder-2/node_modules/drizzle-kit/index.cjs:53386:9) {
code: 'SQLITE_UNKNOWN',
[cause]: [ResponseError: SQLite error: table work_experience has 7 columns but 6 values were supplied] {
code: 'SQLITE_UNKNOWN',
proto: {
message: 'SQLite error: table work_experience has 7 columns but 6 values were supplied',
code: 'SQLITE_UNKNOWN'
}
}
}
I can solve this by dropping the table and then re-running the push, but I'm wondering if there is a better way to go about it,
3 replies
DTDrizzle Team
Created by SteveS on 8/15/2023 in #help
How to debug Drizzle queries
I'm executing an insert on a table, I'm gettin no errors, and yet the data is not being saved to the database. Just curious how I am supposed to debug stuff like this since I have no idea why it isn't working.
45 replies
DTDrizzle Team
Created by SteveS on 8/14/2023 in #help
Drizzle-Kit: incorrect schema.ts being used
I have some schema files in a subfolder. I have referenced the path in the drizzle.config.ts, but instead drizzle just creates a schema file in the drizzle directory next to migration files. What gives?
4 replies
DTDrizzle Team
Created by SteveS on 8/12/2023 in #help
When using Drizzle-Kit in something like SvelteKit, how should I handle the schema.ts?
Should I just let my entire drizzle folder sit inside my lib directory?
2 replies
DTDrizzle Team
Created by SteveS on 8/11/2023 in #help
Drizzle Kit - Where to store relations?
Seeing as when pull operations occur it overwrites the local schema, is there a good place to keep relations? Just relations.ts somewhere in my project?
9 replies
DTDrizzle Team
Created by SteveS on 8/11/2023 in #help
unknown command: drizzle-kit
Can't seem to get the command to work. Followed the instructions of the quick start guide. Any ideas?
24 replies
DTDrizzle Team
Created by SteveS on 8/11/2023 in #help
Drizzle Kit + Planetscale example?
I was hoping there would be an example of how to integrate the two. Planetscales docs are just OK, so I'm wondering if anyone has done this before and would be willing to share some code,
6 replies
DTDrizzle Team
Created by SteveS on 7/20/2023 in #help
How to derive type from relational query?
Hi, I was wondering if there was an easy way to generate types from relational queries that I can then use in TS. Don't seem to see anything in the docs but I could be blind.
3 replies
DTDrizzle Team
Created by SteveS on 7/13/2023 in #help
defaultNow(), onUpdateNow() not available on the datetime data type
I'm able to build this into my database, but I'm not able to express it through drizzle. What gives?
4 replies