KnexNest uses some knex internals to deduce whether the given knex object is connected to a Postgres database, but that logic gets broken with knex version 0.8.0+.
Old logic was to check the given knex query like so:
knexQuery.client.Raw.name === 'Raw_PG'
However, with the knex 0.8.0 release the knexQuery.client.Raw property is no longer specialized for specific connection types and a different way of detecting Postgres connections must be used. One that works for knex 0.8.0+ releases, but does not for earlier ones, would be:
knexQuery.client.config.client === 'postgres'
Those two could be joined together to form a criteria that would correctly detect Postgres connections with all currently available knex releases like so:
KnexNest
uses someknex
internals to deduce whether the givenknex
object is connected to a Postgres database, but that logic gets broken withknex
version 0.8.0+.Old logic was to check the given
knex
query like so:However, with the
knex
0.8.0 release theknexQuery.client.Raw
property is no longer specialized for specific connection types and a different way of detecting Postgres connections must be used. One that works forknex
0.8.0+ releases, but does not for earlier ones, would be:Those two could be joined together to form a criteria that would correctly detect Postgres connections with all currently available
knex
releases like so: