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

Update pg-query-emscripten to 5.1.0 #567

Conversation

valentin-nemcev
Copy link
Contributor

pg-query-emscripten has a very annoying bug where it prints it's source code on exception. This PR updatespg-query-emscripten to the latest version and fixes incompatibilities with the new version.

let pgQueryInstance: any;
const getPgQuery = async () => {
if (!pgQueryInstance) {
const { default: pgQueryModule } = await import(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

New emscripten version requires async initialisation. Since project target didn't support top-level await, and because view parsing is not always required, I made both importing and initialisation happen on-demand

@@ -65,12 +75,13 @@ function parseSelectStmt(

return viewReferences;
}
function parseViewDefinition(
async function parseViewDefinition(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's called from extractView, which already was async and used await

@kristiandupont kristiandupont merged commit a2e28c4 into kristiandupont:main Nov 16, 2024
1 check passed
@kristiandupont
Copy link
Owner

Very nice, thank you for contributing! 🙏

@kristiandupont
Copy link
Owner

Now published. As is Kanel and Schemalint.

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