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

[v2] Standardize insert_id #41

Closed
Flamenco opened this issue Aug 13, 2018 · 3 comments
Closed

[v2] Standardize insert_id #41

Flamenco opened this issue Aug 13, 2018 · 3 comments
Labels

Comments

@Flamenco
Copy link

The docs state this value should be insert_id, but MySql driver returns insertId.

Since this is such a common item to retrieve, I think the drivers should all map to the same field name.

@Flamenco Flamenco changed the title Standardize insert_id [v2] Standardize insert_id Aug 15, 2018
@kylefarris
Copy link
Owner

I agree, this should definitely be consistent. I'm looking at the code, though, and it would seem that it already should be returning it as insert_id. I'll investigate further.

@kylefarris
Copy link
Owner

It looks like it's returning both insertId and insert_id which actually makes sense because I'm just merging in the node-querybuilder standardized fields (insert_id, affected_rows, and changed_rows) into the normal MySQL driver's response object.

I think this allows for the best of both worlds--maximum flexibility as well a standard API for all drivers.

Are you not getting the insert_id along with the insertId like I am?

@Flamenco
Copy link
Author

I did not see that it returned both, so I will double check. If I can rely on insert_id, affected_rows, and changed_rows to be consistent across DB's then that's GREAT!

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

No branches or pull requests

2 participants