Maybe we could do something like this (pseudo-code):
bulk_insert = [] for row in cursor.fetchall(): if row.index % 1000: Uploads.objects.bulk_create(bulk_insert) else: bulk_insert.append(row)
If the cursor.fetchall() cakk is actually problematic, we would need to slice the database results.
Not sure if the above isn't actually confusing. :-)
Maybe we could do something like this (pseudo-code):
bulk_insert = []
Uploads. objects. bulk_create( bulk_insert)
bulk_insert. append( row)
for row in cursor.fetchall():
if row.index % 1000:
else:
If the cursor.fetchall() cakk is actually problematic, we would need to slice the database results.
Not sure if the above isn't actually confusing. :-)