Closed cemremengu closed 11 months ago
You can call ib.args.Add(sb)
to get a placeholder string holding a reference to SelectBuilder
instance. You can then use the placeholder string
Here is a reference implementation for a INSERT INTO ... SELECT
builder: https://go.dev/play/p/sWHptqfluAS
Thanks this worked like a charm! Would you like me to send a PR for this?
Yes, it's appreciated. Regarding to the INSERT INTO ... SELECT
design, it's recommended to extend InsertBuilder
rather than add a new builder. We can discuss more details in your PR.
What is a good way to implement insert with a select statement?
I create a select builder and then set it inside the insert builder. Trying something like below when building insert:
However, I am unable to get the args correctly. Somehow placeholders are missing from the final output. Any suggestions?