Comments (6)
Yeah of course. IPinfo (https://ipinfo.io) also ships MMDB files and we try to stay away from arrays/maps because of some of these limitations.
I think the best we'll be able to do then is similar to what you've done but by simply handling the error and printing something, saying that CSV/TSV support is not available for arrays/maps, when they're detected.
from mmdbctl.
Switching from map[string]string
to map[string]interface{}
also opened up a new host of issues as well where things like integer values were getting dropped or being able to import nested objects too.
from mmdbctl.
Data enrichment can look something like export of an mmdb to json. Then use standard json manipulation tools like jq
or jmespath, and reimport into a new mmdb.
from mmdbctl.
Yeah this is definitely an assumption we've made deliberately, because our own use cases only entailed strings and we realized that letting it become arbitrary is both not useful to us and causes fundamental issues with some input/ouput formats as you already mentioned.
I think the most we could go for is trying to support data types that can be trivially converted back & forth to string, like numbers and booleans. But arrays and maps will always be super opinionated.
from mmdbctl.
Be aware that the commercial maxmind datasets leverage both arrays and maps which might affect the usability of the project in a broader audience such as if you're performing augments/updates.
I've been able to mostly work around and get it working for me by deleting code around the use of CSV/TSV because the underlying mmdb libraries still support the nested objects and json can express them fine when going to marshal/unmarshal them.
from mmdbctl.
@jhg03a This is fixed - can you provide feedback?
from mmdbctl.
Related Issues (15)
- Compatibility issue with IP2Location DB which uses int format for ip address range start and end HOT 2
- Support for merging mmdb or csv files? HOT 1
- Request support for installation through Scoop HOT 1
- file size difference HOT 8
- Low-level data about MMDB HOT 3
- Granular data section metadata
- File extensions not triggering default flags in import HOT 2
- Memory Issue HOT 5
- is ipapi csv's conversion supported? HOT 7
- panic: runtime error on iplocation.mmdb
- err: nothing to import
- Corrupted Database
- err: failed to get record for next subnet: maxminddb: cannot unmarshal map into type string HOT 1
- Compatibility with maxmind datasets HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mmdbctl.