-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Metadata added to queries since 0.15.0 #3514
Comments
Are you sure you are using same version of mysql driver in both cases? |
Yes, even tried different versions of mysql2 to make sure. |
That sound as expected. Why is that a bug? Automatic conversion from driver specific result objects to plain JS objects was removed around 0.15, because it was accountable for over 50% of row deserialization time. If you like to get the old behaviour back you can add your own postProcessResponse handler to do the conversion. |
@elhigu Can you elaborate on why automatic conversion from driver specific result objects was removed? Is without that, it makes it much less convenient to share code across different drivers. The intro paragraph in the knex docs include this bit: |
@jmrossy contents and accessing the data was the same for all the drivers. So data can be accessed the same way like from plain JS object. Conversion was a real performance bottleneck for queries containing thousands of results.
Knex still standardizes the results, because it still fetch or build if necessary the internal array of result row objects from the database. So with all databases you can do this:
|
@elhigu Thanks for clarifying.
|
Count query result different is another story... it is not different because of that change. Would be good to have some way to get those in a crossdb compatible manner. |
Environment
Knex version: 0.20.1 mysql2 driver
Database + version: mysql 5.7
OS: Ubuntu 16
Bug
The same query result comes with the metadata TextRow on Knex 0.20.1, this is true since 0.15.0.
Currently I'm using version 0.14.6 and tried to upgrade to the latest version.
Query:
0.14.6 Results:
0.20.1 Results:
The text was updated successfully, but these errors were encountered: