Angelelz
DTDrizzle Team
•Created by mattiaferrari on 11/14/2024 in #help
sql magic operator with dates?
See this example https://drizzle.run/vihy2j6udcupo6u525z55u22
5 replies
DTDrizzle Team
•Created by mattiaferrari on 11/14/2024 in #help
sql magic operator with dates?
You could use it like this:
In the case when you want to use the decoder in the createdAt column of the users table
5 replies
DTDrizzle Team
•Created by mattiaferrari on 11/14/2024 in #help
sql magic operator with dates?
But there is an undocumented method in the sql operator to make this type of stuff easier to operate
5 replies
DTDrizzle Team
•Created by mattiaferrari on 11/14/2024 in #help
sql magic operator with dates?
When you use the sql operator you have to do that manually
5 replies
DTDrizzle Team
•Created by Anthony on 11/12/2024 in #help
Struggling with simple subquery statement in Drizzle
I don't see any issues with this https://drizzle.run/vihy2j6udcupo6u525z55u22
5 replies
DTDrizzle Team
•Created by Anthony on 11/12/2024 in #help
Struggling with simple subquery statement in Drizzle
If you put this in drizzle.run it's easier to take a look and make quick changes
5 replies
DTDrizzle Team
•Created by gwilliamnn on 11/11/2024 in #help
With Query mode, is possible filter by a related table?
There are ways. Take a look at this reply https://discord.com/channels/1043890932593987624/1303402726897750059/1303787075325136917
3 replies
DTDrizzle Team
•Created by RUNNb on 11/10/2024 in #help
Rollback not happening on tx.rollback() [PG DRIVER]
Worst of all, the transaction callback is probably returning before the forEach even gets a chance to be called
7 replies
DTDrizzle Team
•Created by RUNNb on 11/10/2024 in #help
Rollback not happening on tx.rollback() [PG DRIVER]
The async callback passed to forEach is very likely running in a different async context to the transaction, so if an error gets thrown, that call back doesn't know about it. Furthermore, throwing inside, probably doesn't reach to the transaction callback
7 replies
DTDrizzle Team
•Created by RUNNb on 11/10/2024 in #help
Rollback not happening on tx.rollback() [PG DRIVER]
Also, I'm not sure how smart is it to pass an async function to forEach. I would advice to use
for await (const category of categories)
7 replies
DTDrizzle Team
•Created by RUNNb on 11/10/2024 in #help
Rollback not happening on tx.rollback() [PG DRIVER]
The first query inside the transaction uses the db object, basically bypassing the transaction and running the query in a different connection. You have to use the
tx
object passed to the callback.7 replies
DTDrizzle Team
•Created by UrosHCS on 11/8/2024 in #help
Postgres tables with same name but different schema
I know they will fix it in RQB v2
4 replies
DTDrizzle Team
•Created by UrosHCS on 11/8/2024 in #help
Postgres tables with same name but different schema
I might be wrong, but I don't believe relations currently respect schemas
4 replies
DTDrizzle Team
•Created by karadz. on 11/7/2024 in #help
TypeError: db.execute is not a function
The docs are wrong there, for SQLite you have run, get, values and all
3 replies
DTDrizzle Team
•Created by tc on 11/5/2024 in #help
Using relation columns in where clause (Drizzle playground provided)
The subquery is not a request, I wrote it that way for readability
11 replies
DTDrizzle Team
•Created by tc on 11/5/2024 in #help
Using relation columns in where clause (Drizzle playground provided)
It does not require two trips to the database, you can delete the first request and is still going to work
11 replies
DTDrizzle Team
•Created by adrtivv on 11/6/2024 in #help
column is of type date but expression is of type text
Also, try putting an else condition to your case statement
6 replies
DTDrizzle Team
•Created by adrtivv on 11/6/2024 in #help
column is of type date but expression is of type text
Just write null in the sql operator
6 replies
DTDrizzle Team
•Created by adrtivv on 11/6/2024 in #help
column is of type date but expression is of type text
Try not passing null as parameter
6 replies
DTDrizzle Team
•Created by adrtivv on 11/6/2024 in #help
column is of type date but expression is of type text
Without seeing the code it's impossible to see if there's something wrong
6 replies