Skip to content

Releases: matthewtolman/zig_csv

v0.8.0 - Updated Supported Zig to 0.14.0

12 Jun 03:42
Compare
Choose a tag to compare

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

12 Jun 03:26
Compare
Choose a tag to compare

Fixed bug with slice reader

Full Changelog: v0.7.2...v0.7.3

v0.7.2 - Updated target version of Zig dev

22 Feb 00:25
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.7.1...v0.7.2

v0.7.1 - Bug Fixes

09 Jan 17:16
Compare
Choose a tag to compare

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

07 Dec 22:15
Compare
Choose a tag to compare

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

  • 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 and zero_allocs based on allocating properties
  • Renamed map_ck to map and map_sk to map_temporary
  • Reworked field to have shared clone API and different data vs raw, opts methods
    • Allocating fields have data
    • Zero-allocating fields have raw and opts
  • Reworked Row structs to have interchangeable interface (though they do have different performance complexities)
    • Both now have iter(), len(), field(usize), fieldOrNull(usize)
  • Unified the Field structs for map and column parsers
  • Unified the Row and Field structs for both map and map_temporary parsers
  • Moved internal decode_writer namespace to the internal namespace
  • Updated the library to only export the zero_allocs, allocs, writer, decode namespaces. It also exports the CsvWriteError, CsvReadError, and ParseBoolError error sets
  • Renamed stream_fast to stream
  • Renamed slices.row to slice
  • Made slices.row the default slice-based parser for zero-allocation in-memory parsing
    • Done by making zcsv.zero_allocs.slice.init create a slices.row parser
  • Made slices.fields a sub-parser under the slices namespace
    • Done by making zcsv.zero_allocs.slice.fieldsInit create a slices.field parser
  • 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.

27 Nov 16:26
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.5.2...v0.6.0

v0.5.2 - Fixed Zon version

16 Nov 23:05
Compare
Choose a tag to compare

Fixed Zon version

v0.5.1 - stream_fast bug fix

07 Nov 23:54
Compare
Choose a tag to compare

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

05 Nov 22:52
Compare
Choose a tag to compare
  • Switched from stream to stream_fast for underlying parser
  • Standardized stream init interface
  • Updated documentation

Full Changelog: v0.4.0...v0.5.0

0.4.0

04 Nov 23:03
Compare
Choose a tag to compare

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) to Field.clone(std.mem.Allocator)
  • Removed Field.detachMemory()
  • Removed Row.fields() and Row.fieldsMut()
  • Added Row.len() and Row.field(index: usize)
  • Changed zcsv.column.ParserOpts to be zcsv.core.ParserLimitOpts
  • Made column and map parser options be runtime rather than comptime
  • Changed zcsv.stream.PartialOpts to be zcsv.core.ParserLimitOpts
  • Added Row.fieldOrnull(index: usize) (non-throwing)
  • Removed stream.FieldStream parser
  • Renamed stream.FieldStreamPartial to stream.Parser
  • Added stream.init
  • Updated examples
  • Updated docs
  • Fixed bug in stream parser

Full Changelog: v0.3.1...v0.4.0