Closed volcan01010 closed 2 years ago
On reflection, I have decided against this. Although this code is unlikely to be used to generate queries from user-derived input, allowing arbitrary text strings to be included into SQL statements isn't good practice.
Instead, commit 11c4b59d354b12c0424c7293e6def7a9c5e5d6fb makes the generate_insert_sql
function more accessible. Users can call it directly to provide a base query.
Summary
As an ETLHelper user I want to be able to add WHERE clauses to
copy_table_rows
so that I have more flexibility while still not having to write full queriesDescription
copy_table_rows
runs a "SELECT * FROM table" query, andload
runs an "INSERT INTO table (...) VALUES (...)" query. In the first case, it would be nice to be able to add a WHERE or ORDER BY or LIMIT to the query. In the second case it would be nice to add "ON CONFLICT DO NOTHING" or something similar.Adding parameters for
select_sql_suffix
andexecute_sql_suffix
to the respective functions that appended whatever text was given would be a simple way to allow this.Acceptance criteria
copy_table_rows
acceptsselect_sql_suffix
andexecute_sql_suffix
load
acceptsexecute_sql_suffix