Database Type string values

Hi folks.

I’m currently adding support for IPInfo’s .mmdb databases in a project. The implementation requires the presence of columns containing the country name and country code, which limits the IPInfo databases that could be used, and thus requires validation of the database type.

From the documentation, it appears the relevant databases are

  • IPInfo Lite
  • IPInfo Core
  • IPInfo Plus
  • IP to Country
  • IP to Country ASN
  • IP Geolocation

Comparing the sample IPInfo Lite database with my own, it appears the Database Type metadata value pattern differs between the two

  • Sample IPInfo Lite: ipinfo ipinfo_lite_sample.mmdb
  • Actual IPInfo Lite: ipinfo bundle_location_lite.mmdb

With all that context out of the way, could you confirm what the expected Database Type metadata values for the databases listed above are?

Hi Sebbs,

Thank you for the great question and for posting on the community.

Use the IPinfo Lite database: Documentation for IPinfo Lite Database - IPinfo.io

The database metadata that MMDB packages is not consistent across our database (and their samples). I think you should not use the metadata information in MMDB as a validation source.

Hi Abdullah,

For development and testing, yes I’m using the IPinfo Lite database. However the scenario I want to support is enabling those using my library to bring their own database (eg. Core, Plus, or even just IP to Country) that they may already be paying for (for the faster support etc).

It’s fine that the metadata across those aren’t consistent, I would just like to know what the values are so those databases I listed can specifically be supported (and it’s a less error-prone method than trying to discover and dynamically map column names).

The validation is just to prevent someone having the library inadvertantly load an incompatible database (for example, a IP to Company database) before it’s used for IP lookups.

Thank you very much, Sebbs, for supporting all our databases in the project. These are really interesting questions. Usually, rather than automatically detecting databases, you can ask the user what database they are using.

Currently, I would say for new users and customers, these are the databases you could support:

Thanks Abdullah. I know which databases I want to support (listed in the initial post), I just need information about them that isn’t in the docs. Just the db_type from mmdbctl metadata -f json for the databases I listed would be enough.

Just the db_type from mmdbctl metadata -f json for the databases I listed would be enough.

Give me a little bit of time. I will check it out over the weekend. I have to download this database on my local machine to run the command.