N
Neon4w ago
plain-purple

hi guys, I have a problem with neon (i

hi guys, I have a problem with neon (i think). in my nextjs app with prisma i have an icon that shows the number of interviews and the conditions to display them (as attached). Everything works in dev, where i have a local postgress db (i am on mac). I deploy it to prod, the icon is not visible and i get the interview.lengt is 0. I check neon, i see interview table with the entry, i also see hypothesis with the entry and still nothing is shown. The only think I can see that is different in prod than in dev is the fact that neon does not save (or at least display) many-to-many columns within single table, but rather creates these separate tables where the connection between the two is made - in my local postgress i simply see in the column of the table I am looking. does anyone know what the issue might be? By the way, my app is not that small with plenty of prisma "get" calls and everything works and that one call works in dev and prod, APART from picking this interviews.. Any help would be appreciated
No description
No description
No description
5 Replies
eastern-cyan
eastern-cyan4w ago
Many-to-many relationships are done using junction tables, which is the hypothesis to interview table you see. If I understand your issue correctly, you are finding that the hypothesis and the interview table is being populated, but the junction table is empty (are there 0 rows when you check in Neon console?), which is causing your check to be 0. Is that the case? If so, would you mind sharing your prisma schema for these 2 tables, and your prisma query that writes to these tables?
like-gold
like-gold4w ago
hi Sam, thanks for the reply. not exactly. The junction table is filled and every time i create new interview i see the update in the junction table, so it appears data-wise it exist. buf ro whatever reason it is not being picked up. i also attached the prisma call - it gets all the info but the interview comes empty ONLY IN PROD as [], in dev it works. The last image i attached is the DEV where you can see the interviews with data. i did prisma db push just in case there was something there, but that did not help (as expected).
No description
No description
No description
eastern-cyan
eastern-cyan3w ago
Mhm, I see. I did some looking around and I think it might be this issue here. Try adding pgbouncer=true at the end of your connection string, so it will look something like this DATABASE_URL="postgresql://USER:PASS@endpoint/dbname?sslmode=require&pgbouncer=true". Or, you could use the non-pooled connection string and see if that works.
like-gold
like-gold3w ago
and how would that affect how neon works? my data model is quite big and everything works but this thing. very wierd
eastern-cyan
eastern-cyan3w ago
If you use pgbouncer=true and keep the pooled connection, nothing will change. It's just letting Prisma know you're using connection pooling. This not affecting your local postgres because it doesnt run pgbouncer.

Did you find this page helpful?