Open
Description
Different applications that are capable of importing CSV files have different ways of handling some data types. Indeed, that it why CSVEncoderConfiguration
exists.
But each app generally wants the same format all the time, and developers shouldn’t need to have to remember (or investigate) which date formats are needed for the most popular apps.
We could provide static instances of CSVEncoderConfiguration
that have the necessary encoding strategies predefined, for example:
CSVEncoderConfiguration.excel // All the necessary config to ensure CSV files are readable by Microsoft Excel
CSVEncoderConfiguration.numbers // All the necessary config to ensure CSV files are readable by Apple Numbers
This would make the definitions more expressive while hiding the implementation detail:
let table = CSVTable<Person>(columns: [ … ], configuration: .excel)