-
Notifications
You must be signed in to change notification settings - Fork 3
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
Table instance aliases and sharing in sourcedefs #846
Comments
With the recent changes, we added support for the path prefix (the second method that is mentioned above). So in this comment I'm going to focus mainly on addition of DBA-controlled aliases. The following are the two new properties that we're going to have to support while defining a path in source definition:
In case of The following is not finalized and is more like a note that I wanted to capture. The content might not be complete or easily readable and the purpose is just to have them in the issue so we can discuss it. I will keep updating/changing its content Concerns/Things to discuss:
|
To answer regarding use case for user-controlled prefixes aside from
filters:
1. Within a single source definition, it could be used to build an
internal "tree" structure rather than a long chain of joins, the
same way you connect multiple facets or pseudo columns to a main
table.
2. Across shared prefixes, one could first reference the shared
prefix by sourcekey, then use one of the internal, user-assigned
aliases within that prefix source as the context for the join.
As you said, the prefix would have to be built into the URL before the
part that uses the prefix.
These tree-like structures also would prevent you from "reversing" a
source path! So, we have to consider where path reversal is necessary
for an ermrestjs/chaise feature and either disallow the tree-like
sources or degrade the chaise feature to disable it in the presence
of the non-reversible path...
|
It would be useful for the DBA to be able to define a set of sourcedefs with shared/common parts to their source path. When building an ermrest query, you would instantiate the common parts only once and reuse the same table instance aliases to construct the remaining (distinct) parts of each source that is being used in a recordset query.
I think there are two reasonable ways to do this:
{"sourcekey": "key"}
element that can be used as the first element in a source pathIn the first approach, each sourcedef would have its own copy of the shared structure. In the second approach, the DBA would have to factor out the shared prefix part as another named sourcedef, then reference it from each of the sourcedefs that should overlap.
Either way, you have to implement some kind of idempotence to allow a named table instance or shared sourcedef to be added to a query at-most-once and then splice the remaining non-shared parts into the query using context-reset and/or explicit alias-qualifiers in the constructed ermrest query path.
The text was updated successfully, but these errors were encountered: