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

- allow "exec" commmand to pass dictionary-params to webworker (with testcase) #364

Merged
merged 7 commits into from
Mar 8, 2020

Conversation

kaizhu256
Copy link
Member

  • add test passing dictionary-params to webworker

i generally use sql.js via webworkers, b/c i need the browser-ui to be responsive while ingesting/manipulating largish (200mb) csv's and queries that could take 30+ seconds.

the biggest missing feature for me using webworkers is passing parameters. i've been successfully using the patch in this pull-request in production for the past 6 months.

- add test passing dictionary-params to webworker
@kaizhu256 kaizhu256 changed the title - allow "exec" commmand to pass dictionary-params to webworker - allow "exec" commmand to pass dictionary-params to webworker (with testcase) Mar 6, 2020
Copy link
Member

@lovasoa lovasoa left a comment

Choose a reason for hiding this comment

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

This looks good to me. But since it's a new feature, we need to document it.

@kaizhu256
Copy link
Member Author

added documentation for multi-line exec-statements with params in commit # 2: 7bdff4d.

also verified documented example-usage runs correctly in browser:

image

README.md Outdated Show resolved Hide resolved
src/api.js Outdated Show resolved Hide resolved
src/api.js Outdated Show resolved Hide resolved
examples/GUI/index.html Outdated Show resolved Hide resolved
src/api.js Outdated Show resolved Hide resolved
src/api.js Outdated Show resolved Hide resolved
kai.zhu added 2 commits March 6, 2020 16:11
- resolve conversation - replace "several queries" with "several statements"
- try to limit documentation to 80-column width
@kaizhu256
Copy link
Member Author

log of commits-notes:

- allow "exec" commmand to pass dictionary-params to webworke
- add test passing dictionary-params to webworker
- add documentation
- resolve conversation - Statement.BindParams
- resolve conversation - replace "several queries" with "several statements"
- try to limit documentation to 80-column width

1 remaining unresolved conversation: example use-case @ line 178 in src/api.js

@lovasoa
Copy link
Member

lovasoa commented Mar 8, 2020

I don't see any unresolved conversation. Is this ready for merging?

@kaizhu256
Copy link
Member Author

yes, its ready for merge on my side! : )

i have another worker patch in the works (to ingest large csv's while keeping ui-responsive) that depends on this.

*
* We query it like that:
* ```javascript
* var db = new SQL.Database();
* var res = db.exec("SELECT id FROM test; SELECT age,name FROM test;");
* var res = db.exec(
Copy link
Member Author

Choose a reason for hiding this comment

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

re-opening this convesation, since it was clobbered by last commit. is example-code ok the way it is, or still too verbose? verified example works.

image

@lovasoa lovasoa merged commit dae60d7 into sql-js:master Mar 8, 2020
@lovasoa
Copy link
Member

lovasoa commented Mar 8, 2020

Ok, it's merged. Thank you @kaizhu256. What is your other patch ? Maybe we can discuss it first ? I was thinking about deprecating our buggy and largely untested worker code in favor of more modern and feature-complete alternatives.

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