I have been carrying these changes manually for a while so I thought it's about time to see if you might be interested in merging them.
We use ogr_fdw_info as part of an automated process for loading client spreadsheets (XLSX) but the current version was not quite suitable for the following reasons.
Unable to specify output server name.
Unable to specify output table name.
Unable to use worksheet index rather than layer.
Unable to add config options to the foreign data wrapper
Column names were not quoted leading to the possibility of invalid SQL output
Column names were not limited to a max number of characters leading to the program crashing if, for example, the client had forgotten to add column names and the column contains a lot of raw data.
No exit code to let the calling program know if there has been an OGR Error
I would be happy to make any amendments if you are happy to merge with changes.
If you can reduce the number of formatting changes, that is always helpful in evaluating a patch. Emulating the "house style" is always preferred. (Just some paren padding and placement of * differences).
The philosophy around case handling is that, in generating SQL to create FDW tables, we'd like to default to allowing PgSQL case coercion so that the generated tables have lower case by default. That said, an option for people who want to retain the casing of their source tables, or who have created tables with case correct columns of table names, should still have a functional system. But the bias is towards generating things that are PgSQL-friendly, not OGR-friendly, while still allowing the system to work with mixed-case.
Bringing the concept of a "sheet number" into this level of the code is not good. There's no sheet numbers in Oracle, there's no sheets in WFS, there's no sheet numbers in Shape files. That idea needs to be subsumed somehow into a concept that is generic across drivers. I've never done workbook access before so I need to read a little more closely into your code, but surely there's a generic OGC concept we can expose that works over multiple drivers.
Hi
I have been carrying these changes manually for a while so I thought it's about time to see if you might be interested in merging them.
We use ogr_fdw_info as part of an automated process for loading client spreadsheets (XLSX) but the current version was not quite suitable for the following reasons.
I would be happy to make any amendments if you are happy to merge with changes.
Many thanks
Kieran