Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add automatic id to each row #2767

Closed
wants to merge 3 commits into from
Closed

feat: add automatic id to each row #2767

wants to merge 3 commits into from

Conversation

mswertz
Copy link
Member

@mswertz mswertz commented Sep 27, 2023

motivation:

  • for RDF we need single id per row
  • for Catalogue ui routing we need a row id to avoid the need to rebuild a complex row identifier for use in route

result:

  • each row gets automatic id
  • this id is used in the backend to have faster joins and easier backend code
  • updates can still be done using key=1 columns
  • id can be queried via Query.retrieveRows and Query.retrieveJson so it can be used in RDF
  • decide if we make this visible in UI or not

@mswertz mswertz marked this pull request as draft September 27, 2023 09:33
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@mswertz mswertz added the poc label Sep 29, 2023
@connoratrug
Copy link
Contributor

For the frontend i would like a 'human readable' row id ( maybe a different story/usecase, but then are we going to have multilpe id's ? :S ) . Side note having previously work with RDF i know the 'sub optimal' experience of working with long chains of auto generated id's.

@mswertz mswertz closed this Oct 2, 2023
@esthervanenckevort
Copy link
Member

For the frontend i would like a 'human readable' row id ( maybe a different story/usecase, but then are we going to have multilpe id's ? :S ) .

The suggestion that I had for the way we create the row id using a sequence does try to reduce the pain: using a single sequence in the schema ensures that an ID is always unique, and with a bigint it is still reasonably short in most cases, only if you have many rows you necessarily end up with large numbers. Expressing them as hexadecimal without leading zeros would still make them easier to handle.

Side note having previously work with RDF i know the 'sub optimal' experience of working with long chains of auto generated id's.

On the other hand, having meaningful ID's that don't match with the actual content is worse... And I have seen too many cases where things were changed later. ID's are machine readable and should be treated as such. There should be tooling around it that makes things also human readable, but I am aware that that is still lacking.

I think having a URL like http://www.example.com/petStore/pet/12AB3F1 is still acceptable.

The proposal I wrote is here:
https://docs.google.com/document/d/1DlinRQnvvVH7wYee4jNhRUf1fwfgA_jUL32raOSroSs/edit#heading=h.xmg0aeh39vlf

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.

3 participants