Skip to content

Alternate names and faster bulk loading#33

Open
brunobg wants to merge 18 commits into
igaster:masterfrom
Corollarium:master
Open

Alternate names and faster bulk loading#33
brunobg wants to merge 18 commits into
igaster:masterfrom
Corollarium:master

Conversation

@brunobg
Copy link
Copy Markdown

@brunobg brunobg commented May 5, 2020

This is PR that does two things:

  1. includes the option to load the alternate names table. This is useful for localization and addresses issue How to select language #22.
  2. changes the loader to bulk insert items. This makes loading data orders of magnitudes faster. I loaded the entire country DB in 847 seconds in a machine that took hours to load everything before the patch.

Sorry they were mixed, I was not planning to do the bulk insert but it was just impossible to develop and to load the alternate names without it, so it all got mixed in the end.

The alternate names db is optional and loaded by a separate artisan command. It's completely backwards compatible with previous installations.

I added a few extra query options to the API to select specific languages, which hopefully solves the i18n problem.

I tried to add automatic tests, but I couldn't figure out how you run the test setup. I suggest you document this somewhere. So I only tested the endpoints manually, but covered (hopefully) all cases.

@brunobg
Copy link
Copy Markdown
Author

brunobg commented May 5, 2020

Actually, there are some endpoints not working with alternatenames. I'll post the fixes soon.

@brunobg
Copy link
Copy Markdown
Author

brunobg commented May 5, 2020

Ok, this fixes the issues I had before and a bunch of extra bugs:

  • /geo/items was not being routed
  • several typos on the names. Fixed and when methods were public backwards compatibility methods were added.
  • fixed Geo::parent(), which fixes /geo/parent.

All routes listed in README were properly tested. There's bug #32 still open on /geo/ancestors, apparently there's something wrong in Geo::scopeAncestors. Possible scopeDescendants is buggy as well, but I haven't checked it.

Sorry this PR grew so big. My initial idea was just to add alternate names but I kept finding issues and did not fork for each one.

@brunobg brunobg mentioned this pull request May 5, 2020
@Forsakenrox
Copy link
Copy Markdown

Look like package is abandoned, thx for your work. I use your fork instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants