Skip to content

Commit

Permalink
feat: 0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
severinsimmler committed Jul 19, 2024
1 parent c4d94e5 commit baca66d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions databank/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from sqlalchemy.engine.interfaces import Dialect
from sqlalchemy.sql.elements import TextClause

SUPPORTED_TYPES = (str, int, float, bool, tuple, datetime, date)

# supported types for a row value
Value = Union[
str, int, float, bool, tuple, datetime, date, Literal["Jsonb"], Literal["Json"], None
Expand Down Expand Up @@ -54,9 +56,7 @@ def serialize_param(param: Any) -> Value:
Value
Serialized parameter.
"""
if isinstance(param, (str, int, float, bool, tuple, datetime, date)) or (
type(param).__name__ in {"Jsonb", "Json"}
):
if isinstance(param, SUPPORTED_TYPES) or (type(param).__name__ in {"Jsonb", "Json"}):
return param
elif isinstance(param, (dict, list)):
return json.dumps(param)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "databank"
version = "0.7.0"
version = "0.8.0"
description = "Databank is an easy-to-use Python library for making raw SQL queries in a multi-threaded environment."
readme = "README.md"
authors = ["snapADDY GmbH <[email protected]>"]
Expand Down

0 comments on commit baca66d

Please sign in to comment.