Skip to content

Commit 6b84a35

Browse files
chore: cleanup
1 parent b811a65 commit 6b84a35

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ But you can also fetch `n` rows:
6565
[{'id': 0, 'member': 'John'}, {'id': 1, 'member': 'Paul'}]
6666
```
6767

68-
Or if you want _all_ rows:
68+
Or all rows:
6969

7070
```python
7171
>>> db.fetch_all("SELECT * FROM beatles;")

databank/core.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def __init__(self, url: str, **kwargs):
2020
self.engine: Engine = create_engine(url, **kwargs)
2121
self.registry: ThreadLocalRegistry = scoped_session(sessionmaker(bind=self.engine))
2222

23-
def execute(self, query: str, *, params: Mapping = {}):
23+
def execute(self, query: str, params: Mapping = {}):
2424
"""Execute the given SQL query, optionally bind the params first.
2525
2626
Parameters
@@ -44,7 +44,7 @@ def execute(self, query: str, *, params: Mapping = {}):
4444
else:
4545
session.commit()
4646

47-
def execute_many(self, query: str, *, params: Iterable[Mapping] = []):
47+
def execute_many(self, query: str, params: Iterable[Mapping] = []):
4848
"""Execute the given SQL query many times, optionally bind the iterable of params first.
4949
5050
Parameters
@@ -68,7 +68,7 @@ def execute_many(self, query: str, *, params: Iterable[Mapping] = []):
6868
else:
6969
session.commit()
7070

71-
def fetch_one(self, query: str, *, params: Mapping = {}) -> dict:
71+
def fetch_one(self, query: str, params: Mapping = {}) -> dict:
7272
"""Execute the given SQL query, optionally bind the params, and fetch the first result.
7373
7474
Parameters
@@ -95,7 +95,7 @@ def fetch_one(self, query: str, *, params: Mapping = {}) -> dict:
9595

9696
return dict(row)
9797

98-
def fetch_many(self, query: str, *, params: Mapping = {}, n: int = 1) -> dict:
98+
def fetch_many(self, query: str, params: Mapping = {}, n: int = 1) -> dict:
9999
"""Execute the given SQL query, optionally bind params, and fetch the first `n` results.
100100
101101
Parameters
@@ -124,7 +124,7 @@ def fetch_many(self, query: str, *, params: Mapping = {}, n: int = 1) -> dict:
124124

125125
return [dict(row) for row in result]
126126

127-
def fetch_all(self, query: str, *, params: Mapping = {}):
127+
def fetch_all(self, query: str, params: Mapping = {}):
128128
"""Execute the given SQL query, optionally bind the params, and fetch all results.
129129
130130
Parameters

0 commit comments

Comments
 (0)