New upsert implementation, refs #66

This commit is contained in:
Simon Willison 2019-12-29 21:03:43 -08:00
commit 84bcabd093
4 changed files with 156 additions and 48 deletions

View file

@ -378,6 +378,8 @@ def insert_upsert_implementation(
extra_kwargs["not_null"] = set(not_null)
if default:
extra_kwargs["defaults"] = dict(default)
if upsert:
extra_kwargs["upsert"] = upsert
db[table].insert_all(
docs, pk=pk, batch_size=batch_size, alter=alter, **extra_kwargs
)