Skip to content

Insert generates invalid SQL when multiple rows and values passed #26

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

balint-balku-scraperapi

insert generates invalid SQL statement when used to fill multiple columns:

db.insert('table',
  [ 'column1', 'column2' ],
  [ [ 'data11', 'data21' ], [ 'data12', 'data22' ] ]
);

delimiters are not added properly so in the final statement parts of the real data get sliced, ending up in statements like this:

INSERT INTO "table" ("column1","column2") VALUES ('data11''data21),('data12''data22);

Signed-off-by: Balint Balku <balint@scraperapi.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant