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

Issue with Knex > 0.95 #9

Closed
acro5piano opened this issue Mar 9, 2021 · 2 comments
Closed

Issue with Knex > 0.95 #9

acro5piano opened this issue Mar 9, 2021 · 2 comments

Comments

@acro5piano
Copy link

acro5piano commented Mar 9, 2021

Hi, thank you for the great library.

Recently Knex released a HUGE release 0.95.0 and it contains breaking changes and knex-tiny-logger not working with an error knex.client._formatQuery is not a function.

https://github.com/knex/knex/releases/tag/0.95.0

Replace knex.client._formatQuery with require('knex/lib/execution/internal/query-executioner').formatQuery fixes the issue.

Can I create a PR for this?

Downside of require('knex/lib/execution/internal/query-executioner').formatQuery is: 1) it is a breaking change 2) it is a private API which should be avoided.

@khmm12
Copy link
Owner

khmm12 commented Mar 15, 2021

Hey @acro5piano 👋

Thank you for report.

I published 2.1.0 version which supports both knex internal APIs > 0.20.x and > 0.95.0.

Downside of require('knex/lib/execution/internal/query-executioner').formatQuery is:

  1. it is a breaking change
  2. it is a private API which should be avoided.
  1. It's always possible to have support both API without breaking changes 🙂.
  2. I definitely agree with you. But it's same matter as knex.client._formatQuery which is private method.

The major benefit of built in knex formatter is dialects support. But sad truth is that seems it's time to move forward and change a bit API – ship a default query formatter and give developers ability to customize.

@acro5piano
Copy link
Author

@khmm12 Thank you for the release! I've confirmed it's working with Knex 0.95.0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants