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

feat(core): add driver.nativeInsertMany() method #688

Merged
merged 1 commit into from
Jul 28, 2020
Merged

feat(core): add driver.nativeInsertMany() method #688

merged 1 commit into from
Jul 28, 2020

Commits on Jul 28, 2020

  1. feat(core): add driver.nativeInsertMany() method

    This method can be used for bulk inserts. It works in all existing drivers,
    but has some limitations in SQLite and MySQL/MariaDB. Those drivers do not
    return all the just created PKs.
    
    MySQL/MariaDB will return PK of the first entity in the batch. If we have
    `innodb_autoinc_lock_mode` set to 0/1 it is possible to compute the following
    PKs simply by incrementing the first PK value.
    (see https://stackoverflow.com/a/16592867/3665878)
    
    SQLite on the other hand will return only the last PK.
    
    Postgres and MongoDB both return all the PKs in the `res.rows` array.
    
    Related: #442
    B4nan committed Jul 28, 2020
    Configuration menu
    Copy the full SHA
    c9e649c View commit details
    Browse the repository at this point in the history