rinvex / countries

Rinvex Country is a simple and lightweight package for retrieving country details with flexibility. A whole bunch of data including name, demonym, capital, iso codes, dialling codes, geo data, currencies, flags, emoji, and other attributes for all 250 countries worldwide at your fingertips.
https://rinvex.com
MIT License
1.66k stars 208 forks source link

Long-term data reliability #101

Closed BrekiTomasson closed 6 years ago

BrekiTomasson commented 6 years ago

For the past year or two, I've been using a custom countries database table, so that my users can be associated with a country_id. However, I'm becoming more and more fond of this library, and am finding that more and more I'm using this instead of my own table for things other than long-term database storage.

Now; my question has to do with the long-term usage of this library. If I were to slowly migrate away from having a countries table and using this library instead (via a custom wrapper), what would be the most reasonable 'key' to identify a country? Should users have a country_code that contains the ISO 3166 Alpha-2 instead? Or the ISO 3166 Numeric? Or something else? What would be the most reasonable long-term 'key' here?

Omranic commented 6 years ago

I'd say ISO 3166 Alpha-2 🙂 It's unique, short, doesn't change, globally recognized, and could be used with other systems.