oguimbal / pg-mem

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

feat: add `postgres-js` adapter #398

Closed smcclure17 closed 2 months ago

smcclure17 commented 5 months ago

From #386

In src/adapters/adapters.ts: Creates an adapter that mimics the contract/behavior of postgres-js similar to what is done for pg-native.

In src/tests/postgres-js-mimic.spec.ts: Adds tests to verify mimicked behavior matched original.

This only implements the default Sql template tagged literal and unsafe() for performing queries.. We would need to add further implementation to match the features from https://github.com/porsager/postgres

oguimbal commented 2 months ago

Hi there !

Thanks for this attempt :)

I however implemented a real way to hook postgres.js, see #411

smcclure17 commented 2 months ago

Wow, very nice!

Thanks for taking the time to implement this (especially with how tricky it is!) :)