Skip to content

Releases: marselester/maxminddb.zig

v0.7.0

11 Apr 17:40

Choose a tag to compare

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

21 Mar 18:53

Choose a tag to compare

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() and db.mmap() now receives Reader.Options that allows to build IPv4 index
  • db.unmap() was removed in favor of db.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 to scan(), it doesn't cache anything internally. Now next() returns Result that needs to be freed with result.deinit()
  • scanWithCache() was added to do network scans using a cache that owns the memory, i.e., no need to call result.deinit() though cache.deinit() is needed to free the cache

Full Changelog: v0.5.0...v0.6.0

v0.5.0

13 Mar 23:12

Choose a tag to compare

What's Changed

  • Windows memory mapping #11
  • Options were split into LookupOptions and WithinOptions
  • WithinOptions.include_empty_values when false skips empty records
  • Options.only with an empty slice &.{} now skips all decoding instead of decoding everything
  • latitude/longitude now 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_country no longer has confidence field

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

v0.4.0

05 Mar 22:27

Choose a tag to compare

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

27 Feb 22:50

Choose a tag to compare

What's Changed

  • Fields filtering to speed up decoding #8
  • Refactor lookup() and within() #9
  • within() iterator caches records #10
  • Decode any record (schemaless) #12

Full Changelog: v0.1.0...v0.3.0

v0.2.0

20 Feb 01:14

Choose a tag to compare

Changelog

  • Network.parse was added to parse CIDR
  • Fields filtering was added to speed up decoding. Note, lookup and within now expect Options struct.
const fields = maxminddb.Fields.from(maxminddb.geolite2.City, &.{ "city", "country" });
const city = try db.lookup(allocator, maxminddb.geolite2.City, &ip, .{ .only = fields });

Basic features

19 Feb 16:19

Choose a tag to compare

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