Skip to content
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

4 changes: 2 additions & 2 deletions lib/dialects/postgres/schema/pg-columncompiler.js
Expand Up @@ -138,8 +138,8 @@ ColumnCompiler_PG.prototype.uuid = 'uuid';
function jsonColumn(client, jsonb) {
if (
!client.version ||
client.config.client === 'cockroachdb' ||
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was cockroachdb removed?

Copy link
Contributor Author

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

parseFloat(client.version) >= 9.2
parseFloat(client.version) >= 9.2 ||
client.config.jsonbSupport === true
kibertoad marked this conversation as resolved.
Show resolved Hide resolved
) {
return jsonb ? 'jsonb' : 'json';
}
Expand Down
1 change: 1 addition & 0 deletions test/integration2/util/knex-instance-provider.js
Expand Up @@ -132,6 +132,7 @@ const testConfigs = {
pool,
migrations,
seeds,
jsonbSupport: true,
kibertoad marked this conversation as resolved.
Show resolved Hide resolved
},

pgnative: {
Expand Down
1 change: 1 addition & 0 deletions types/index.d.ts
Expand Up @@ -2310,6 +2310,7 @@ export declare namespace Knex {
debug?: boolean;
client?: string | typeof Client;
dialect?: string;
jsonbSupport?: boolean;
version?: string;
connection?: string | StaticConnectionConfig | ConnectionConfigProvider;
pool?: PoolConfig;
Expand Down