knex
knex copied to clipboard
Explicit jsonb support for custom pg clients
I ran into an issue where my jsonb
columns are created as text
when using pg-mem
in tests and aurora friendly clients like knex-data-api-client
It resulted in a lot of cast blah as jsonb
workarounds, but really, the issue is that under the hood, knex just falls back to text
data type when it cannot resolve a valid pg version.
This change lets custom clients like knex-data-api
explicitly state they support jsonb
instead of passing in a potentially wrong postgres version (think serverless setup)
Coverage increased (+0.06%) to 92.284% when pulling 7ca0f2fed0c27c2edf2803df3ed91e08b79fb49e on viqueen:issue/PYN-1078-explicit-jsonb-support-for-custom-pg-clients into 8a50dd7462d40cfa122a233f7fcada24ea39d3ae on knex:master.
Ready for review ?
@OlivierCavadenti it's ready , though I think I should leave the check on cockroachdb
client in place to avoid breaking somebody's world
@viqueen Can you also add integration test for this?
Documentation needs to be added here: https://github.com/knex/documentation/pulls
@kibertoad documentation added over here https://github.com/knex/documentation/pull/423 I added a unit test only. a meaningful integration test would be with a serverless db like aurora postgres, I'm thinking to wire it up with localstack, but can't sink more time this week. unit test sounds like a good middle ground for now , what do you think ?
and another ping @kibertoad , is there more to do documentation wise ? I've already opened this https://github.com/knex/documentation/pull/423 , but it's also not reviewed yet
sorry for the delay, I was swamped a bit will take a look over the weekend
unit test sounds like a good middle ground for now , what do you think ?
sure, let's go with a unit test
Released in 2.3.0