-
Notifications
You must be signed in to change notification settings - Fork 24
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
Separate Statistics per Organization #3663
Conversation
notdel(r) && (r.created >= new java.sql.Timestamp(start.getOrElse(0))) && r.created <= new java.sql.Timestamp( | ||
end.getOrElse(MAX_TIMESTAMP))) | ||
.result) | ||
r <- run(sql"""select #${columnsWithPrefix("t.")} from #${existingCollectionName} t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering why we can't use the scala slick syntax here. Or do you simply prefer SQL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my first draft, I was going to use the accessQueries to find all items in the visible scope of the requesting user, rather than filter by organization (that would have required sql syntax). However, it turned out that leads to inconsistencies e.g. with public datasets. So I changed course, but I didn’t change this code back to slick syntax.
However, I think the more complex the query, the easier to write and read is SQL compared to slick syntax. Since we introduced a join here, I’d keep this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine with me 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 didn't test it, though
Steps to test:
Issues:
[ ] Updated migration guide if applicable[ ] Updated documentation if applicable[ ] Needs datastore update after deployment