Replies: 4 comments
-
Hi @karlhorky Do you have an idea how the surface api for this should look? Maybe I don't understand the use case from slonik you linked, but it looks a bit convoluted to me. |
Beta Was this translation helpful? Give feedback.
-
I didn't have a specific proposal in mind - probably others who are more into this area are able to come up with something better than I can (without me doing a bunch of research as to further prior art). Looking at the Slonik example, I see what you mean about it being convoluted 🤔 Maybe others such as @throrin19, @Benricheson101, @kevinK0enig have some API design thoughts... |
Beta Was this translation helpful? Give feedback.
-
To mock your database for tests, You have many options availables and it depends what do you want. For all, this is the available part for knex.js or other good practices (but for some, I don't know how to do that correctly in a CI/CD system)
|
Beta Was this translation helpful? Give feedback.
-
I think I have a hard time seeing the point in mocking your database. Especially PostgreSQL which we should expect to not lie to us. Maybe if we were dealing with mongo 😋 If it's about not being able to run Postgres for the tests, I think that's the problem to solve instead of mocking it. I'll move this issue to discussions. |
Beta Was this translation helpful? Give feedback.
-
Hi @porsager !
Thanks again for your continued work on this library.
Would you be open to offering a mock pool for testing database functions?
Prior art can be seen here (Slonik): https://medium.com/@gajus/mocking-postgresql-queries-in-node-js-730da98545ed
Beta Was this translation helpful? Give feedback.
All reactions