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

Add capability for creating multiple rows in single query using insert into values (), (), () dialect #227

Closed
samarpanB opened this issue Jul 10, 2022 · 0 comments · Fixed by #228 or loopbackio/loopback-datasource-juggler#1985
Labels

Comments

@samarpanB
Copy link
Contributor

Suggestion

There is no support for inserting multiple rows in one query which is pretty much a standard of SQL. There is a standard dialect for this too which most of the SQL databases support like mysql, postgres, sqlserver, oracle, etc. Connector should have basic support for this with a flag for enabling/disabling at derived connector types for each database.
There are some databases which does not support it. For that reason, we need the flag.

Use Cases

Bulk create function in juggler will use it. Refer loopbackio/loopback-next#3357

Examples

Optimally, instead of:

INSERT INTO `tbl`(`fld1`,`fld2`,`fld3`,`fld4`) VALUES(1,2,3,4);
INSERT INTO `tbl`(`fld1`,`fld2`,`fld3`,`fld4`) VALUES(10,20,30,40);
INSERT INTO `tbl`(`fld1`,`fld2`,`fld3`,`fld4`) VALUES(100,200,300,400);

We would have:

INSERT INTO tbl(fld1,fld2,fld3,fld4) VALUES(1,2,3,4),(10,20,30,40),(100,200,300,400);

Acceptance criteria

TBD - will be filled by the team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
1 participant