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

Query parameters aren't used in create call #173

Open
dyllan-to-you opened this issue Feb 25, 2022 · 0 comments
Open

Query parameters aren't used in create call #173

dyllan-to-you opened this issue Feb 25, 2022 · 0 comments

Comments

@dyllan-to-you
Copy link

Hi! I'm attempting to use $modify on create call to enable a onConflictIgnore type flag in postgresql. However, it doesn't look like the $modify is actually being applied.

Looking at the code, it appears that the createQuery call deletes the query parameters after it is used. However, in the _create flow that ends up calling _batchInsert, it appears createQuery is called twice. It is first called by _create, and then called again by _batchInsert. This results in the query parameters being deleted by the createQuery call within _create, and thus never making it to _batchInsert.

To me, it seems like there are two possible solutions:
1. pass the createQuery from _create into batchInsert. This works for the postgressql/mysql usecase, but not for the default case.
2. Don't delete query parameters in createQuery. I'm not sure what side effects this would cause, however.

On a second look at the code, it looks like create uses _createQuery instead of createQuery. This appears to complicate matters a bit...

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

1 participant