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

Query Datasets #6182

Merged
merged 5 commits into from
Jan 7, 2025
Merged

Query Datasets #6182

merged 5 commits into from
Jan 7, 2025

Conversation

labkey-martyp
Copy link
Contributor

Rationale

Live query snapshot datasets. Essentially an unprovisioned dataset backed by a live query.

Changes

  • Create new dataset type that uses a LK query as it's data.
  • Update dataset definition to save the required source query fields.
  • Add virtual table backing the query dataset
  • Update snapshot UI and add experimental flag.
  • Update create snapshot API
  • Add Query change listener
  • Prevent any attempts to mutate this dataset
  • Opt out of export

@@ -62,4 +63,10 @@ public Set<String> getReservedPropertyNames(Domain domain, User user)

return Collections.unmodifiableSet(fields);
}

@Override
public boolean isProvisioned(Container container, String name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this is interesting. The ContinuousDomainKind is provisioned, but query dataset does not have a domain do do domainkind... Hmm. Maybe make this static and add a comment? or change calling code to ask the dataset, not the domainkind? (I haven't look to see where this is called yet.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved this to the abstract DatasetDomainKind class. It does ultimately ask the dataset if it's a query dataset or not. It's called outside the study module so it doesn't really have any idea what kind of domain it is at that point, it's up to the domain kind to figure out if it's provisioned. I added a comment.

{
if (property.equals(QueryProperty.Name))
{
for (QueryPropertyChange change : changes)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

User user = _userSchema.getUser();
if (!user.hasRootAdminPermission() && !hasPermission(user, ReadPermission.class))
return null;
return new QueryDatasetUpdateService(this);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can just return null here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, that is more concise. Done.

@labkey-martyp labkey-martyp merged commit 53a61a8 into release24.11-SNAPSHOT Jan 7, 2025
6 checks passed
@labkey-martyp labkey-martyp deleted the 24.11_fb_query_dataset branch January 7, 2025 15:42
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.

2 participants