shmookoff
Explore posts from serversDTDrizzle Team
•Created by shmookoff on 6/22/2024 in #help
Zod table+field descriptor generic schema
I'm building a tRPC procedure for listing rows from a table.
I want the user to control the ordering of result by supplying an array of objects with table and the corresponding column name.
This works:
I wanted to create a generic function for constructing the descriptor schema based on provided table:
However, I've stumbled upon the following error:
Which (I think) is related to this.
Any help would be greately apprecieated, as I'm really stuck at this...
1 replies
DTDrizzle Team
•Created by shmookoff on 6/4/2024 in #help
Run migrations inside of a Docker container
I have a dockerized Next.js application. The image only contains built application (
dist
folder).
I want to be able to run migrations from within running application container.
My first thought was to create a migration script using the example from docs - https://orm.drizzle.team/docs/migrations and compile it at image building stage. However, I don't have enough experience with tsc
to accomplish the goal.
I don't want to use tsx
as this would add complexity to the image (eg. copy all of the dependencies for db.ts
) .
How would you accomplish this?1 replies