(self, value_to_find, operator='or')
| 160 | |
| 161 | |
| 162 | def create_query_to_all_values(self, value_to_find, operator='or'): |
| 163 | rows = self.get_tables_and_columns() |
| 164 | queries:List[Query] = [] |
| 165 | for row in rows: |
| 166 | query="" |
| 167 | table_name = row["table_name"] |
| 168 | columns_list = ','.join(f'[{col}]' for col in row["columns"]) |
| 169 | for index, col in enumerate(row["columns"]): |
| 170 | if index == 0: |
| 171 | query = f"[{col}] like '%{value_to_find}%'" |
| 172 | else: |
| 173 | query += f" {operator} [{col}] like '%{value_to_find}%'" |
| 174 | |
| 175 | sentence = f"Select {columns_list} from {table_name} where {query}" |
| 176 | queries.append(Query(word=value_to_find, sentence=sentence, tablename=table_name)) |
| 177 | |
| 178 | return queries |
| 179 | |
| 180 | |
| 181 | def create_table(self, name:str, columns=None): |
nothing calls this directly
no test coverage detected