Skip to content

Current database design could be improved (i.e for adding things like pagination) #8

@alessandrojcm

Description

@alessandrojcm

Hi there!

Good job on this project, a data source conforming to ISO 3166 standard is just what I needed for an app a friend and I are making.

The only thing missing was a /countries endpoint, which would list all the countries with their respecting the latest data. I went to add that myself, but I found that the current data model design makes this difficult.

So I propose changing it for something like this (the relationship is one-to-many):
Untitled

That way it could be trivial to add endpoints like the one I'm trying to add (i.e we would just need to join and fetch the latest record for each). I also think that the current endpoints would be simplified (for example, the global count would be a simple sum on the database side).

I don't think it would be too difficult to implement this; I can do it myself but I wanted to consult first since the current logic will be affected. What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions