storage icon indicating copy to clipboard operation
storage copied to clipboard

Extend documentation on postgres sql with Kysely

Open willhama opened this issue 1 year ago • 0 comments

Dear Vercel Team,

I would really appreciate better documentation on the Postgres library and its ORM vendors.

I am now using Kysely and it was nowhere described how the table is created inside the database. I was able to find it by looking at the Kysely demo. However, they used a method that is not a production-ready solution either. It just creates the table and populates it when the application starts.

I have now written a script that creates the table once and I can use it from my server actions.

This brings me to a second problem where I cannot find any documentation:

I need one database for different environments: dev, preview and prod.

I have now created a second database for prod only. But I still need to create the table on it. What's the recommended way to create the tables based on the environment? Also, I don't know how to tell my Kysely client to create the tables on the prod database locally. Or even how to connect to a different database at all.

Any suggestion would be highly appreciated :)

willhama avatar Jun 07 '24 15:06 willhama