Skip to content

Commit 0e8272f

Browse files
ekanshulclaude
andcommitted
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 <noreply@anthropic.com>
1 parent e8b9e19 commit 0e8272f

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

stubs/ibm-db/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version = "3.2.9"
1+
version = "3.3.0"
22
upstream-repository = "https://github.com/ibmdb/python-ibmdb"

stubs/ibm-db/ibm_db.pyi

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ SQL_BOOLEAN: Final[int]
3939
SQL_CHAR: Final[int]
4040
SQL_CLOB: Final[int]
4141
SQL_CLOB_LOCATOR: Final[int]
42+
SQL_CONCURRENT_TRANS: Final[int]
43+
SQL_COORDINATED_TRANS: Final[int]
4244
SQL_CURSOR_DYNAMIC: Final[int]
4345
SQL_CURSOR_FORWARD_ONLY: Final[int]
4446
SQL_CURSOR_KEYSET_DRIVEN: Final[int]
@@ -162,6 +164,7 @@ SQL_ATTR_REPORT_SEAMLESSFAILOVER_WARNING: Final[int]
162164
SQL_ATTR_REPORT_TIMESTAMP_TRUNC_AS_WARN: Final[int]
163165
SQL_ATTR_RETRYONERROR: Final[int]
164166
SQL_ATTR_RETRY_ON_MERGE: Final[int]
167+
SQL_ATTR_ROW_ARRAY_SIZE: Final[int]
165168
SQL_ATTR_SERVER_MSGTXT_MASK: Final[int]
166169
SQL_ATTR_SERVER_MSGTXT_SP: Final[int]
167170
SQL_ATTR_SESSION_GLOBAL_VAR: Final[int]
@@ -193,6 +196,10 @@ class IBM_DBClientInfo:
193196
class IBM_DBConnection:
194197
def __new__(cls, *args: object, **kwargs: object) -> Self: ...
195198

199+
@final
200+
class IBM_DBEnvHandle:
201+
def __new__(cls, *args: object, **kwargs: object) -> Self: ...
202+
196203
@final
197204
class IBM_DBServerInfo:
198205
def __new__(cls, *args: object, **kwargs: object) -> Self: ...
@@ -224,6 +231,7 @@ class IBM_DBStatement:
224231
def __new__(cls, *args: object, **kwargs: object) -> Self: ...
225232

226233
def active(connection: IBM_DBConnection | None, /) -> bool: ...
234+
def alloc_env_handle() -> IBM_DBEnvHandle: ...
227235
def autocommit(connection: IBM_DBConnection, value: int = ..., /) -> int | bool: ...
228236
def bind_param(
229237
stmt: IBM_DBStatement,
@@ -262,12 +270,14 @@ def columns(
262270
/,
263271
) -> IBM_DBStatement: ...
264272
def commit(connection: IBM_DBConnection, /) -> bool: ...
273+
def commit_two_phase(env_handle: IBM_DBEnvHandle, /) -> bool: ...
265274
def conn_error(connection: IBM_DBConnection | None = ..., /) -> str: ...
266275
def conn_errormsg(connection: IBM_DBConnection | None = ..., /) -> str: ...
267276
def conn_warn(connection: IBM_DBConnection | None = ..., /) -> str: ...
268277
def connect(
269278
database: str, user: str, password: str, options: dict[int, int | str] | None = ..., replace_quoted_literal: int = ..., /
270279
) -> IBM_DBConnection | None: ...
280+
def connect_coordinated(env_handle: IBM_DBEnvHandle, database: str, user: str, password: str, /) -> IBM_DBConnection: ...
271281
def createdb(connection: IBM_DBConnection, dbName: str, codeSet: str = ..., mode: str = ..., /) -> bool: ...
272282
def createdbNX(connection: IBM_DBConnection, dbName: str, codeSet: str = ..., mode: str = ..., /) -> bool: ...
273283
def cursor_type(stmt: IBM_DBStatement, /) -> int: ...
@@ -306,6 +316,7 @@ def foreign_keys(
306316
fk_table_name: str | None = ...,
307317
/,
308318
) -> IBM_DBStatement: ...
319+
def free_env_handle(env_handle: IBM_DBEnvHandle, /) -> bool: ...
309320
def free_result(stmt: IBM_DBStatement, /) -> bool: ...
310321
def free_stmt(stmt: IBM_DBStatement, /) -> bool: ...
311322
def get_db_info(connection: IBM_DBConnection, option: int, /) -> str | bool: ...
@@ -334,7 +345,9 @@ def procedures(
334345
def recreatedb(connection: IBM_DBConnection, dbName: str, codeSet: str | None = ..., mode: str | None = ..., /) -> bool: ...
335346
def result(stmt: IBM_DBStatement, column: int | str, /) -> Any: ...
336347
def rollback(connection: IBM_DBConnection, /) -> bool: ...
348+
def rollback_two_phase(env_handle: IBM_DBEnvHandle, /) -> bool: ...
337349
def server_info(connection: IBM_DBConnection, /) -> IBM_DBServerInfo | bool: ...
350+
def set_env_attr(env_handle: IBM_DBEnvHandle, attribute: int, value: int, /) -> bool: ...
338351
def set_option(resc: IBM_DBConnection | IBM_DBStatement, options: dict[int, int | str], type: int, /) -> bool: ...
339352
def special_columns(
340353
connection: IBM_DBConnection, qualifier: str | None, schema: str | None, table_name: str | None, scope: int, /

0 commit comments

Comments
 (0)