11import decimal
22from _typeshed import Incomplete , ReadableBuffer
3- from collections .abc import Sequence
3+ from collections .abc import Callable , Sequence
44from datetime import date , datetime , time
55from types import TracebackType
6- from typing import Any , Literal , overload
6+ from typing import Any , Final , Literal , overload
77from typing_extensions import Self , TypeAlias
88
99from .resultrow import ResultRow
1010
11- apilevel : str
12- threadsafety : int
13- paramstyle : tuple [str , ...] # hdbcli defines it as a tuple which does not follow PEP 249
11+ apilevel : Final [ str ]
12+ threadsafety : Final [ int ]
13+ paramstyle : Final [ tuple [str , ...] ] # hdbcli defines it as a tuple which does not follow PEP 249
1414
1515class Connection :
1616 def __init__ (
1717 self ,
18- address : str ,
19- port : int ,
20- user : str ,
21- password : str ,
22- autocommit : bool = ... ,
23- packetsize : int | None = ... ,
18+ address : str = "" ,
19+ port : int = 0 ,
20+ user : str = "" ,
21+ password : str = "" ,
22+ autocommit : bool = True ,
23+ packetsize : int | None = None ,
2424 userkey : str | None = ...,
2525 * ,
2626 sessionvariables : dict [str , str ] | None = ...,
@@ -38,7 +38,7 @@ class Connection:
3838 def rollback (self ) -> None : ...
3939 def setautocommit (self , auto : bool = ...) -> None : ...
4040 def setclientinfo (self , key : str , value : str | None = ...) -> None : ...
41- def ontrace (self ) -> None : ...
41+ def ontrace (self , callback : Callable [[ str ], Any ], options : str = ... ) -> None : ...
4242
4343connect = Connection
4444
@@ -66,7 +66,7 @@ class Cursor:
6666 def close (self ) -> None : ...
6767 def description_ext (self ) -> Sequence [tuple [Any , ...]]: ...
6868 def execute (self , operation : str , parameters : tuple [Any , ...] | None = ...) -> bool : ...
69- def executemany (self , operation : str , parameters : _Parameters = ...) -> Any : ...
69+ def executemany (self , operation : str , parameters : _Parameters = ..., batcherrors : bool = False ) -> Any : ...
7070 def executemanyprepared (self , parameters : _Parameters = ...) -> Any : ...
7171 def executeprepared (self , parameters : _Parameters = ...) -> Any : ...
7272 def fetchone (self , uselob : bool = ...) -> ResultRow | None : ...
0 commit comments