Generic Generate SQL Feature/Idea (SQL templates for Generate SQL and Export to SQL)
See original GitHub issueThe generate sql feature is similar the export as sql feature in Heidisql. One thing I’ve used in the past is export as sql and choose REPLACE INTO
as the command.
Is it possible to export all of the result set of a sql query as REPLACE INTO
queries? It seems like the generate sql feature only works on visible result sets, and I need all of it.
Now adding every sql extension is probably not scalable. So perhaps there can be a way of designing a expression template so that the values will slot into the template. And then the generate as sql feature can be added to the export feature allowing the export of the entire query, and not just selected parts. These 2 features seem like they overlap. One should be able to select which rows/columns to take out or select all of them.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:10 (5 by maintainers)
Top GitHub Comments
Well imagine if we had sql templates for the current generate sql feature:
Then we could create our own queries beyond the current 3 supported in generate sql, and the 1 supported in export results. We could create a
REPLACE
version as well. Note that the export results currently only hasINSERT
as the command prefix.We may need to consider different substitution variables depending on what kind of command we’re doing. One idea might be
${col:id} = ${val:id}
to mean theid
named columns and the corresponding value. Or${pricol} = ${prival}
to give special precedence to the primary column.Any body else got selector syntax ideas?
REPLACE INTO into list of INSERT expressions added