question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pg-query-stream version + compatibility

See original GitHub issue

pg-query-stream has been fully revamped in the latest release, with at least one breaking change - changing the class name again, from PgQueryStream to QueryStream (see PR #2476).

There are libraries out there that validate the object by its class name, so those would all need to be updated.

The request is here that pg-query-stream version should have been upped to 4.0.0, or not with the minor version increment.

Please, either bring the version to 4.0.0 (preferable), or rename the class back to PgQueryStream (this will require TypeScript update as well, so the first option is better).


Note that this is the second time such a change happens. Which means there should be a test added for the class name, to make sure people stop changing it. Internal class names are often important, being the only way an object instance can be validated.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
charmandercommented, Nov 15, 2020

There are libraries out there that validate the object by its class name

That doesn’t sound like a good idea.

0reactions
vitaly-tcommented, Nov 18, 2020

Within docker, it is possible to load the same module multiple times, each within isolated environment, so if you create a class object in one, pass it into the other, then instanceof is suddenly not working, JavaScript sees it as 2 separate classes.

not following what you mean about including the actual module type in your project

When you want to add support for QueryStream, you shouldn’t need to include the module itself. The latter is done by the module that uses your module. Including into module that doesn’t really need it only creates problem - extra dependency, plus possible version conflict.

I still think checking the name of a class and changing behavior based on that is a brittle approach to things

I have explained the best I could why and why it doesn’t work, so not much option there.

but I can do a semver major bump if required.

Yes, please, it would make life easier, since the last version suddenly changed the class name.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Compatibility with pg-query-stream 3 #695 - GitHub
Release 10.4.0 now requires pg-query-stream v3.0.0 or newer. All reactions.
Read more >
pg-query-stream - npm
Latest version: 4.2.4, last published: 4 months ago. Start using pg-query-stream in your project by running `npm i pg-query-stream`.
Read more >
pg-query-stream | Yarn - Package Manager
pg >=8.0 may still work on older versions but it is no longer officially supported. Change default behavior when not specifying rejectUnauthorized with...
Read more >
Upgrading - node-postgres
node version support ... Starting with pg@7.0 the earliest version of node supported will be node@4.x LTS . Support for node@0.12.x and node@.10.x...
Read more >
PostgreSQL data source | Grafana documentation
Grafana ships with a built-in PostgreSQL data source plugin that allows you to query and visualize data from a PostgreSQL compatible database.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found