oguimbal / pg-mem

An in memory postgres DB instance for your unit tests
MIT License
1.89k stars 94 forks source link

Implement the json_array_elements method #372

Open DorelBarbu opened 7 months ago

DorelBarbu commented 7 months ago

Hi,

First of all, thank you for putting together such an amazing library.

We are using your library as a database for performing database interactions inside our unit testing and integration testing because it's so easy and convenient to set up. We are using Postgresql and TypeORM. We have come across an issue though: json_array_elements is not implemented.

I tried to implement it myself, but I couldn't understand it. In Postgresql, if you use this method in a query it produces rows as an output, by expanding the JSON array into a set of rows. I tried to use db.public.registerFunction but couldn't.

Is there any way you could give me a hint about how to implement this, please?

Thank you very much, Dorel Barbu