Baboo7 / strapi-plugin-import-export-entries

Import/Export data from and to your database in just few clicks.
175 stars 86 forks source link

Fix for dash-named tables in PG SQL #187

Open rubytech-avsorokin opened 5 months ago

rubytech-avsorokin commented 5 months ago

Bugfix Import failed when collection name contains dash in it's name.

Escaping tablename in double quotes.

binarybase commented 3 months ago

+1

I also faced this issue, I've fixed it with double quotes like you

otherwise triggers syntax error

strapiDB  | 2024-06-05 19:33:11.441 UTC [74] ERROR:  syntax error at or near "-" at character 104
strapiDB  | 2024-06-05 19:33:11.441 UTC [74] STATEMENT:  SELECT SETVAL((SELECT PG_GET_SERIAL_SEQUENCE('ctype-grouping_group', 'id')), (SELECT MAX(id) FROM ctype-grouping_group) + 1, FALSE);
strapi    | [2024-06-05 19:33:11.443] error: SELECT SETVAL((SELECT PG_GET_SERIAL_SEQUENCE('ctype-grouping_group', 'id')), (SELECT MAX(id) FROM ctype-grouping_group) + 1, FALSE); - syntax error at or near "-"