micaww
micaww
DTDrizzle Team
Created by enalmada on 8/24/2023 in #help
parameterized insert and update
string also works, requires you to pass a string in though. by default timestamp expects a Date instance (that it then calls toISOString on before sending to db)
11 replies
DTDrizzle Team
Created by enalmada on 8/24/2023 in #help
parameterized insert and update
ah apologies, you're right. are you passing a Date object for that param when executing?
11 replies
DTDrizzle Team
Created by enalmada on 8/24/2023 in #help
parameterized insert and update
you don't need to use the sql.placeholder in your "where" either, just eq(TaskTable.id, 'id')
11 replies
DTDrizzle Team
Created by enalmada on 8/24/2023 in #help
parameterized insert and update
are you trying to set the title column to the string "title" in your example? you're using eq inside of set. that translates to column = 'title' which is a boolean expression, which is invalid. if you're just trying to set a value, just pass the value directly: title: 'title' it will get parameterized for you
11 replies
DTDrizzle Team
Created by nopersonalspace on 8/22/2023 in #help
`migrate()` prints to stdout
you could wrap the call and monkey patch / no-op whatever it's calling to log stuff
4 replies
DTDrizzle Team
Created by Meexa on 8/18/2023 in #help
Update column A with the value of column B
if you needed to do it in js then select for update to get the name, calculate new value, update in a transaction
6 replies
DTDrizzle Team
Created by Meexa on 8/18/2023 in #help
Update column A with the value of column B
you would need to use sql to do it in one call:
normalized_name: sql`SOMESQLFUNCTION(${characters.name})`
normalized_name: sql`SOMESQLFUNCTION(${characters.name})`
6 replies
DTDrizzle Team
Created by Nickolaki on 8/16/2023 in #help
Db race condition
likely outside the scope of drizzle though. depends on the db you're using and application requirements
38 replies
DTDrizzle Team
Created by Nickolaki on 8/16/2023 in #help
Db race condition
that's incredibly vague. what problem are you trying to solve?
38 replies
DTDrizzle Team
Created by jakeleventhal on 8/13/2023 in #help
How to define types for jsonb
6 replies
DTDrizzle Team
Created by jakeleventhal on 8/13/2023 in #help
How to define types for jsonb
the docs say to use $type<MyType>()
6 replies