Skip to content

Commit cbbe9d6

Browse files
committed
cleaning up
1 parent 2eb1a51 commit cbbe9d6

File tree

3 files changed

+91
-91
lines changed

3 files changed

+91
-91
lines changed

mssql_python/connection.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,24 +1236,6 @@ def __exit__(self, *args) -> None:
12361236
if not self._closed:
12371237
self.close()
12381238

1239-
def enable_performance_mode(self):
1240-
"""
1241-
Performance optimizations are enabled by default.
1242-
This method is kept for backward compatibility.
1243-
"""
1244-
pass
1245-
1246-
def disable_performance_mode(self):
1247-
"""
1248-
Performance optimizations are enabled by default and cannot be disabled.
1249-
This method is kept for backward compatibility.
1250-
"""
1251-
pass
1252-
1253-
def is_performance_mode_enabled(self):
1254-
"""Performance mode is always enabled."""
1255-
return True
1256-
12571239
def __del__(self):
12581240
"""
12591241
Destructor to ensure the connection is closed when the connection object is no longer needed.

mssql_python/cursor.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ def __init__(self, connection, timeout: int = 0) -> None:
8080
self._initialize_cursor()
8181
self.description = None
8282
self.rowcount = -1
83-
self.arraysize = 5000 # Optimized default for better performance
83+
self.arraysize = (
84+
1 # Default number of rows to fetch at a time is 1, user can change it
85+
)
8486
self.buffer_length = 1024 # Default buffer length for string data
8587
self.closed = False
8688
self._result_set_empty = False # Add this initialization
@@ -97,7 +99,6 @@ def __init__(self, connection, timeout: int = 0) -> None:
9799
# rownumber attribute
98100
self._rownumber = -1 # DB-API extension: last returned row index, -1 before first
99101

100-
# Performance optimizations
101102
self._cached_column_map = None
102103
self._cached_converter_map = None
103104
self._next_row_index = 0 # internal: index of the next row the driver will return (0-based)
@@ -476,8 +477,6 @@ def _allocate_statement_handle(self):
476477
"""
477478
self.hstmt = self._connection._conn.alloc_statement_handle()
478479

479-
480-
481480
def _reset_cursor(self) -> None:
482481
"""
483482
Reset the DDBC statement handle.

0 commit comments

Comments
 (0)