diff --git a/py_dbcn/connectors/core/records.py b/py_dbcn/connectors/core/records.py index 683c4f61ab2b7e26e8a4eee75d66d66a75f28f88..479d813f79a124b9939327cb6031ce15bf48e06e 100644 --- a/py_dbcn/connectors/core/records.py +++ b/py_dbcn/connectors/core/records.py @@ -56,10 +56,13 @@ class BaseRecords: select_clause = self._base.validate.sanitize_select_clause(select_clause) # Check that provided WHERE clause is valid format. + # TODO: Implement proper clause sanitization. if where_clause is None: where_clause = '' where_clause = str(where_clause).strip() - where_clause = where_clause.casefold().lstrip('WHERE ') + if where_clause.lower().startswith('where'): + where_clause = where_clause[5:] + where_clause = where_clause.strip() if len(where_clause) > 1: where_clause = '\nWHERE ({0})'.format(where_clause) if not self._base.validate.where_clause(where_clause):