New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explicit jsonb support for custom pg clients #5201
Explicit jsonb support for custom pg clients #5201
Conversation
Ready for review ? |
@OlivierCavadenti it's ready , though I think I should leave the check on |
@@ -138,8 +138,8 @@ ColumnCompiler_PG.prototype.uuid = 'uuid'; | |||
function jsonColumn(client, jsonb) { | |||
if ( | |||
!client.version || | |||
client.config.client === 'cockroachdb' || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why was cockroachdb removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
brought it back , I removed it initially just to get a sense of the tests in order to eventually replicate them for pg-mem
@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 knex/documentation#423 |
and another ping @kibertoad , is there more to do documentation wise ? |
sorry for the delay, I was swamped a bit |
sure, let's go with a unit test |
Released in 2.3.0 |
I ran into an issue where my
jsonb
columns are created astext
when usingpg-mem
in tests and aurora friendly clients likeknex-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 totext
data type when it cannot resolve a valid pg version.This change lets custom clients like
knex-data-api
explicitly state they supportjsonb
instead of passing in a potentially wrong postgres version (think serverless setup)