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

mysql warn .returning() does not have any effect. #3039

Merged
merged 2 commits into from Mar 3, 2019

Conversation

@HurSungYun
Copy link
Contributor

@HurSungYun HurSungYun commented Feb 7, 2019

In SQLite3, users can be warned that .returning() has no effect.

https://github.com/tgriesser/knex/blob/master/src/dialects/sqlite3/query/compiler.js#L18

For consistency, how about MySQL users to be warned as well?

@elhigu
Copy link
Member

@elhigu elhigu commented Feb 7, 2019

Tests are missing and I'm not sure if this should be an exception and thrown earlier than compilation phase.

@elhigu
Copy link
Member

@elhigu elhigu commented Feb 7, 2019

Also sqlite warning could be moved to happen earlier. Nowadays it is possible to test that error messages are emitted, so test should be added in either way.

@HurSungYun
Copy link
Contributor Author

@HurSungYun HurSungYun commented Feb 11, 2019

I think the warning would be enough. In the case of using the same builder code for both postgreSQL and MySQL, it would be a problem.

And added some tests for it.

@elhigu elhigu merged commit dfe0129 into knex:master Mar 3, 2019
2 checks passed
@elhigu
Copy link
Member

@elhigu elhigu commented Mar 3, 2019

I think this is fine. Thanks!

eldridge pushed a commit to eldridge/js-data-sql that referenced this issue Jan 15, 2020
Knex 0.16.4 began warning when the returning attribute is supplied for
dialects that do not support it.  These dialects currently include MySQL
and SQLite3.  Supplying this attribute is a no-op for those dialects, so
excluding them is safe and eliminates the warning.

More information:

    knex/knex#3039
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants