-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Initial fork and patching of sql.js #1
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
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.
This looks neat 👍
set -e | ||
|
||
SQLITE_VERSION="2.7.6" | ||
POWERSYNC_CORE_VERSION="0.4.0" |
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.
Let's just make that 0.4.2
right away :D
rm -rf $SQLITE_PATH | ||
fi | ||
|
||
git clone --depth 1 https://github.com/sql-js/sql.js.git $SQLITE_PATH |
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 think this should probably clone a fixed revision to ensure we can always run the script and update the core extension even when there are changes from sql.js? Otherwise there's a risk that they break the patches (which we'd have to fix either way, but it'd be nice for this to be reproducible).
-"_sqlite3_result_error", | ||
-"_sqlite3_aggregate_context", | ||
-"_RegisterExtensionFunctions", | ||
-"_sqlite3_update_hook" |
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.
Just for my own understanding: It looks like there was support for update hooks here already, did they not work for us?
This adds everything needed to maintain our fork of sql.js. This variant includes Powersync (made possible by the git patch files). To be used in the
@powersync/dev-adapter
package introduced by powersync-ja/powersync-js#647.Why?
Considering that there are already production ready adapters for web, React Native (two in fact), and Node it might not be immediately clear why we need this. Those adapters are recommended for production. But this dev-adapter needs less setup, as it runs completely in JS. This simplifies the setup which is great for trying out PowerSync.
This also works with Expo Go because we don't need to do build config as it's already running in JS.