Skip to content

Commit

Permalink
Implement setinputsizes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jettify committed Oct 28, 2023
1 parent 54efbd8 commit 6a216dd
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions aioodbc/cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,21 @@ def executemany(self, sql, *params):
def callproc(self, procname, args=()):
raise NotImplementedError

async def setinputsizes(self, *args, **kwargs):
"""Does nothing, required by DB API."""
return None
async def setinputsizes(self, sizes=None) -> None:
"""Explicitly declare the types and sizes of the parameters in a query. Set
to None to clear any previously registered input sizes.
:param sizes: A list of tuples, one tuple for each query parameter, where each
tuple contains:
1. the column datatype
2. the column size (char length or decimal precision)
3. the decimal scale.
For example: [(pyodbc.SQL_WVARCHAR, 50, 0), (pyodbc.SQL_DECIMAL, 18, 4)]
"""
# sizes: Optional[Iterable[Tuple[int, int, int]]]
await self._run_operation(self._impl.setinputsizes, sizes)

async def setoutputsize(self, *args, **kwargs):
"""Does nothing, required by DB API."""
Expand Down

0 comments on commit 6a216dd

Please sign in to comment.