sql-athame 0.4.0a2__tar.gz → 0.4.0a4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sql-athame
3
- Version: 0.4.0a2
3
+ Version: 0.4.0a4
4
4
  Summary: Python tool for slicing and dicing SQL
5
5
  Home-page: https://github.com/bdowning/sql-athame
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "sql-athame"
3
- version = "0.4.0-alpha-2"
3
+ version = "0.4.0-alpha-4"
4
4
  description = "Python tool for slicing and dicing SQL"
5
5
  authors = ["Brian Downing <bdowning@lavos.net>"]
6
6
  license = "MIT"
@@ -440,6 +440,7 @@ class ModelBase(Mapping[str, Any]):
440
440
  async def insert_multiple_array_safe(
441
441
  cls: Type[T], connection_or_pool: Union[Connection, Pool], rows: Iterable[T]
442
442
  ) -> str:
443
+ last = ""
443
444
  for chunk in chunked(rows, 100):
444
445
  last = await connection_or_pool.execute(
445
446
  *cls.insert_multiple_array_safe_sql(chunk)
@@ -467,6 +468,7 @@ class ModelBase(Mapping[str, Any]):
467
468
  async def upsert_multiple_array_safe(
468
469
  cls: Type[T], connection_or_pool: Union[Connection, Pool], rows: Iterable[T]
469
470
  ) -> str:
471
+ last = ""
470
472
  for chunk in chunked(rows, 100):
471
473
  last = await connection_or_pool.execute(
472
474
  *cls.upsert_sql(cls.insert_multiple_array_safe_sql(chunk))
@@ -595,5 +597,7 @@ class ModelBase(Mapping[str, Any]):
595
597
 
596
598
 
597
599
  def chunked(lst, n):
600
+ if type(lst) is not list:
601
+ lst = list(lst)
598
602
  for i in range(0, len(lst), n):
599
603
  yield lst[i : i + n]
File without changes
File without changes