Skip to content

Commit

Permalink
Removing unused methods
Browse files Browse the repository at this point in the history
  • Loading branch information
vish689 committed May 10, 2024
1 parent a72e7b1 commit 055cf16
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions salesforcecdpconnector/cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ class SalesforceCDPCursor:
This class represents the cursor
"""

_TRANSLATION_TABLE = str.maketrans({"\\": r"\\",
"\n": r"\\n",
"\r": r"\\r",
"'": r"\'"})

def __init__(self, connection):
self.arraysize = 1
self.description = None
Expand Down Expand Up @@ -154,25 +149,8 @@ def _check_cursor_closed(self):
raise Error('Attempting operation while connection is closed')

def _resolve_query_with_params(self, query, params):
params_count_from_query = query.count('?')
if params is None and params_count_from_query == 0:
return query

if params:
raise Exception('Parameters are not supported')

return query

def _replace_next_param(self, query, param):
if param is None:
query = query.replace('?', 'null', 1)
elif self._is_numeric(param):
query = query.replace('?', str(param), 1)
else:
if not isinstance(param, str):
param = str(param)
param = param.translate(self._TRANSLATION_TABLE)
query = query.replace('?', f"'{str(param)}'", 1)
return query

def _is_iterable(self, param):
Expand Down

0 comments on commit 055cf16

Please sign in to comment.