Frederic
Explore posts from serversDTDrizzle Team
•Created by Frederic on 12/7/2023 in #help
[solved] Parameterized Column Selection
I would like have a function that makes a select(). This function takes a parameter that specify the columns that need to be retrieved. Obviously, I would like the proper type to be inferred for the result.
I could find the following code that works properly for Postgres.
example implementation Pg - ts playground
I made a 1:1 modification to make it work with MySql. Here is the modified code:
implementation converted to MySql
Unfortunately, the type
Awaited<MySqlSelectBase<any, P, "partial">>
does not seem to work. MySqlSelectBase
does not work exactly like PgSelectBase
. A parameter seems to be missing.
I checked if the AI could unravel this problem without success.
If anybody knowledgeable about the inner working of drizzle knows how to solve this, this would be appreciated.2 replies