Coverage for packages/sql-smith/src/sql_smith/engine/postgres_engine.py: 67%

9 statements  

« prev     ^ index     » next       coverage.py v7.11.0, created at 2024-01-01 00:00 +0000

1from sql_smith.engine import CommonEngine 

2from sql_smith.query.postgres import InsertQuery, UpdateQuery 

3 

4 

5class PostgresEngine(CommonEngine): 

6 """A custom engine for Postgres SQL dialect.""" 

7 

8 def make_insert(self) -> "InsertQuery": 

9 """Creates a custom Postgres INSERT query. 

10 

11 The Postgres insert query supports RETURNING. 

12 """ 

13 return InsertQuery(self) 

14 

15 def make_update(self) -> "UpdateQuery": 

16 """Creates a custom Postgres INSERT query. 

17 

18 The Postgres update query supports RETURNING. 

19 """ 

20 return UpdateQuery(self) 

21 

22 def get_parameter_placeholder(self) -> str: 

23 return "%s"