Skip to content

Move __query and its dependencies to stdlib #296

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

Merged
merged 4 commits into from
Jul 4, 2022
Merged

Conversation

annie
Copy link
Contributor

@annie annie commented Jul 1, 2022

This PR moves the __query function and its dependencies out of the Next worker code and into stdlib. I also moved a set of tests over for the query template function (which I renamed to makeQueryTemplate, which I find a bit clearer).

Once we upgrade stdlib in Classic, this will serve as a partial fix for Data Table embeds (embeds will show the array of results, but not the full table UI).

* of sub-strings and params are the parameter values to be inserted between each
* sub-string.
*/
export function makeQueryTemplate(operations, source) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we still need this function in Next because we use it to construct the query for the convert to SQL operation. should we also export it as part of the standard library? that feels wrong somehow ... maybe there's another way to share the code?

Copy link
Member

Choose a reason for hiding this comment

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

Yes we can have it as an export in src/index.mjs

@annie annie requested a review from mbostock July 1, 2022 20:00
@annie annie merged commit 1e1cef9 into main Jul 4, 2022
@annie annie deleted the annie/data-table-query branch July 4, 2022 21:37
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