Skip to content

External String IDs

Timm Fitschen requested to merge f-external-ids into dev

Summary

Back-end implementation for caosdb-server!78 (merged)

Focus

  • Externally used entities ids and internal ids are mapped in the new entity_ids table.
  • Internal_ids are beeing generatated by the auto_increment feature of the entities table.
  • Most of the changes have the pattern: Replace any occurrence of SELECT ... FROM entities WHERE id = ? with SELECT ... FROM entities JOIN entity_ids ON entities.id = entity_ids.internal_id WHERE entity_ids.id = ?
  • Some of the procedure now take a EntityID VARCHAR(255) instead of ÈntityID UNSIGNED INT. These belong to the public api which is used by the server. The remaining procedure where the parameter is names InternalEntityID UNSIGNED INT now, are part of the implementation.
  • There should be only one case where internal ids are being leaked into the public api, that is as replacement ids. In that case the internal ids are then being replaced by the server during the transformation from the flat property internal representation to the deep public one.
  • Some of the new procedures are just old code from the server, copied and refactored.
  • Also, some unrelated refactoring and clean-up was done.

Test Environment

No manual testing.

Check List for the Author

Please, prepare your MR for a review. Be sure to write a summary and a focus and create gitlab comments for the reviewer. They should guide the reviewer through the changes, explain your changes and also point out open questions. For further good practices have a look at our review guidelines

  • All automated tests pass
  • Reference related issues
  • Up-to-date CHANGELOG.md (or not necessary)
  • Annotations in code (Gitlab comments)
    • Intent of new code
    • Problems with old code
    • Why this implementation?

Check List for the Reviewer

  • I understand the intent of this MR
  • All automated tests pass
  • Up-to-date CHANGELOG.md (or not necessary)
  • The test environment setup works and the intended behavior is reproducible in the test environment
  • In-code documentation and comments are up-to-date.
  • Check: Are there specifications? Are they satisfied?

For further good practices have a look at our review guidelines.

Edited by Daniel Hornung

Merge request reports

Loading