`.orderBy` influence `sql` output
With the following code:
I get the following output:
Why would the
orderBy
influence the computed column isUsed
(the expected result is true
)?6 Replies
If I remove the
.mapWith
, things get more funny:
The output:
Is used is casted as a string in the first query, and as a number in the second query.
Yesterday, I already mentioned I was surprised the case when .. then 1 else 0 end
would be casted a string.
https://discord.com/channels/1043890932593987624/1179094189615628348
But now, it's even weirder. Why would the orderBy cast it "normally"?Wow, this is definitely extra weird! 🤷
ikr 🙈
I think this is interesting. I'll do some research and reach out to MySql2 author for his thoughts
Should I open an issue on Drizzle's Github for the sake of tracking this?
No, I don't think it's a drizzle issue, let me investigate. I know drizzle is doing nothing to map the result and change the type because it doesn't have any knowledge of what is getting queried with
sql