tacomanator
tacomanator
DTDrizzle Team
Created by hemant1770 on 3/19/2024 in #help
Sqlite - Inserted rows do not get pushed from cache to the disk
what does the line above that where you define sqlite look like? did you try turning the logger on?
const db = drizzle(sqlite, { schema, logger: true });
const db = drizzle(sqlite, { schema, logger: true });
what happens if you put the insert query and select query all in the same file directly below where your exporting db the variable?
3 replies
DTDrizzle Team
Created by iCode on 3/17/2024 in #help
helper function parameter type
If you're doing this a lot, you might consider declaring a type:
export type SelectBusinessApplication = InferSelectModel<typeof businessapplication>;
export type SelectBusinessApplication = InferSelectModel<typeof businessapplication>;
And using that throughout the app. I am just assuming this reduces the overall work of the type checker.
3 replies
DTDrizzle Team
Created by tacomanator on 12/25/2023 in #help
drizzle-kit snapshot files malformed error
I was able to resolve this. There was a composite primary key which had a columns property but not a name property. I manually added the name in the appropriate spot in all of the past snapshot files in which the corresponding key existed.
2 replies
DTDrizzle Team
Created by Thogn on 9/27/2023 in #help
how to set default null to an int column
Did you check the log to see the SQL being generated for insert? https://orm.drizzle.team/docs/goodies#logging
9 replies
DTDrizzle Team
Created by tacomanator on 9/27/2023 in #help
drizzle-kit tsconfig.json paths alias
This was a duplicate sorry about that. I was able to fix it by registering the paths manually in the drizzle config as suggested here: https://discord.com/channels/1043890932593987624/1125147482364584007/1154633287805976606 Not sure why the
”ts-node": { "require": ["tsconfig-paths/register"] }
”ts-node": { "require": ["tsconfig-paths/register"] }
also present in tsconfig was failing but anyway that’s a separate topic.
3 replies
DTDrizzle Team
Created by Thogn on 9/27/2023 in #help
how to set default null to an int column
are you sure you're not passing a blank string value when inserting? what happens if you add
.default(sql`NULL`)
.default(sql`NULL`)
to the column def?
9 replies
DTDrizzle Team
Created by Thogn on 9/27/2023 in #help
how to set default null to an int column
9 replies
DTDrizzle Team
Created by isitayush on 5/14/2023 in #help
I think I don't really understand migrations local sqlite.
It's not hard to just write a small script to execute the code... takes about 2 minutes.
13 replies
DTDrizzle Team
Created by anthonyshew on 5/4/2023 in #help
Trying to write next-auth adapter
anytime thank you too!
81 replies
DTDrizzle Team
Created by anthonyshew on 5/4/2023 in #help
Trying to write next-auth adapter
i had the same thought... then https://github.com/drizzle-team/drizzle-orm/issues/556 may not even be needed...
81 replies
DTDrizzle Team
Created by anthonyshew on 5/4/2023 in #help
Trying to write next-auth adapter
It seems like default: true causes it to bypass toDriver when the value is undefined, assuming that the database will take care of it?
81 replies