Skip to content

Commit

Permalink
Rebase patchset
Browse files Browse the repository at this point in the history
  • Loading branch information
simolus3 committed Feb 10, 2025
1 parent e675606 commit b8b8202
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
9 changes: 5 additions & 4 deletions packages/sqlite3_wasm_build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ applied to link the [PowerSync SQLite extension][core] statically.

### Working on patches

To adapt the patches:
To adapt the patches from an `$old` version to a `$new` version:

1. Clone `https://github.com/simolus3/sqlite3.dart.git` somewhere.
2. Apply the existing patches to your clone: `git apply patches/*`.
3. Rebase onto a new upstream release if necessary.
4. Obtain a new patchset with `git format-patch upstreamref..HEAD`.
2. Create a branch tracking the old version: `git switch -c powersync-patches sqlite3-$old`.
3. Apply the existing patches: `git am patches/*`.
4. Rebase onto a new upstream release if necessary: `git rebase --onto sqlite3-$new sqlite3-$old powersync-patches`
5. Obtain a new patchset with `git format-patch sqlite3-$new..HEAD`.

[upstream]: https://github.com/simolus3/sqlite3.dart/tree/main/sqlite3/assets/wasm
[core]: https://github.com/powersync-ja/powersync-sqlite-core
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 04fd5a3a01be7b42ec97c2d9865e4c7501b5b6a8 Mon Sep 17 00:00:00 2001
From 80ec8f3a54d938c6bf39b471aa26c4c77f9984a2 Mon Sep 17 00:00:00 2001
From: Simon Binder <[email protected]>
Date: Mon, 27 Jan 2025 15:12:53 +0100
Subject: [PATCH] Link PowerSync core extension
Expand All @@ -10,7 +10,7 @@ Subject: [PATCH] Link PowerSync core extension
3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/sqlite3/assets/wasm/CMakeLists.txt b/sqlite3/assets/wasm/CMakeLists.txt
index e4283b3..5c52593 100644
index 6597d86..81a5a41 100644
--- a/sqlite3/assets/wasm/CMakeLists.txt
+++ b/sqlite3/assets/wasm/CMakeLists.txt
@@ -6,6 +6,7 @@ project(${PROJECT_NAME} LANGUAGES C)
Expand Down Expand Up @@ -43,11 +43,11 @@ index e4283b3..5c52593 100644
)

diff --git a/sqlite3/assets/wasm/os_web.c b/sqlite3/assets/wasm/os_web.c
index 04f2e97..666902d 100644
index 4a1df1d..be9c3c9 100644
--- a/sqlite3/assets/wasm/os_web.c
+++ b/sqlite3/assets/wasm/os_web.c
@@ -4,6 +4,15 @@

@@ -6,7 +6,16 @@
#include "bridge.h"
#include "sqlite3.h"

-int sqlite3_os_init(void) { return SQLITE_OK; }
Expand All @@ -63,11 +63,12 @@ index 04f2e97..666902d 100644
+}

int sqlite3_os_end(void) { return SQLITE_OK; }

diff --git a/sqlite3/assets/wasm/sqlite_cfg.h b/sqlite3/assets/wasm/sqlite_cfg.h
index 6f3e3c2..45847f8 100644
index 74e8dd7..682acbf 100644
--- a/sqlite3/assets/wasm/sqlite_cfg.h
+++ b/sqlite3/assets/wasm/sqlite_cfg.h
@@ -43,7 +43,7 @@
@@ -42,7 +42,7 @@
// Disable things we don't need
#define SQLITE_OMIT_DEPRECATED
#define SQLITE_OMIT_PROGRESS_CALLBACK
Expand Down

0 comments on commit b8b8202

Please sign in to comment.