database icon indicating copy to clipboard operation
database copied to clipboard

Add immutable ids for subsection data

Open sarabveer opened this issue 4 years ago • 8 comments

Currently subsections are useless as subsection names are not unique

sarabveer avatar Nov 26 '19 04:11 sarabveer

How does this issue affect the average user?

bhajneet avatar May 04 '20 14:05 bhajneet

Not sure about the average user, but this is required for v5. Otherwise subsections are useless as many share the same name.

sarabveer avatar May 04 '20 19:05 sarabveer

@saihaj Instead of having something like "subsection": "Jap", in the json, it would be an immutable id, like "subsection": "HJ6",

You can see all the current defined subsections here in https://github.com/ShabadOS/database/blob/dev/data/compositions.json. Many share the same English name, they aren't unique, so we need immutable ids.

Can probably touch up with @Harjot1Singh on the schema.

Another option is to have subsection defined under section. For example, if I wanted to see "Mahalaa 1" in Sri Raag, it only pulls up Shabads from Sri Raag, not of "Mahalaa 1" from other Raags/sections

sarabveer avatar Jun 25 '20 22:06 sarabveer

  • section
    • id -> 3 char immutable
    • order_id -> increasing integer
  • subsection
    • id -> 3 char immutable
    • order_id -> increasing integer

View in Slack

saihaj avatar Jun 30 '20 14:06 saihaj

Yep you've got it, see lines or shabads as an example, they both have order_id and id.

Harjot1Singh avatar Jun 30 '20 18:06 Harjot1Singh

@Sarabveer Would you not prefer to have subsection: "Jap"?

Harjot1Singh avatar Jun 30 '20 18:06 Harjot1Singh

@Harjot1Singh subsection names arent unique, which is why this issue was opened.

sarabveer avatar Jun 30 '20 19:06 sarabveer

Section doesn't need immutable IDs as up to this point, they are unique. However, within a section, there can be multiple subsections sharing the same name. So immutable IDs for subsections are needed if we want to use them, for example, to implement a bookmarks feature (in a Baani) for a Gutka app.

sarabveer avatar Jan 24 '22 19:01 sarabveer