-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
A better way to handle .first() #3
Comments
Can you elaborate it? Example will help 🙏🏼 You can register an handler for the specific query which tracker.on.select('select * from users where `id`=? limit 1').response({ name: 'foo' });
// ---------------------------------------------------^ |
Well first, thanks for this lib @felixmosh ! Having faced the same case as @icopp , I think the issue here is that knex returns a different kind of response. Indeed With the example above, I believe |
Thank you for the feedback I don't think that this lib should make manipulations on user given data, but if 2 people are requesting such a feature I'll consider it ;) |
Added in Thank you for the feedback 🙏🏼 |
Currently it looks like when
.first()
is used on a Knex query, the full array response is still returned to it, so you have to change your response based on whether you know.first()
is being used or not.The simplest fix for the end user here would probably be to use the first item of the passed in array for
.first()
(or undefined if there is none).The text was updated successfully, but these errors were encountered: