baptisteArno / typebot.io

💬 Typebot is a powerful chatbot builder that you can self-host.
https://typebot.io
Other
7.32k stars 2.01k forks source link

Support both Transaction connection pooler and Session connection pooler for postgres #1808

Closed systems-move-dev closed 2 weeks ago

systems-move-dev commented 3 weeks ago

Is your feature request related to a problem? Please describe. Right now we are forced to use Session mode connection to supabase as from .env we can only configure 1 database url and prisma migrations required session mode. This creates many db connections on supabase, which sometimes run out.

Describe the solution you'd like Support the directUrl in schema. prisma. Internally Prismic would select the best connection for each

Describe alternatives you've considered I tried doing 2 runs - one for migrations where the db connection string in env is set to the session mode string, and when all migrations are ran, update db connection string env to the transaction mode string. But while the migrations are successful as expected, the next run fails to connect to the db as it still tries to run some migration ops that expects the session mode connection.

Other alternative I can think of is to turn off prisma migrations using env, but couldn't find that option.

baptisteArno commented 2 weeks ago

https://github.com/baptisteArno/typebot.io/issues/1712