sadmann7 / shadcn-table

Shadcn table with server-side sorting, filtering, and pagination.
https://table.sadmn.com
MIT License
3.09k stars 254 forks source link

[feat]: Unjoin drizzle-orm (schema definition and query build) #652

Open tecoad opened 3 weeks ago

tecoad commented 3 weeks ago

Feature description

Hi.

This is a great project. However using it on an existing codebases makes it very much difficult to adhere. For example, last week I integrated on my project which uses Supabase successfully converting to (postgrest query builder). It took me a few hours though.

However, there was a huge refactoring (44 files) recently to fix the count on filters, which made it mostly impossible to keep up. Also, currently there is much dead code (for example mostly of utils.ts). You could suggest me to use drizzle on the data-table specifically, and i would agree with that. I spent a few hours doing that, however, the code itself is also so much relied on the schema definition, which makes this almost an impossible task.

Even though i was willing to use drizzle to make it easier on the query builder part and make easier to maintain, turns down that i just cannot use it to define my table structure.

So in my humble opinion, code should be more detachable in the aspect of defining schema/and consuming the schema on query buillders. At the moment, they are much binded. At the end, in spite of being a great project, it mostly serves as an inspiration, because its very hard to adhere in current codebases, must be said.

What do you think?

Additional Context

Additional details here...

Before submitting

sadmann7 commented 3 weeks ago

it shouldn't be that hard to integrate with existing drizzle project.

the db utils stuffs were just a bunch of utils that i use for my other drizzle projects, you can just skip them if those are irrelevant to you.

you just need to update the schema, and the query, that should be enough.

in which parts are you having trouble implementing?

i can help you set it up, if you want