Methods which are defined via PyMemberDef with flag METH_VARARGS
and have only one parameter are using METH_O now: Instead of parsing
and converting parameter via PyArgs_ParseTuple we now check the type
and convert passed python object directly to the corresponding c type.
Even if PEP-249 permits operations on a closed cursor, we don't
raise an exception if the cursor or the underlying connection
was closed. Instead rowcount property will return -1.
This is a workaround for pandas, where rowcount will be checked
after the cursor was closed.
Replaced collections.named_tuple by C-Pythons PyStruct_Sequence.
All conversion are done now before fetching a row: converting to
other result types than tuple (named tuple or dict) now have less
overhead and are significantly faster.
Fixed various coding style stuff detected by flake8.
Added .pre-commit-config.yaml:
With command pre_commit install a hook for flake8 will be
installed.
Since CLIENT constants can be used to determine both server
and client capabilities we use now CAPABILITY constants
instead.
CLIENT constants were marked as deprecated in documentation
and will be removed in 2.0 release
The default settiing for buffered in cursors.execute() method has
to be None:
- if not specified, it will use cursor defaults
- if specified, the default behavior of cursor will be changed
- removed utf8 part of parser, instead we use python binary
object for parameter substituton (text mode)
- removed memory leaks
- fixed crash when reusing cursor with different number of
placeholders
- All parameter exceptions are now ProgrammingErrors
- A dictionary now might contain more keys than
placeholders in statement
- Fixed unhandled exception when using dictionary as parameter
Due to several incompatibilites (but also MDEV-23768, where errors
can't be triggered in unbuffered) we decided to switch the default
mode for cursor class for buffered from False to True.