-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Feature Request
It would be valuable to support deserializing and serializing CSV rows using Zig structs, similar to how Rust's serde library allows users to define a struct and seamlessly read/write rows via those types.
Proposal:
- Allow users to define a Zig struct that matches the columns in the CSV.
- Implement functions/macros to read a CSV row directly into a struct and write a struct out as a CSV row.
- This would improve type-safety, ergonomics, and reduce boilerplate for users who want to work directly with typed data.
Reference
- Rust serde's approach (https://serde.rs/) is a relevant prior art for how struct <-> row mapping can be achieved.
Questions:
- What should the API look like for the user?
- Should we support field tagging/annotation for custom column names or skipping fields?
- Does this even make sense in the first place?
This feature will greatly enhance usability for applications handling structured CSV data in Zig.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request