1

I have just started using pgx and bun with Golang and I need to start testing my repository implementation. I am struggling to understand if I can use an embedded postgres db and what would be the best choice. Any suggestion is more than welcome

Thank you

panza
  • 1,341
  • 7
  • 38
  • 68

1 Answers1

2

No, PostgreSQL cannot run as an embedded database. It can run as in-memory database, however, if you give it enough memory.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
  • Thanks, sounds good. Would you have any example to point me to for an in-memory databse that I can use? I have started using https://bun.uptrace.dev/ and it has a nice features called ```fixtures```: https://bun.uptrace.dev/guide/fixtures.html#creating-fixtures: https://github.com/uptrace/bun/blob/master/example/fixture/main.go and perhaps this might be a nice way to go? What is your view? – panza Oct 09 '22 at 17:29
  • I have no overview, and asking for recommendations for software is off topic. But it sure ain't PostgreSQL. – Laurenz Albe Oct 09 '22 at 21:24
  • OK, not an issue. However, I clearly stated that I am using pgx and bun in my question, so I do not see this can be construed as off topic. Besides, my question is tagged with both pgx and bun – panza Oct 09 '22 at 22:07
  • I agree - I was talking about the question you asked in your comment, not your original question. – Laurenz Albe Oct 10 '22 at 03:59