diff --git a/salesforcecdpconnector/connection.py b/salesforcecdpconnector/connection.py index ff92e9e..5953726 100644 --- a/salesforcecdpconnector/connection.py +++ b/salesforcecdpconnector/connection.py @@ -14,7 +14,7 @@ apilevel = "2.0" threadsafety = 2 -paramstyle = "qmark" +paramstyle = None class SalesforceCDPConnection: diff --git a/salesforcecdpconnector/cursor.py b/salesforcecdpconnector/cursor.py index 8ff00e8..1f6a963 100644 --- a/salesforcecdpconnector/cursor.py +++ b/salesforcecdpconnector/cursor.py @@ -158,13 +158,8 @@ def _resolve_query_with_params(self, query, params): if params is None and params_count_from_query == 0: return query - if self._is_iterable(params) and params_count_from_query == len(params): - for param in params: - query = self._replace_next_param(query, param) - elif params_count_from_query == 1 and params is not None: - query = self._replace_next_param(query, params) - else: - raise Exception('Parameter count not matching') + if params: + raise Exception('Parameters are not supported') return query diff --git a/tests/test_cursor.py b/tests/test_cursor.py index c212a24..1d275ec 100644 --- a/tests/test_cursor.py +++ b/tests/test_cursor.py @@ -155,5 +155,12 @@ def test_fetchoneendingwithemptybatch(self, mock1, mock2): self.assertEqual(len(all_records), 3) cursor.close() + def test_params_fail(self): + connection = SalesforceCDPConnection('login_url', 'username', 'password', 'client_id', 'client_secret') + cursor = connection.cursor() + with self.assertRaises(Exception) as context: + cursor.execute("select * from UnifiedIndividuals__dlm where col__c = ?", ['test']) + self.assertTrue("Parameters are not supported" in context.exception.args) + if __name__ == '__main__': unittest.main()