Skip to content

Commit

Permalink
Fixed a small database locking bug
Browse files Browse the repository at this point in the history
  • Loading branch information
NeoSecundus committed Nov 24, 2023
1 parent 1607b89 commit 3c5fbd9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/pyodb/schema/base/_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ def _break_down_type(cls, type_: type | UnionType | GenericAlias) -> type | Unio
if hasattr(type_, "__origin__"):
type_ = type_.__origin__

if type_ is Any:
raise MixedTypesError("Type of class member cannot be 'Any'!")

return type_


Expand Down
1 change: 1 addition & 0 deletions src/pyodb/schema/base/_sql_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def commit(self, dbconn: sql.Connection) -> None:
insert = insert[:-1] + ");"
with dbconn as conn:
conn.executemany(insert, self._vals)
conn.commit()


@property
Expand Down
2 changes: 1 addition & 1 deletion test/pyodb/schema/base/sql_builders_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pathlib import Path
from test.test_models.complex_models import ComplexMulti
from test.test_models.primitive_models import PrimitiveBasic, PrimitiveContainer
from time import time
from time import sleep, time
from unittest import TestCase

from pyodb.error import BadTypeError, ExpiryError, ParentError, QueryError
Expand Down

0 comments on commit 3c5fbd9

Please sign in to comment.