Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-pymssql for openSUSE:Factory checked in at 2026-03-04 21:08:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pymssql (Old) and /work/SRC/openSUSE:Factory/.python-pymssql.new.561 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pymssql" Wed Mar 4 21:08:16 2026 rev:13 rq:1336210 version:2.3.13 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pymssql/python-pymssql.changes 2026-02-13 16:13:45.673743510 +0100 +++ /work/SRC/openSUSE:Factory/.python-pymssql.new.561/python-pymssql.changes 2026-03-04 21:08:44.933203604 +0100 @@ -1,0 +2,7 @@ +Tue Mar 3 20:41:25 UTC 2026 - Dirk Müller <[email protected]> + +- update to 2.3.13: + * Fix type stubs with generics, overloads, and corrected types, + thanks to jacks0n. + +------------------------------------------------------------------- Old: ---- pymssql-2.3.12.tar.gz New: ---- pymssql-2.3.13.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pymssql.spec ++++++ --- /var/tmp/diff_new_pack.IMwx9P/_old 2026-03-04 21:08:45.649233197 +0100 +++ /var/tmp/diff_new_pack.IMwx9P/_new 2026-03-04 21:08:45.653233362 +0100 @@ -18,7 +18,7 @@ %{?sle15_python_module_pythons} Name: python-pymssql -Version: 2.3.12 +Version: 2.3.13 Release: 0 Summary: A simple database interface to MS-SQL for Python License: LGPL-2.1-only ++++++ pymssql-2.3.12.tar.gz -> pymssql-2.3.13.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pymssql-2.3.12/ChangeLog.rst new/pymssql-2.3.13/ChangeLog.rst --- old/pymssql-2.3.12/ChangeLog.rst 2026-02-11 03:12:39.000000000 +0100 +++ new/pymssql-2.3.13/ChangeLog.rst 2026-02-14 05:29:17.000000000 +0100 @@ -2,6 +2,15 @@ ============== +Version 2.3.13 - 2026-02-13 - Mikhail Terekhov +============================================== + +General +------- + +- Fix type stubs with generics, overloads, and corrected types, thanks to jacks0n. + + Version 2.3.12 - 2026-02-10 - Mikhail Terekhov ============================================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pymssql-2.3.12/PKG-INFO new/pymssql-2.3.13/PKG-INFO --- old/pymssql-2.3.12/PKG-INFO 2026-02-11 03:12:44.405438200 +0100 +++ new/pymssql-2.3.13/PKG-INFO 2026-02-14 05:29:23.493182200 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.4 Name: pymssql -Version: 2.3.12 +Version: 2.3.13 Summary: DB-API interface to Microsoft SQL Server for Python. (new Cython-based version) Author-email: Damien Churchill <[email protected]> Maintainer-email: Mikhail Terekhov <[email protected]> @@ -614,26 +614,19 @@ ============== -Version 2.3.12 - 2026-02-10 - Mikhail Terekhov +Version 2.3.13 - 2026-02-13 - Mikhail Terekhov ============================================== General ------- -- Update manylinux base image to manylinux_2_28 to fix CVE-2023-0464, thanks to [email protected]. +- Fix type stubs with generics, overloads, and corrected types, thanks to jacks0n. -Version 2.3.11 - 2025-12-30 - Mikhail Terekhov +Version 2.3.12 - 2026-02-10 - Mikhail Terekhov ============================================== General ------- -- Drop build of MacOS-13 wheels (The macOS-13 based runner images are now retired on GitHub). - -Internals ---------- - -- Bump actions/upload-artifacts and actions/download-artifacts. -- Update psutil requirement to <7.2.2 for testing wheels. -- Improve executemany to get every batch result and check for the total query size (for #952). +- Update manylinux base image to manylinux_2_28 to fix CVE-2023-0464, thanks to [email protected]. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pymssql-2.3.12/dev/requirements-dev.txt new/pymssql-2.3.13/dev/requirements-dev.txt --- old/pymssql-2.3.12/dev/requirements-dev.txt 2026-02-11 03:12:39.000000000 +0100 +++ new/pymssql-2.3.13/dev/requirements-dev.txt 2026-02-14 05:29:17.000000000 +0100 @@ -1,6 +1,6 @@ cython>=3.1.0 gevent -psutil<7.2.2 +psutil<7.2.3 pytest pytest-subtests pytest-timeout diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pymssql-2.3.12/dev/requirements-test.txt new/pymssql-2.3.13/dev/requirements-test.txt --- old/pymssql-2.3.12/dev/requirements-test.txt 2026-02-11 03:12:39.000000000 +0100 +++ new/pymssql-2.3.13/dev/requirements-test.txt 2026-02-14 05:29:17.000000000 +0100 @@ -1,5 +1,5 @@ gevent ; python_version>="3.9" -psutil<7.2.2 +psutil<7.2.3 pytest pytest-subtests pytest-timeout diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pymssql-2.3.12/src/pymssql/__init__.py new/pymssql-2.3.13/src/pymssql/__init__.py --- old/pymssql-2.3.12/src/pymssql/__init__.py 2026-02-11 03:12:39.000000000 +0100 +++ new/pymssql-2.3.13/src/pymssql/__init__.py 2026-02-14 05:29:17.000000000 +0100 @@ -3,4 +3,4 @@ from ._pymssql import * from .exceptions import * from ._pymssql import __version__, __full_version__ -from ._mssql import datetime2 +from ._mssql import datetime2 as datetime2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pymssql-2.3.12/src/pymssql/__init__.pyi new/pymssql-2.3.13/src/pymssql/__init__.pyi --- old/pymssql-2.3.12/src/pymssql/__init__.pyi 2026-02-11 03:12:39.000000000 +0100 +++ new/pymssql-2.3.13/src/pymssql/__init__.pyi 2026-02-14 05:29:17.000000000 +0100 @@ -5,4 +5,4 @@ from ._pymssql import * from ._pymssql import __full_version__, __version__ from .exceptions import * -from ._mssql import datetime2 +from ._mssql import datetime2 as datetime2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pymssql-2.3.12/src/pymssql/_mssql.pyi new/pymssql-2.3.13/src/pymssql/_mssql.pyi --- old/pymssql-2.3.12/src/pymssql/_mssql.pyi 2026-02-11 03:12:39.000000000 +0100 +++ new/pymssql-2.3.13/src/pymssql/_mssql.pyi 2026-02-14 05:29:17.000000000 +0100 @@ -4,8 +4,25 @@ import datetime import re -from collections.abc import Callable, Sequence -from typing import Any +from collections.abc import Callable, Mapping, Sequence +from decimal import Decimal +from types import TracebackType +from typing import Generic, Literal, overload +from uuid import UUID + +from typing_extensions import TypeVar + +SqlValue = str | int | float | Decimal | bool | bytes | datetime.datetime | datetime.date | datetime.time | UUID | None + +TupleRow = tuple[SqlValue, ...] +DictRow = dict[int | str, SqlValue] +QueryParams = SqlValue | tuple[SqlValue | tuple[SqlValue, ...], ...] | Mapping[str, SqlValue | tuple[SqlValue, ...]] + +ColumnDescription = tuple[str, int, None, None, None, None, None] + +_Row = TypeVar("_Row", default=TupleRow) + +ErrorHandlerResult = tuple[int, bytes, int, int, int] class datetime2(datetime.datetime): ... @@ -15,8 +32,8 @@ class NoParams: ... -ROW_FORMAT_TUPLE: int -ROW_FORMAT_DICT: int +ROW_FORMAT_TUPLE: Literal[1] +ROW_FORMAT_DICT: Literal[2] STRING: int BINARY: int NUMBER: int @@ -51,51 +68,79 @@ SQLDATE: int SQLTIME: int SQLDATETIME2: int +SQLDATETIMEOFFSET: int -def py2db_type(py_type: type, value: Any) -> int: ... +def py2db_type(py_type: type, value: SqlValue) -> int: ... class MSSQLException(Exception): """ Base exception class for the MSSQL driver. """ - class MSSQLDriverException(MSSQLException): """ Inherits from the base class and raised when an error is caused within the driver itself. """ - class MSSQLDatabaseException(MSSQLException): """ Raised when an error occurs within the database. """ - message: str + @property + def message(self) -> str: ... + @property + def number(self) -> int: ... + @property + def severity(self) -> int: ... + @property + def state(self) -> int: ... + @property + def line(self) -> int: ... + @property + def text(self) -> bytes: ... + @property + def srvname(self) -> bytes: ... + @property + def procname(self) -> bytes: ... login_timeout: int min_error_severity: int -wait_callback: None +wait_callback: Callable[[int], object] | None -def set_wait_callback(a_callable: Callable) -> None: ... +def set_wait_callback(a_callable: Callable[[int], object] | None) -> None: ... -class MSSQLRowIterator: +class MSSQLRowIterator(Generic[_Row]): def __init__(self, connection: MSSQLConnection, row_format: int) -> None: ... - def __iter__(self) -> MSSQLRowIterator: ... - def __next__(self) -> tuple[Any, ...]: ... + def __iter__(self) -> MSSQLRowIterator[_Row]: ... + def __next__(self) -> _Row: ... class MSSQLConnection: - charset: str - connected: bool - identity: tuple[Any, ...] - query_timeout: int - rows_affected: int - tds_version: int - tds_version_tuple: tuple[int, int] | None + debug_queries: bool + @property + def charset(self) -> str | None: ... + @property + def connected(self) -> bool: ... + @property + def identity(self) -> SqlValue: ... + @property + def query_timeout(self) -> int: ... + @query_timeout.setter + def query_timeout(self, value: int) -> None: ... + @property + def rows_affected(self) -> int: ... + @property + def tds_version(self) -> float | None: ... + @property + def tds_version_tuple(self) -> tuple[int, int] | None: ... + @property + def max_query_size(self) -> int: ... + @max_query_size.setter + def max_query_size(self, value: int) -> None: ... def __init__( self, - server: str = ".", + server: str = "localhost", user: str | None = None, password: str | None = None, charset: str = "UTF-8", @@ -105,14 +150,14 @@ tds_version: str | None = None, encryption: str | None = None, read_only: bool = False, - use_datetime2=False, + use_datetime2: bool = False, conn_properties: str | list[str] | None = None, ) -> None: ... def __dealloc__(self) -> None: ... def __enter__(self) -> MSSQLConnection: ... - def __exit__(self, exc_type, exc_value, traceback) -> None: ... - def __iter__(self) -> MSSQLRowIterator: ... - def set_msghandler(self, handler: Callable) -> None: + def __exit__(self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None) -> None: ... + def __iter__(self) -> MSSQLRowIterator[DictRow]: ... + def set_msghandler(self, handler: Callable[[int, int, bytes, bytes, int, bytes], object] | None) -> None: """ set_msghandler(handler) -- set the msghandler for the connection @@ -142,7 +187,7 @@ ... def mark_disconnected(self) -> None: ... - def execute_non_query(self, query_string: str, params: object = ...) -> None: + def execute_non_query(self, query_string: str, params: QueryParams = ...) -> None: """ execute_non_query(query_string, params=NoParams) @@ -162,7 +207,7 @@ """ ... - def execute_query(self, query_string: str, params: object = ...) -> None: + def execute_query(self, query_string: str, params: QueryParams = ...) -> None: """ execute_query(query_string, params=NoParams) @@ -194,7 +239,7 @@ """ ... - def execute_row(self, query_string: str, params: object = ...) -> tuple[Any, ...]: + def execute_row(self, query_string: str, params: QueryParams = ...) -> DictRow | None: """ execute_row(query_string, params=NoParams) @@ -217,9 +262,7 @@ """ ... - def execute_scalar( - self, query_string: str, params: object = ... - ) -> tuple[Any, ...] | None: + def execute_scalar(self, query_string: str, params: QueryParams = ...) -> SqlValue: """ execute_scalar(query_string, params=NoParams) @@ -242,18 +285,10 @@ """ ... - def fetch_next_row(self, throw: int, row_format: int) -> tuple[Any, ...] | None: ... - def format_and_run_query(self, query_string: str, params: object = ...) -> None: - """ - This is a helper function, which does most of the work needed by any - execute_*() function. It returns NULL on error, None on success. - """ - ... - def executemany( - self, query_string: str, seq_of_parameters: Sequence[str], batch_size: int + self, query_string: str, seq_of_parameters: Sequence[QueryParams], batch_size: int ) -> None: ... - def get_header(self) -> tuple[str, ...] | None: + def get_header(self) -> tuple[ColumnDescription, ...] | None: """ get_header() -- get the Python DB-API compliant header information. @@ -264,12 +299,15 @@ """ ... - def get_iterator(self, row_format: int) -> MSSQLRowIterator: + @overload + def get_iterator(self, row_format: Literal[1]) -> MSSQLRowIterator[TupleRow]: ... + @overload + def get_iterator(self, row_format: Literal[2]) -> MSSQLRowIterator[DictRow]: """ get_iterator(row_format) -- allows the format of the iterator to be specified While the iter(conn) call will always return a dictionary, this - meth + method allows the return type of the row to be specified. """ ... @@ -303,17 +341,27 @@ """ ... - def bcp_sendrow(self, element: list[str], column_ids: list[int]): ... + def cur_db_name(self) -> str: + """ + cur_db_name() -- Gets the current database name. + + This function returns the name of the current database. + """ + ... + def bcp_sendrow(self, element: Sequence[SqlValue], column_ids: Sequence[int] | None) -> None: ... class MSSQLStoredProcedure: - connection: MSSQLConnection - name: str - parameters: list[str] + @property + def connection(self) -> MSSQLConnection: ... + @property + def name(self) -> bytes: ... + @property + def parameters(self) -> DictRow: ... def __init__(self, name: bytes, connection: MSSQLConnection) -> None: ... def __dealloc__(self) -> None: ... def bind( self, - value: Any, + value: SqlValue, dbtype: int, param_name: str | None = None, output: int | bool = False, @@ -328,33 +376,49 @@ """ ... - def execute(self) -> None: ... + def execute(self) -> int: ... -def remove_locale(value: bytes) -> str: ... +def remove_locale(value: bytes) -> bytes: ... _re_pos_param: re.Pattern[bytes] _re_name_param: re.Pattern[bytes] -def quote_simple_value(value: Any | None) -> str | bytes | None: ... -def quote_or_flatten(data: list[Any] | tuple[Any, ...]) -> str | bytes | None: ... +def quote_simple_value(value: SqlValue, use_datetime2: bool = False, charset: str = "utf-8") -> bytes: ... def quote_data( - data: list[Any] | tuple[Any, ...] | dict[Any, Any], -) -> str | bytes | set[Any] | tuple[Any, ...] | None: ... -def substitute_params(toformat: str, params: object = ..., charset: str = "utf-8"): ... -def connect(*args, **kwargs) -> MSSQLConnection: ... + data: TupleRow | list[SqlValue] | DictRow, + use_datetime2: bool = False, + charset: str = "utf-8", +) -> dict[int | str, bytes] | tuple[bytes, ...]: ... +def substitute_params( + toformat: str | bytes, params: QueryParams = ..., use_datetime2: bool = False, charset: str = "utf-8" +) -> bytes: ... +def connect( + server: str = "localhost", + user: str | None = None, + password: str | None = None, + charset: str = "UTF-8", + database: str = "", + appname: str | None = None, + port: str = "1433", + tds_version: str | None = None, + encryption: str | None = None, + read_only: bool = False, + use_datetime2: bool = False, + conn_properties: str | list[str] | None = None, +) -> MSSQLConnection: ... MssqlDatabaseException = MSSQLDatabaseException MssqlDriverException = MSSQLDriverException MssqlConnection = MSSQLConnection def test_err_handler( - connection: MSSQLConnection, + connection: MSSQLConnection | None, severity: int, dberr: int, oserr: int, - dberrstr: str, - oserrstr: str, -) -> tuple[int, str, int, int, int]: + dberrstr: str | None, + oserrstr: str | None, +) -> ErrorHandlerResult: """ Expose err_handler function and its side effects to facilitate testing. """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pymssql-2.3.12/src/pymssql/_pymssql.pyi new/pymssql-2.3.13/src/pymssql/_pymssql.pyi --- old/pymssql-2.3.12/src/pymssql/_pymssql.pyi 2026-02-11 03:12:39.000000000 +0100 +++ new/pymssql-2.3.13/src/pymssql/_pymssql.pyi 2026-02-14 05:29:17.000000000 +0100 @@ -2,12 +2,25 @@ This type stub file was generated by pyright. """ +import builtins import datetime from collections.abc import Sequence -from typing import Any +from types import TracebackType +from typing import Generic, Literal, overload + +from typing_extensions import TypeVar, override + from . import _mssql +from ._mssql import QueryParams as QueryParams, SqlValue as SqlValue, set_wait_callback as set_wait_callback from .exceptions import * +TupleRow = tuple[SqlValue, ...] +DictRow = dict[str, SqlValue] + +_Row = TypeVar("_Row", default=TupleRow) + +ColumnDescription = tuple[str, int, None, None, None, None, None] + __author__: str __full_version__: str __version__: str @@ -18,40 +31,48 @@ NoParams = _mssql.NoParams class DBAPIType: - def __init__(self, value: Any) -> None: ... - def __cmp__(self, other: Any) -> int: ... + value: int + def __init__(self, value: int) -> None: ... + def __cmp__(self, other: object) -> int: ... + @override def __eq__(self, other: object) -> bool: ... + @override + def __repr__(self) -> str: ... -STRING: int -BINARY: int -NUMBER: int -DATETIME: int -DECIMAL: int +STRING: DBAPIType +BINARY: DBAPIType +NUMBER: DBAPIType +DATETIME: DBAPIType +DECIMAL: DBAPIType Date = datetime.date Time = datetime.time Timestamp = datetime.datetime -DateFromTicks: Date -TimeFromTicks: Time -TimestampFromTicks: Timestamp -Binary: bytearray +def DateFromTicks(ticks: float) -> datetime.date: ... +def TimeFromTicks(ticks: float) -> datetime.time: ... +def TimestampFromTicks(ticks: float) -> datetime.datetime: ... +Binary: type[bytearray] -def row2dict(row: tuple[Any, ...]) -> dict[Any, Any]: +def row2dict(row: _mssql.DictRow) -> DictRow: """Filter dict so it only has string keys; used when as_dict == True""" ... class output: - object: Any - value: Any - def __init__(self, param_type: Any, value: Any | None = None) -> None: ... + @property + def type(self) -> type: ... + @property + def value(self) -> SqlValue: ... + def __init__(self, param_type: builtins.type, value: SqlValue = None) -> None: ... -class Connection: +class Connection(Generic[_Row]): """ This class represents an MS-SQL database connection. """ as_dict: bool - autocommit_state: bool - _conn: _mssql.MSSQLConnection + @property + def autocommit_state(self) -> bool: ... + @property + def _conn(self) -> _mssql.MSSQLConnection: ... arraysize: int def __init__( self, @@ -67,8 +88,8 @@ """ ... - def __enter__(self) -> Connection: ... - def __exit__(self, exc_type, exc_value, traceback) -> None: ... + def __enter__(self) -> Connection[_Row]: ... + def __exit__(self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None) -> None: ... def close(self) -> None: """ Close the connection to the database. Implicitly rolls back all @@ -82,9 +103,12 @@ """ ... - def cursor( - self, as_dict: bool | None = None, arraysize: int | None = None - ) -> Cursor: + @overload + def cursor(self, as_dict: None = None, arraysize: int | None = None) -> Cursor[_Row]: ... + @overload + def cursor(self, as_dict: Literal[True], arraysize: int | None = None) -> Cursor[DictRow]: ... + @overload + def cursor(self, as_dict: Literal[False], arraysize: int | None = None) -> Cursor[TupleRow]: """ Return cursor object that can be used to make queries and fetch results from the database. @@ -100,7 +124,7 @@ def bulk_copy( self, table_name: str, - elements: list, + elements: Sequence[Sequence[SqlValue]], column_ids: list[int] | None = None, batch_size: int = 1000, tablock: bool = False, @@ -108,40 +132,46 @@ fire_triggers: bool = False, ) -> None: ... -class Cursor: +class Cursor(Generic[_Row]): """ This class represents a database cursor, which is used to issue queries and fetch results from a database connection. """ - connection: Connection - description: tuple[Any, ...] - lastrowid: int - rowcount: int - returnvalue: object - rownumber: int - _source: Connection + @property + def connection(self) -> Connection[TupleRow | DictRow]: ... + description: tuple[ColumnDescription, ...] | None + @property + def lastrowid(self) -> SqlValue: ... + @property + def rowcount(self) -> int: ... + @property + def returnvalue(self) -> int | None: ... + @property + def rownumber(self) -> int: ... + @property + def _source(self) -> Connection[TupleRow | DictRow]: ... arraysize: int def __init__( self, - conn: Connection, + conn: Connection[TupleRow | DictRow], as_dict: bool, arraysize: int = 1, ) -> None: ... - def __iter__(self) -> Cursor: + def __iter__(self) -> Cursor[_Row]: """ Return self to make cursors compatible with Python iteration protocol. """ ... - def __enter__(self) -> Cursor: ... - def __exit__(self, exc_type, exc_value, traceback) -> None: ... + def __enter__(self) -> Cursor[_Row]: ... + def __exit__(self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None) -> None: ... def callproc( self, procname: str, - parameters: Sequence[str] = ..., - ) -> tuple[Any, ...]: + parameters: Sequence[SqlValue | output] = ..., + ) -> tuple[SqlValue, ...]: """ Call a stored procedure with the given name. @@ -158,26 +188,19 @@ """ ... - def execute(self, operation: str, params: object = ...) -> None: ... + def execute(self, operation: str, params: QueryParams = ...) -> None: ... def executemany( self, operation: str, - seq_of_parameters: Sequence[str], + seq_of_parameters: Sequence[QueryParams], *, batch_size: int = -1, ) -> None: ... def nextset(self) -> int | None: ... - def getrow(self) -> tuple[Any, ...]: - """ - Helper method used by fetchone and fetchmany to fetch and handle - converting the row if as_dict = True. - """ - ... - - def fetchone(self) -> tuple[Any, ...] | None: ... - def fetchmany(self, size: int | None = None) -> list[tuple[Any, ...]] | None: ... - def fetchall(self) -> list[tuple[Any, ...]] | None: ... - def __next__(self) -> tuple[Any, ...] | None: ... + def fetchone(self) -> _Row | None: ... + def fetchmany(self, size: int | None = None) -> list[_Row]: ... + def fetchall(self) -> list[_Row]: ... + def __next__(self) -> _Row: ... def setinputsizes(self, sizes: int | None = None) -> None: """ This method does nothing, as permitted by DB-API specification. @@ -190,64 +213,89 @@ """ ... +@overload def connect( - server: str = ".", - user: str | None = None, - password: str | None = None, - database: str = "", - timeout: int = 0, - login_timeout: int = 60, - charset: str = "UTF-8", - as_dict: bool = False, - host: str = "", - appname: str | None = None, - port: str = "1433", - encryption: str | None = None, - read_only: bool = False, - conn_properties: str | list[str] | None = None, - autocommit: bool = False, - tds_version: str | None = None, - use_datetime2=False, - arraysize: int = 1, -) -> Connection: + server: str = ..., + user: str | None = ..., + password: str | None = ..., + database: str = ..., + timeout: int = ..., + login_timeout: int = ..., + charset: str = ..., + as_dict: Literal[False] = ..., + host: str = ..., + appname: str | None = ..., + port: str = ..., + encryption: str | None = ..., + read_only: bool = ..., + conn_properties: str | list[str] | None = ..., + autocommit: bool = ..., + tds_version: str | None = ..., + use_datetime2: bool = ..., + arraysize: int = ..., +) -> Connection[TupleRow]: ... +@overload +def connect( + server: str, + user: str | None, + password: str | None, + database: str, + timeout: int, + login_timeout: int, + charset: str, + as_dict: Literal[True], + host: str = ..., + appname: str | None = ..., + port: str = ..., + encryption: str | None = ..., + read_only: bool = ..., + conn_properties: str | list[str] | None = ..., + autocommit: bool = ..., + tds_version: str | None = ..., + use_datetime2: bool = ..., + arraysize: int = ..., +) -> Connection[DictRow]: ... +@overload +def connect( + server: str = ..., + user: str | None = ..., + password: str | None = ..., + database: str = ..., + timeout: int = ..., + login_timeout: int = ..., + charset: str = ..., + *, + as_dict: Literal[True], + host: str = ..., + appname: str | None = ..., + port: str = ..., + encryption: str | None = ..., + read_only: bool = ..., + conn_properties: str | list[str] | None = ..., + autocommit: bool = ..., + tds_version: str | None = ..., + use_datetime2: bool = ..., + arraysize: int = ..., +) -> Connection[DictRow]: """ Constructor for creating a connection to the database. Returns a Connection object. :param server: database host - :type server: string - :param user: database user to connect as. Default value: None. - :type user: string - :param password: user's password. Default value: None. - :type password: string + :param user: database user to connect as + :param password: user's password :param database: the database to initially connect to - :type database: string :param timeout: query timeout in seconds, default 0 (no timeout) - :type timeout: int :param login_timeout: timeout for connection and login in seconds, default 60 - :type login_timeout: int :param charset: character set with which to connect to the database - :type charset: string - :keyword as_dict: whether rows should be returned as dictionaries instead of tuples. - :type as_dict: boolean + :keyword as_dict: whether rows should be returned as dictionaries instead of tuples :keyword appname: Set the application name to use for the connection - :type appname: string :keyword port: the TCP port to use to connect to the server - :type port: string - :keyword conn_properties: SQL queries to send to the server upon connection - establishment. Can be a string or another kind - of iterable of strings + :keyword conn_properties: SQL queries to send to the server upon connection establishment :keyword autocommit: Whether to use default autocommitting mode or not - :type autocommit: boolean - :keyword tds_version: TDS protocol version to use. - :type tds_version: string - :keyword use_datetime2: Whether to use datetime.datetime conversion compatible with DATETIME2. Default: False. - :type use_datetime2: bool - :keyword arraysize: - This read/write attribute specifies the number of rows to fetch at a time - with .fetchmany(). It defaults to 1 meaning to fetch a single row at a time. - Default value: 1. - :type arraysize: int + :keyword tds_version: TDS protocol version to use + :keyword use_datetime2: Whether to use datetime.datetime conversion compatible with DATETIME2 + :keyword arraysize: Number of rows to fetch at a time with .fetchmany(). Default: 1 """ ... @@ -258,7 +306,7 @@ """ ... -def set_max_connections(limit: int) -> int: +def set_max_connections(limit: int) -> None: """ Set maximum simultaneous connections db-lib will open to the server. @@ -273,6 +321,8 @@ """ ... +get_freetds_version = get_dbversion + def version_info() -> str: """ Returns string with version information about pymssql, FreeTDS, Python and OS. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pymssql-2.3.12/src/pymssql/exceptions.py new/pymssql-2.3.13/src/pymssql/exceptions.py --- old/pymssql-2.3.12/src/pymssql/exceptions.py 2026-02-11 03:12:39.000000000 +0100 +++ new/pymssql-2.3.13/src/pymssql/exceptions.py 2026-02-14 05:29:17.000000000 +0100 @@ -1,5 +1,3 @@ - - # exception hierarchy class Warning(Exception): pass @@ -32,10 +30,15 @@ pass class ColumnsWithoutNamesError(InterfaceError): - def __init__(self, columns_without_names): + columns_without_names: list[int] + + def __init__(self, columns_without_names: list[int]) -> None: + super().__init__(columns_without_names) self.columns_without_names = columns_without_names - def __str__(self): - return 'Specified as_dict=True and ' \ - 'there are columns with no names: %r' \ + def __str__(self) -> str: + return ( + "Specified as_dict=True and " + "there are columns with no names: %r" % (self.columns_without_names,) + ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pymssql-2.3.12/src/pymssql/exceptions.pyi new/pymssql-2.3.13/src/pymssql/exceptions.pyi --- old/pymssql-2.3.12/src/pymssql/exceptions.pyi 2026-02-11 03:12:39.000000000 +0100 +++ new/pymssql-2.3.13/src/pymssql/exceptions.pyi 2026-02-14 05:29:17.000000000 +0100 @@ -2,6 +2,8 @@ This type stub file was generated by pyright. """ +from typing_extensions import override + class Warning(Exception): ... class Error(Exception): ... class InterfaceError(Error): ... @@ -14,4 +16,7 @@ class NotSupportedError(DatabaseError): ... class ColumnsWithoutNamesError(InterfaceError): - def __init__(self, columns_without_names) -> None: ... + columns_without_names: list[int] + def __init__(self, columns_without_names: list[int]) -> None: ... + @override + def __str__(self) -> str: ... diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pymssql-2.3.12/src/pymssql/version.h new/pymssql-2.3.13/src/pymssql/version.h --- old/pymssql-2.3.12/src/pymssql/version.h 2026-02-11 03:12:44.000000000 +0100 +++ new/pymssql-2.3.13/src/pymssql/version.h 2026-02-14 05:29:23.000000000 +0100 @@ -1 +1 @@ -const char* PYMSSQL_VERSION = "2.3.12"; \ No newline at end of file +const char* PYMSSQL_VERSION = "2.3.13"; \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pymssql-2.3.12/src/pymssql.egg-info/PKG-INFO new/pymssql-2.3.13/src/pymssql.egg-info/PKG-INFO --- old/pymssql-2.3.12/src/pymssql.egg-info/PKG-INFO 2026-02-11 03:12:44.000000000 +0100 +++ new/pymssql-2.3.13/src/pymssql.egg-info/PKG-INFO 2026-02-14 05:29:23.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.4 Name: pymssql -Version: 2.3.12 +Version: 2.3.13 Summary: DB-API interface to Microsoft SQL Server for Python. (new Cython-based version) Author-email: Damien Churchill <[email protected]> Maintainer-email: Mikhail Terekhov <[email protected]> @@ -614,26 +614,19 @@ ============== -Version 2.3.12 - 2026-02-10 - Mikhail Terekhov +Version 2.3.13 - 2026-02-13 - Mikhail Terekhov ============================================== General ------- -- Update manylinux base image to manylinux_2_28 to fix CVE-2023-0464, thanks to [email protected]. +- Fix type stubs with generics, overloads, and corrected types, thanks to jacks0n. -Version 2.3.11 - 2025-12-30 - Mikhail Terekhov +Version 2.3.12 - 2026-02-10 - Mikhail Terekhov ============================================== General ------- -- Drop build of MacOS-13 wheels (The macOS-13 based runner images are now retired on GitHub). - -Internals ---------- - -- Bump actions/upload-artifacts and actions/download-artifacts. -- Update psutil requirement to <7.2.2 for testing wheels. -- Improve executemany to get every batch result and check for the total query size (for #952). +- Update manylinux base image to manylinux_2_28 to fix CVE-2023-0464, thanks to [email protected].
