t3-oss / create-t3-turbo

Clean and simple starter repo using the T3 Stack along with Expo React Native
https://turbo.t3.gg
MIT License
4.28k stars 352 forks source link

bug: `drizzle-orm/expressions` does not include `sql`, `count`, `sum`, etc. #979

Closed ahkhanjani closed 2 months ago

ahkhanjani commented 2 months ago

Provide environment information

-

Describe the bug

There's been a change to the db package recently that exports * from drizzle-orm/expressions instead of drizzle-orm. This doesn't include some of the necessary functions from drizzle-orm/sql.

Link to reproduction

-

To reproduce

-

Additional information

No response

juliusmarminge commented 2 months ago

Feel free to PR - I felt like it was a good change so you dont export everything including all the table and column definitions.

But the sql function is definetely useful

dBianchii commented 2 months ago

You can export those from "drizzle-orm/sql" I believe. We should do a PR for it. Are there other implicit helpers that exist elsewhere in drizzle that you are missing?

ahkhanjani commented 2 months ago

I inspected the source code. Here's how things are exported:

./sql: Contains /expressions, /functions subdirectories and a sql.js and exports all three. ./expressions: Re-exports /sql/expressions.

functions contains aggregation functions. So Everything in it is necessary. sql.js seems to have some unnecessary objects in it.

I'll make a PR for the most minimal export possible.