Replies: 1 comment 2 replies
-
Raw SQL shouldn't be part of the query builder, which is an abstraction, but rather of the respective database engines' grammars. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I was faced today with a situation where I had to upsert a very large amount of data coming from another table.
On my first attempt it failed because of the number of binding being over the maximum (
SQLSTATE[HY000]: General error: 7 number of parameters must be between 0 and 65535
)I could get rid of this warning by chunking the inserted data, but since it is coming from another table, instead of fetching to insert it directly, I looked into
insertUsing
andinsertOrIgnoreUsing
. In my case, ignoring was not an option, I wanted an update...So I built this macro for PostgreSQL :
I looked into it and replicating the behaviour for MySQL shouldn't be an issue, so if people are interested and the core team is OK with it, I'm willing to submit a PR (with cleaner code, and -of course- tests).
Beta Was this translation helpful? Give feedback.
All reactions