Skip to content

[Bug] SQLite multiple inserts need to be broken down to chunks of 100 #50

Closed
@Anahkiasen

Description

@Anahkiasen

Currently SQLite multiple inserts only work with chunks of 100 entries. Above it, it throws the following exception : SQLSTATE[HY000]: General error: 1 too many SQL variables.
Something with array_chunk maybe.

This isn't a problem in most parts of the application since inserts can be manually splited but is hugh problem in seeds because even if you split the query and insert the first chunks beforehand, seeding empties the database before inserting the seeded values.


UPDATE : Apparently this isn't as much a matter of entries as a matter of placeholders. See the #9 of this page on the SQLite website for more details. So if you insert entries with 5 columns (id, name, description, created_at, updated_at) you can insert 999 / 5 = 199 entries.
Maybe check if the limit can be put higher via PHP.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions