Add support for database types other than MaxMind#3
Add support for database types other than MaxMind#3sblinch wants to merge 6 commits intoIncSW:masterfrom
Conversation
|
Hi, thanks for your interest. I think, you can just add This library has hardcoded available fields, because of that it's not possible to permit user to use any types of database. |
|
Thanks for the response. My thought (and the reason I didn't create tests specifically for Geoacumen) is that there are actually a number of other providers of MMDB databases -- DB-IP is one, IP2Location is another, and there were a number of others that I did not make note of as they didn't fit my specific needs when I was compiling my list. There are also a number of tools available to create your own MMDB databases. In my (admittedly subjective) experience, they tend to use the same field names as the MaxMind databases, they just don't use a DatabaseType that contains MaxMind's trademarked product names. So the existing DatabaseType checks become an artificial limitation on using third-party databases. I'm not suggesting you aim to offer formal support for all database types; it would just be nice if we as developers had the option to swap in other databases on a "try it and see" basis without maintaining a fork just for that purpose. |
|
Looks reasonable. |
|
Sounds good -- I've made the requested changes. |
|
Looks ok, conflicts should be resolved before merge. |
There are now a number of alternative providers of MMDB databases (including the free Geoacumen database generated from ASN data), but they are unusable with the geoip2 library because it explicitly checks for a MaxMind-specific
reader.metadata.DatabaseType.This pull request maintains the current behavior while adding the option to specify a custom database type when needed by calling
NewXxxReaderType()instead ofNewXxxReader(). It also acceptsGeoacumen-Countryas a valid database type forNewCountryReader()by default.