|
12 | 12 | """ |
13 | 13 | Add Common E2E Sqlalchemy Mixins |
14 | 14 | """ |
15 | | -from sqlalchemy import text |
16 | 15 |
|
17 | 16 |
|
18 | 17 | class SQACommonMethods: |
19 | 18 | def create_table_and_view(self) -> None: |
20 | 19 | with self.engine.begin() as connection: |
21 | | - connection.execute(text(self.create_table_query)) |
| 20 | + connection.exec_driver_sql(self.create_table_query) |
22 | 21 | for insert_query in self.insert_data_queries: |
23 | | - connection.execute(text(insert_query)) |
24 | | - connection.execute(text(self.create_view_query)) |
| 22 | + connection.exec_driver_sql(insert_query) |
| 23 | + connection.exec_driver_sql(self.create_view_query) |
25 | 24 |
|
26 | 25 | def delete_table_and_view(self) -> None: |
27 | 26 | with self.engine.begin() as connection: |
28 | | - connection.execute(text(self.drop_view_query)) |
29 | | - connection.execute(text(self.drop_table_query)) |
| 27 | + connection.exec_driver_sql(self.drop_view_query) |
| 28 | + connection.exec_driver_sql(self.drop_table_query) |
30 | 29 |
|
31 | 30 | def run_update_queries(self) -> None: |
32 | 31 | with self.engine.begin() as connection: |
33 | 32 | for update_query in self.update_queries(): |
34 | | - connection.execute(text(update_query)) |
| 33 | + connection.exec_driver_sql(update_query) |
35 | 34 |
|
36 | 35 | def run_delete_queries(self) -> None: |
37 | 36 | with self.engine.begin() as connection: |
38 | 37 | for drop_query in self.delete_queries(): |
39 | | - connection.execute(text(drop_query)) |
| 38 | + connection.exec_driver_sql(drop_query) |
0 commit comments