Skip to content

Add support for batch insert for Oracle#477

Merged
snuyanzin merged 1 commit into
datafaker-net:mainfrom
snuyanzin:oracle
Oct 23, 2022
Merged

Add support for batch insert for Oracle#477
snuyanzin merged 1 commit into
datafaker-net:mainfrom
snuyanzin:oracle

Conversation

@snuyanzin
Copy link
Copy Markdown
Collaborator

As usual one dialect could break everything...
e.g. batch insert for postgres looks like

INSERT INTO "MyTable" ("firstName", "lastName")
VALUES ('Candi', 'Kling'),
       ('Piedad', 'Fisher'),
       ('Antony', 'Brown'),
       ('Rick', 'Lueilwitz'),
       ('Tillie', 'Murazik');

while batch insert for Oracle looks like

INSERT ALL
    INTO "MyTable" ("firstName", "lastName") VALUES ('Lanny', 'Roob'),
    INTO "MyTable" ("firstName", "lastName") VALUES ('Vera', 'Carroll'),
    INTO "MyTable" ("firstName", "lastName") VALUES ('Rolf', 'Boyle'),
    INTO "MyTable" ("firstName", "lastName") VALUES ('Tonja', 'Bednar'),
    INTO "MyTable" ("firstName", "lastName") VALUES ('Wyatt', 'Predovic')
SELECT 1 FROM dual;

This PR adds this kind of support

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Oct 23, 2022

Codecov Report

Merging #477 (769bdac) into main (b984f48) will decrease coverage by 0.13%.
The diff coverage is 84.44%.

@@             Coverage Diff              @@
##               main     #477      +/-   ##
============================================
- Coverage     93.17%   93.04%   -0.14%     
- Complexity     2124     2139      +15     
============================================
  Files           233      233              
  Lines          4424     4469      +45     
  Branches        460      468       +8     
============================================
+ Hits           4122     4158      +36     
- Misses          187      192       +5     
- Partials        115      119       +4     
Impacted Files Coverage Δ
...java/net/datafaker/transformations/SqlDialect.java 87.69% <80.55%> (-12.31%) ⬇️
.../net/datafaker/transformations/SqlTransformer.java 82.17% <87.03%> (+1.81%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@snuyanzin snuyanzin merged commit 2da3a03 into datafaker-net:main Oct 23, 2022
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

Successfully merging this pull request may close these issues.

2 participants