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

Docs: Where/how to document the backend key-alias mapping feature introduces in #6245 #6327

Closed
edan-bainglass opened this issue Mar 20, 2024 · 1 comment
Assignees

Comments

@edan-bainglass
Copy link
Member

#6245 introduced a key-alias mapping in the backend for various QueryBuilder keys.

PROJECT_MAP = {
'db_dbauthinfo': {
'pk': 'id',
'computer_pk': 'dbcomputer_id',
'user_pk': 'aiidauser_id',
},
'db_dbnode': {
'pk': 'id',
'dict': 'attributes',
'computer_pk': 'dbcomputer_id',
'user_pk': 'user_id',
},
'db_dbcomputer': {
'pk': 'id',
},
'db_dbgroup': {
'pk': 'id',
'user_pk': 'user_id',
},
'db_dbcomment': {
'pk': 'id',
'user_pk': 'user_id',
'node_pk': 'dbnode_id',
},
'db_dblog': {
'pk': 'id',
'node_pk': 'dbnode_id',
},
}

This takes care of all known aliasing required for the postgresql backend, leaving the key aliasing mechanism available strictly for new data types (for plugin developers). Note that currently the map is in the postgresql backend, but the idea is that all backends should implement a similar mapping, with their respective aliases, so the frontend remains as is. With the map in place. users may now use the frontend keys in the QueryBuilder, so for example, use pk, not id (though still valid).

With that in mind, I propose we update the codebase (and documentation) accordingly w.r.t this mapping to promote the use of the frontend keys only, i.e. no mentions of id (for example).

@edan-bainglass
Copy link
Member Author

edan-bainglass commented Apr 4, 2024

The above was discussed during the 04.04.2024 AiiDA core developer meeting. Consensus is approval. I'll scan the code, verify the projections catch everything, and update the docs accordingly. Further discussion to follow in the associated PR.

Will also take a look at the tutorials.

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

No branches or pull requests

1 participant