Skip to content

Commit

Permalink
Fix for #9 - too many SQL variables
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Jul 26, 2019
1 parent 6fcc27b commit 35162fc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion healthkit_to_sqlite/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ def workout_to_db(workout, db):
dict(el.attrib, workout_id=pk)
for el in workout.findall("WorkoutRoute/Location")
]
db["workout_points"].insert_all(points, foreign_keys=[("workout_id", "workouts")])
db["workout_points"].insert_all(
points, foreign_keys=[("workout_id", "workouts")], batch_size=50
)


def write_records(records, db):
Expand All @@ -78,4 +80,5 @@ def write_records(records, db):
records_for_table,
alter=True,
column_order=["startDate", "endDate", "value", "unit"],
batch_size=50,
)

0 comments on commit 35162fc

Please sign in to comment.