Describe the bug
The SQL exporter will not create SQL-compliant column names. If a column has spaces, they are replaced with "-" by default, and replaced with nothing if the "Trim Column Names" checkbox is unchecked. Hyphens are not an acceptable character in a SQL column name.
To Reproduce
Steps to reproduce the behavior:
- Open a dataset that has column names with spaces in them.
- Click Export>SQL Exporter.
- Click "Download" tab.
- Click Preview
- Attempt to create a table in an SQL database with the SQL exported by OpenRefine. It will not create, and SQL will print an error like:
ERROR: syntax error at or near "-"
LINE 11: Line1-Street TEXT NULL,
^
Current Results
What results occured or were shown.
Expected behavior
The SQL Exporter should, by default, convert column names to an SQL-compliant name, replacing spaces and other illegal characters with "_" (underscore). Column names can also not begin with numbers. They cannot have single quotes or punctuation.
Screenshots



Desktop (please complete the following information):
- OS: Mac 10.14.2
- Browser Version: Safari 12.0.2
- JRE or JDK Version: 1.8.0_121
OpenRefine (please complete the following information):
Describe the bug
The SQL exporter will not create SQL-compliant column names. If a column has spaces, they are replaced with "-" by default, and replaced with nothing if the "Trim Column Names" checkbox is unchecked. Hyphens are not an acceptable character in a SQL column name.
To Reproduce
Steps to reproduce the behavior:
Current Results
What results occured or were shown.
Expected behavior
The SQL Exporter should, by default, convert column names to an SQL-compliant name, replacing spaces and other illegal characters with "_" (underscore). Column names can also not begin with numbers. They cannot have single quotes or punctuation.
Screenshots



Desktop (please complete the following information):
OpenRefine (please complete the following information):