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

mysql: support for insert of multiple rows #2002

Closed
newhook opened this issue Dec 20, 2022 · 4 comments
Closed

mysql: support for insert of multiple rows #2002

newhook opened this issue Dec 20, 2022 · 4 comments
Labels
bug Something isn't working triage New issues that hasn't been reviewed

Comments

@newhook
Copy link

newhook commented Dec 20, 2022

Version

1.15.0

What happened?

Is there a way to insert multiple rows into a MySQL database?

ie: the equivalent of:

insert into foo(bar1, bar2, bar3)
values
  (?,?,?),
  (?,?,?),
  (?,?,?)

Relevant log output

No response

Database schema

No response

SQL queries

No response

Configuration

No response

Playground URL

No response

What operating system are you using?

No response

What database engines are you using?

No response

What type of code are you generating?

No response

@newhook newhook added bug Something isn't working triage New issues that hasn't been reviewed labels Dec 20, 2022
@croconut
Copy link

croconut commented Dec 21, 2022

for an arbitrarily sized array, the mysql query would look like:

insert into table_1
(col_1, col_2)
values
?;

and the query parameter passed to mysql would look like:

('string', 15), ('second', 16), ('last', 35)

@kyleconroy
Copy link
Collaborator

There currently isn't a way to do this for an unknown number of rows. Duplicate of #695

@kyleconroy kyleconroy closed this as not planned Won't fix, can't repro, duplicate, stale Feb 22, 2023
@croconut
Copy link

Thats too bad as its definitely doable, e.g. npm's mysql package (and why mysql doesn't already support arrays, I don't understand).

@aakarim
Copy link

aakarim commented Jul 9, 2024

It looks like #695 is now closed, are there any examples of this working with an INSERT statement?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage New issues that hasn't been reviewed
Projects
None yet
Development

No branches or pull requests

4 participants