Releases: matthewtolman/zig_csv
v0.8.0 - Updated Supported Zig to 0.14.0
Updated to latest Zig 0.14.0 full release.
Also updated build pipeline to track against Zig master, and adjusted build pipeline to match new zigup behavior.
Full Changelog: v0.7.3...v0.8.0
v0.7.3 - Bug fixes
Fixed bug with slice reader
Full Changelog: v0.7.2...v0.7.3
v0.7.2 - Updated target version of Zig dev
What's Changed
- Update writer.zig for latest master by @niicojs in #12
- Updated docs by @matthewtolman in #13
New Contributors
Full Changelog: v0.7.1...v0.7.2
v0.7.1 - Bug Fixes
Fixed a bug where zero-allocation parsers were sometimes returning an empty row at the end of a file. This was because the parsers would assume that CRLF or LF would indicate the start of a row, not the end of a row, in some circumstances. This was found by parsing a 13MB file locally.
v0.7.0 - API overhaul, introduced ParserBuilder
Major Change - Upgrade Notes
This is a major change in the usage interface. This includes changes to parser names and namespaces, retiring slow parsers, and moving type conversion methods.
Parser Name Changes
List of old parsers to new names are as follows:
- zcsv.map_ck.Parser -> zcsv.allocs.map.Parser
- zcsv.map_ck.init -> zcsv.allocs.map.init
- zcsv.map_sk.Parser -> zcsv.allocs.map_temporary.Parser
- zcsv.map_sk.init -> zcsv.allocs.map_temporary.init
- zcsv.column.Parser -> zcsv.allocs.column.Parser
- zcsv.column.init -> zcsv.allocs.column.init
- zcsv.slice.rows.Parser -> zcsv.zero_allocs.slice.Parser
- zcsv.slice.rows.init -> zcsv.zero_allocs.slice.init
- zcsv.slice.fields.Parser -> zcsv.zero_allocs.slice.FieldsParser
- zcsv.slice.fields.init -> zcsv.zero_allocs.slice.fieldsInit
- zcsv.stream_fast.Parser -> zcsv.zero_allocs.stream.Parser
- zcsv.stream_fast.init -> zcsv.zero_allocs.stream.init
- zcsv.raw.Parser - REMOVED (use
zcsv.zero_allocs.slice.Parser
) - zcsv.raw.init - REMOVED (use
zcsv.zero_allocs.slice.init
) - zcsv.stream.Parser - REMOVED (use
zcsv.zero_allocs.stream.Parser
) - zcsv.stream.init - REMOVED (use
zcsv.zero_allocs.stream.init
)
Field struct changes
All of the field type conversion methods (e.g. asInt
, asFloat
, asBool
, isNull
, asSlice
, etc) have been moved off of the structs and into a shared decode
namespace. This namespace provides the methods fieldToInt
, fieldToFloat
, fieldToBool
, fieldIsNull
, and writeFieldStrTo
as replacements for the old methods. These replacements work on any field type, regardless of whether it's allocating (and decoded) or raw (and encoded). Similar methods have been provided for slices (though the slice methods assume the input is already decoded). Additional methods are provided for more niche use cases.
For the non-allocating raw Field, we no longer have the data
property. Instead, we have the raw
and opts
methods. raw
will provide the raw data in the original CSV. opts
will provide the CSV options which can be used for decoding.
Other Changes
The decode_writer
(documented to be internal) has been moved to a non-exported namespace called internal
. Several methods have been renamed, removed, or added to each Row struct to make the interface more uniform. This does not impact map parsers as those parsers work on maps and not sequential ranges.
A new ParserBuilder
has been added.
What's Changed
- Reworked interface to make it more unified by @matthewtolman in #10
- Separated field parsing (e.g. asInt) from the Field structs and put parsing logic into a standalone module
- Removed parsers that were obsolete (slow raw, slow stream)
- Split parsers into namespaces
allocs
andzero_allocs
based on allocating properties - Renamed
map_ck
tomap
andmap_sk
tomap_temporary
- Reworked field to have shared clone API and different
data
vsraw
,opts
methods- Allocating fields have
data
- Zero-allocating fields have
raw
andopts
- Allocating fields have
- Reworked Row structs to have interchangeable interface (though they do have different performance complexities)
- Both now have
iter()
,len()
,field(usize)
,fieldOrNull(usize)
- Both now have
- Unified the Field structs for
map
andcolumn
parsers - Unified the Row and Field structs for both
map
andmap_temporary
parsers - Moved internal
decode_writer
namespace to theinternal
namespace - Updated the library to only export the
zero_allocs
,allocs
,writer
,decode
namespaces. It also exports theCsvWriteError
,CsvReadError
, andParseBoolError
error sets - Renamed
stream_fast
tostream
- Renamed
slices.row
toslice
- Made
slices.row
the default slice-based parser for zero-allocation in-memory parsing- Done by making
zcsv.zero_allocs.slice.init
create aslices.row
parser
- Done by making
- Made
slices.fields
a sub-parser under theslices
namespace- Done by making
zcsv.zero_allocs.slice.fieldsInit
create aslices.field
parser
- Done by making
- Added new builder for parsers in
zcsv.ParserBuilder
- Builder allows creating new parsers based on more usage focused needs (e.g. with reader input and headers)
- Builder also provides methods for abstracting away clean up of created parser and rows
- Automatically becomes a no-op if cleanup isn't needed
- Makes switching between parsers without introducing memory leaks easier
- Updated examples, removed obsolete examples, and added new examples as needed
- Updated README
Full Changelog: v0.6.0...v0.7.0
v0.6.0 - Customizable delimiters, quotes, etc.
What's Changed
- Added customizable delimiters, quotes, and line endings for parsers and writers by @matthewtolman in #9
- Added Writer wrapper struct to track underlying options by @matthewtolman in #9
- Bumped supported zig 0.14.0-dev version by @matthewtolman in #9
- Updated documentation by @matthewtolman in #9
Full Changelog: v0.5.2...v0.6.0
v0.5.2 - Fixed Zon version
Fixed Zon version
v0.5.1 - stream_fast bug fix
What's Changed
- Fixed stream_fast newline bug
- updated docs
by @matthewtolman in #7
Full Changelog: v0.5.0...v0.5.1
0.5.0
- Switched from
stream
tostream_fast
for underlying parser - Standardized
stream
init interface - Updated documentation
Full Changelog: v0.4.0...v0.5.0
0.4.0
Released version 0.4.0
- Merged field memory into row memory for allocating parsers
- This resulted in a 2-3x speed improvement with large files for allocating parsers
- Required changing inner workings of Field and adding a new RowField
- RowField needed since ArrayList will invalidate pointers on reallocation
- Removed
Field.clone()
- Renamed
Field.cloneAlloc(std.mem.Allocator)
toField.clone(std.mem.Allocator)
- Removed
Field.detachMemory()
- Removed
Row.fields()
andRow.fieldsMut()
- Added
Row.len()
andRow.field(index: usize)
- Changed
zcsv.column.ParserOpts
to bezcsv.core.ParserLimitOpts
- Made column and map parser options be runtime rather than comptime
- Changed
zcsv.stream.PartialOpts
to bezcsv.core.ParserLimitOpts
- Added
Row.fieldOrnull(index: usize)
(non-throwing) - Removed
stream.FieldStream
parser - Renamed
stream.FieldStreamPartial
tostream.Parser
- Added
stream.init
- Updated examples
- Updated docs
- Fixed bug in stream parser
Full Changelog: v0.3.1...v0.4.0