-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: Add sql.js
fallback for sqlite
in wasm
#614
base: main
Are you sure you want to change the base?
Conversation
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.
cool :) Should we run the tests with sql.js
as optional tests as part of the PRs? Alternatively we could also run them after merge. What do you think?
Verification that the |
sqlite/lib/sql.js.js
Outdated
const init = initSqlJs({}) | ||
|
||
class WasmSqlite { | ||
constructor(database) { |
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.
can we get rid of this warning?
This PR adds support for another
SQLite
driversql.js
is a browser orientated driver which compilesSQLite
towasm
.Enabling the possibility to run cds with
@cap-js/sqlite
in more environments.For example
better-sqlite3
cannot be loaded into the defaultnpm
promoted online environmentrunkit
:https://runkit.com/bobdenos/cds-test
There are some limitations with
sql.js
when comparing tobetter-sqlite3
. Which is mostly that it uses more memory and is around 50% slower for running the@cap-js/sqlite
tests. Wherebetter-sqlite3
takes~10
seconds to run all tests. It takessql.js
~14
seconds, but all current tests are green. Which should be good enough for experimentation scenarios.