From 0e8272f3f9b1184381e5616dc7b95eefff906559 Mon Sep 17 00:00:00 2001 From: ANSHUL SINGH <72524975+ekanshul@users.noreply.github.com> Date: Wed, 19 Aug 2026 21:31:09 +0530 Subject: [PATCH] Bump ibm-db to 3.3.0 ibm-db 3.3.0 adds a two-phase commit API: the IBM_DBEnvHandle type, the SQL_CONCURRENT_TRANS, SQL_COORDINATED_TRANS and SQL_ATTR_ROW_ARRAY_SIZE constants, and the alloc_env_handle, set_env_attr, free_env_handle, connect_coordinated, commit_two_phase and rollback_two_phase functions. Add them to the stub so stubtest passes against the new release. Signatures follow the PyArg_ParseTuple formats and return paths in ibm_db.c at tag v3.3.0. Co-Authored-By: Claude Fable 5 --- stubs/ibm-db/METADATA.toml | 2 +- stubs/ibm-db/ibm_db.pyi | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/stubs/ibm-db/METADATA.toml b/stubs/ibm-db/METADATA.toml index a77703ca345a..a39a4ef3eacb 100644 --- a/stubs/ibm-db/METADATA.toml +++ b/stubs/ibm-db/METADATA.toml @@ -1,2 +1,2 @@ -version = "3.2.9" +version = "3.3.0" upstream-repository = "https://github.com/ibmdb/python-ibmdb" diff --git a/stubs/ibm-db/ibm_db.pyi b/stubs/ibm-db/ibm_db.pyi index f5abb899bc83..a7e9456b7515 100644 --- a/stubs/ibm-db/ibm_db.pyi +++ b/stubs/ibm-db/ibm_db.pyi @@ -39,6 +39,8 @@ SQL_BOOLEAN: Final[int] SQL_CHAR: Final[int] SQL_CLOB: Final[int] SQL_CLOB_LOCATOR: Final[int] +SQL_CONCURRENT_TRANS: Final[int] +SQL_COORDINATED_TRANS: Final[int] SQL_CURSOR_DYNAMIC: Final[int] SQL_CURSOR_FORWARD_ONLY: Final[int] SQL_CURSOR_KEYSET_DRIVEN: Final[int] @@ -162,6 +164,7 @@ SQL_ATTR_REPORT_SEAMLESSFAILOVER_WARNING: Final[int] SQL_ATTR_REPORT_TIMESTAMP_TRUNC_AS_WARN: Final[int] SQL_ATTR_RETRYONERROR: Final[int] SQL_ATTR_RETRY_ON_MERGE: Final[int] +SQL_ATTR_ROW_ARRAY_SIZE: Final[int] SQL_ATTR_SERVER_MSGTXT_MASK: Final[int] SQL_ATTR_SERVER_MSGTXT_SP: Final[int] SQL_ATTR_SESSION_GLOBAL_VAR: Final[int] @@ -193,6 +196,10 @@ class IBM_DBClientInfo: class IBM_DBConnection: def __new__(cls, *args: object, **kwargs: object) -> Self: ... +@final +class IBM_DBEnvHandle: + def __new__(cls, *args: object, **kwargs: object) -> Self: ... + @final class IBM_DBServerInfo: def __new__(cls, *args: object, **kwargs: object) -> Self: ... @@ -224,6 +231,7 @@ class IBM_DBStatement: def __new__(cls, *args: object, **kwargs: object) -> Self: ... def active(connection: IBM_DBConnection | None, /) -> bool: ... +def alloc_env_handle() -> IBM_DBEnvHandle: ... def autocommit(connection: IBM_DBConnection, value: int = ..., /) -> int | bool: ... def bind_param( stmt: IBM_DBStatement, @@ -262,12 +270,14 @@ def columns( /, ) -> IBM_DBStatement: ... def commit(connection: IBM_DBConnection, /) -> bool: ... +def commit_two_phase(env_handle: IBM_DBEnvHandle, /) -> bool: ... def conn_error(connection: IBM_DBConnection | None = ..., /) -> str: ... def conn_errormsg(connection: IBM_DBConnection | None = ..., /) -> str: ... def conn_warn(connection: IBM_DBConnection | None = ..., /) -> str: ... def connect( database: str, user: str, password: str, options: dict[int, int | str] | None = ..., replace_quoted_literal: int = ..., / ) -> IBM_DBConnection | None: ... +def connect_coordinated(env_handle: IBM_DBEnvHandle, database: str, user: str, password: str, /) -> IBM_DBConnection: ... def createdb(connection: IBM_DBConnection, dbName: str, codeSet: str = ..., mode: str = ..., /) -> bool: ... def createdbNX(connection: IBM_DBConnection, dbName: str, codeSet: str = ..., mode: str = ..., /) -> bool: ... def cursor_type(stmt: IBM_DBStatement, /) -> int: ... @@ -306,6 +316,7 @@ def foreign_keys( fk_table_name: str | None = ..., /, ) -> IBM_DBStatement: ... +def free_env_handle(env_handle: IBM_DBEnvHandle, /) -> bool: ... def free_result(stmt: IBM_DBStatement, /) -> bool: ... def free_stmt(stmt: IBM_DBStatement, /) -> bool: ... def get_db_info(connection: IBM_DBConnection, option: int, /) -> str | bool: ... @@ -334,7 +345,9 @@ def procedures( def recreatedb(connection: IBM_DBConnection, dbName: str, codeSet: str | None = ..., mode: str | None = ..., /) -> bool: ... def result(stmt: IBM_DBStatement, column: int | str, /) -> Any: ... def rollback(connection: IBM_DBConnection, /) -> bool: ... +def rollback_two_phase(env_handle: IBM_DBEnvHandle, /) -> bool: ... def server_info(connection: IBM_DBConnection, /) -> IBM_DBServerInfo | bool: ... +def set_env_attr(env_handle: IBM_DBEnvHandle, attribute: int, value: int, /) -> bool: ... def set_option(resc: IBM_DBConnection | IBM_DBStatement, options: dict[int, int | str], type: int, /) -> bool: ... def special_columns( connection: IBM_DBConnection, qualifier: str | None, schema: str | None, table_name: str | None, scope: int, /