Releases: marselester/maxminddb.zig
Releases · marselester/maxminddb.zig
v0.7.0
What's Changed
- API redesign to improve caching #16
- Support Shield and Precision database type variants
- Added filter.Fields to parse field names
- Fixed a prefix lenght when parsing a network
Full Changelog: v0.6.0...v0.7.0
v0.6.0
What's Changed
- Lookup index #13. The
db.lookup()can benefit from faster lookups with IPv4 index (an array of the first N bits of IPv4 addresses): it can skip the tree traversal for those bits. That can bring ~70%-140% speedup on sparse DBs and ~12%-18% on dense. db.open()anddb.mmap()now receivesReader.Optionsthat allows to build IPv4 indexdb.unmap()was removed in favor ofdb.close()- Lookup cache #14, see
lookupWithCache(). It showed ~15% faster GeoLite2-City.mmdb lookups on 1M random IPs (1.28M vs 1.47M lookups per second). within()was renamed toscan(), it doesn't cache anything internally. Nownext()returnsResultthat needs to be freed withresult.deinit()scanWithCache()was added to do network scans using a cache that owns the memory, i.e., no need to callresult.deinit()thoughcache.deinit()is needed to free the cache
Full Changelog: v0.5.0...v0.6.0
v0.5.0
What's Changed
- Windows memory mapping #11
Optionswere split intoLookupOptionsandWithinOptionsWithinOptions.include_empty_valueswhen false skips empty recordsOptions.onlywith an empty slice&.{}now skips all decoding instead of decoding everythinglatitude/longitudenow defaults to null instead of zero- deprecated DB fields were removed:
Location.metro_code,Enterprise.Traits.is_legitimate_proxy,Enterprise.Traits.static_ip_score Enterprise.registered_countryno longer hasconfidencefield
Full Changelog: v0.4.0...v0.5.0
v0.4.0
Fix within() bugs that caused nodes skipping:
- When startNode() returns a data pointer, the code skipped it because of "if (node < node_count)".
- When traversing the prefix, if a data record is encountered before exhausting all prefix bits (querying /24 but record is at /23), the code skipped the data pointer.
Add IP address validation to within() and lookup: when IPv6 address was used on IPv4-only database, the results could be garbage, so such address is rejected now.
Full Changelog: v0.3.0...v0.4.0
v0.3.0
v0.2.0
Changelog
Network.parsewas added to parse CIDRFieldsfiltering was added to speed up decoding. Note,lookupandwithinnow expectOptionsstruct.
const fields = maxminddb.Fields.from(maxminddb.geolite2.City, &.{ "city", "country" });
const city = try db.lookup(allocator, maxminddb.geolite2.City, &ip, .{ .only = fields });Basic features
This release provides:
- basic features found in Go/Rust libraries such as lookup by IP and network traversal
- safety checks seen in Go/Rust libraries
- compliance with the MaxMind DB spec, e.g., the requirement for struct fields to match database field order requirement was removed from the library