Skip to content

Commit

Permalink
chore: repr for query collection
Browse files Browse the repository at this point in the history
  • Loading branch information
severinsimmler committed May 24, 2023
1 parent 2369136 commit 62b2c35
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions databank/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ def from_file(cls, filepath: PathLike):
queries[header["name"]] = "\n".join(_lines[1:]).strip()

return cls(queries)

def __repr__(self) -> str:
"""Get the string representation of this collection.
Returns
-------
str
String representation of this collection.
"""
return f"<QueryCollection ({len(self)} queries): {list(self._queries)}>"

def __len__(self) -> int:
"""Get the number of queries in this collection.
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.5.0"
version = "0.5.1"
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 62b2c35

Please sign in to comment.