tursodatabase / libsql-experimental-python

libSQL API for Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

executemany is slow

alixTal opened this issue · comments

test_data = [
  ('Donna', date(2022, 4, 14)),
  ('Eric', date(2023, 6, 21)),
  ('Kelso', date(2018, 9, 12)),
]
stmt = "INSERT INTO names (first_name, date) VALUES (%s, %s)"
cursor.executemany(stmt, test_data)

When I use executemany it's look like loop through them and insert one by one.

Isn't supposed to turn it to something like this and send at once?

INSERT INTO names (first_name, date)
VALUES ('Donna', '2022-4-14'), ('Eric', '2023-6-21'), ('Kelso', '2018-9-12')