bloberenober
bloberenober
DTDrizzle Team
Created by addamsson on 6/10/2024 in #help
Drizzle complains when I'm trying to insert into a table.
you can also change mode to date for createdAt and updatedAt columns instead
5 replies
DTDrizzle Team
Created by Jaymal on 4/4/2024 in #help
Timestamp formatted differently if fetched as relation rather than directly
yes, please copy it
17 replies
DTDrizzle Team
Created by Jaymal on 4/4/2024 in #help
Timestamp formatted differently if fetched as relation rather than directly
just to keep track
17 replies
DTDrizzle Team
Created by Jaymal on 4/4/2024 in #help
Timestamp formatted differently if fetched as relation rather than directly
thank you could you also create an issue on GitHub and link it to this thread?
17 replies
DTDrizzle Team
Created by Jaymal on 4/4/2024 in #help
Timestamp formatted differently if fetched as relation rather than directly
could you provide your schema w/ relations and the query samples?
17 replies
DTDrizzle Team
Created by Jaymal on 4/4/2024 in #help
Timestamp formatted differently if fetched as relation rather than directly
what do you mean "queried directly"? could you provide your queries in code?
17 replies
DTDrizzle Team
Created by jakeleventhal on 3/19/2024 in #help
How do you use batch API with local development
not at the moment, batch is not implemented in all drivers
3 replies
DTDrizzle Team
Created by Ꚃimon on 8/9/2023 in #help
Nullable relational query?
in any case, we've designed a new API for defining relations, so some of the issues will be solved when it lands
15 replies
DTDrizzle Team
Created by Ꚃimon on 8/9/2023 in #help
Nullable relational query?
should be possible
15 replies
DTDrizzle Team
Created by Doron Torangy on 7/14/2023 in #help
Get type for select query?
import { SelectedFields } from 'drizzle-orm/pg-core';

async function getUsers<T extends SelectedFields>(fields: T) {
return db.select(fields).from(users);
}
import { SelectedFields } from 'drizzle-orm/pg-core';

async function getUsers<T extends SelectedFields>(fields: T) {
return db.select(fields).from(users);
}
6 replies
DTDrizzle Team
Created by francis on 12/28/2023 in #help
Does calling `drizzle()` multiple times on the same db client instance consume more resources?
yea, drizzle() call only wraps an existing connection, so you can create as many Drizzle instances as you need
7 replies
DTDrizzle Team
Created by fermentfan on 7/30/2023 in #help
Mocking Drizzle instance
there's nothing specific to Drizzle that can't be mocked like anything else
20 replies
DTDrizzle Team
Created by fermentfan on 7/30/2023 in #help
Mocking Drizzle instance
or if you are using vitest it has its own mocking API I think
20 replies
DTDrizzle Team
Created by fermentfan on 7/30/2023 in #help
Mocking Drizzle instance
why not use something like sinon to stub/mock specific methods on the db?
20 replies
DTDrizzle Team
Created by sakura on 10/6/2023 in #help
[Error] Using Drizzle with Neon DB
people have been using Neon with Drizzle successfully, so there should be a way I don't really know what do you need to change though
12 replies
DTDrizzle Team
Created by sakura on 10/6/2023 in #help
[Error] Using Drizzle with Neon DB
yes, Drizzle internally prepares every query before execution
12 replies
DTDrizzle Team
Created by sexnine on 7/6/2023 in #help
[Relational Queries] Nullable one-to-one relationship
yep, we have it on the task list
8 replies
DTDrizzle Team
Created by nobody on 9/27/2023 in #help
How to use drizzle as a sql builder?
I think Drizzle passes along the response from databasejs in that case, no? In any case, you can invoke .toSQL() on any query builder to get the SQL string and params list.
3 replies
DTDrizzle Team
Created by zendev on 9/26/2023 in #help
environment variables undefined in drizzle.config.ts
drizzle-kit doesn't automatically load values from .env for now, so you need to use the dotenv package.
4 replies
DTDrizzle Team
Created by Gruntilda on 9/26/2023 in #help
Best way to get raw SQL for a SQLite insert statement (with inline parameters)?
you shouldn't really inline the parameters as it's a road to SQL injections. But if you must, the way you came up with is good enough.
3 replies