Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
555d9e5
Add initial iOS core registration
stevensJourney Sep 4, 2025
b09aa1b
update capacitor
stevensJourney Sep 4, 2025
607d494
update code
stevensJourney Sep 5, 2025
b6afc44
load core extension with Android. woop woop
stevensJourney Sep 20, 2025
55dcd05
Support single read and single write connection. Implement table upda…
stevensJourney Sep 20, 2025
0fdc512
Package README. Update example app. Implement PowerSyncDatabase for C…
stevensJourney Sep 22, 2025
d59cd41
dynamically find capacitor/android for build
stevensJourney Sep 22, 2025
20b083d
added changeset
stevensJourney Sep 22, 2025
685c99b
Merge remote-tracking branch 'origin/main' into capacitor-sdk
stevensJourney Sep 22, 2025
b894538
fix build
stevensJourney Sep 22, 2025
0acfd2d
document execute limitation
stevensJourney Sep 22, 2025
872ce0b
add open factory example
stevensJourney Sep 22, 2025
1841e91
fix build command
stevensJourney Sep 22, 2025
91260c8
allow package to be published
stevensJourney Sep 22, 2025
570b978
use release builds for tests
stevensJourney Sep 22, 2025
37e317b
provide core extension error code logging
stevensJourney Sep 22, 2025
f354b1a
Add tests for package exports
stevensJourney Sep 22, 2025
45cc79f
Merge remote-tracking branch 'origin/main' into capacitor-sdk
stevensJourney Sep 22, 2025
b161d93
add WAL support
stevensJourney Sep 22, 2025
cddefdb
update npm files
stevensJourney Sep 25, 2025
4b52a14
cater for version zero
stevensJourney Sep 25, 2025
48e0f89
Add debugMode
stevensJourney Sep 29, 2025
6756660
fix executeRaw and execute limitations
stevensJourney Sep 30, 2025
600f0d5
Merge remote-tracking branch 'origin/main' into capacitor-sdk
stevensJourney Oct 30, 2025
2bea72c
Update Capacitor community SQLite. Restore Android Execute method fun…
stevensJourney Oct 30, 2025
3133398
Use dynamic extension loading for Android.
stevensJourney Oct 30, 2025
e6b1f44
Revert demo test
stevensJourney Oct 30, 2025
7afe2a8
Fix typos
stevensJourney Oct 30, 2025
f2283c9
That's no typo
stevensJourney Oct 30, 2025
871385e
rename file
stevensJourney Oct 30, 2025
b663c92
Update demo
stevensJourney Oct 30, 2025
fd25e44
skip Android build test for now
stevensJourney Oct 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/happy-mails-juggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@powersync/capacitor': minor
---

Initial release
1 change: 1 addition & 0 deletions demos/example-capacitor/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ android {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.debug
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions demos/example-capacitor/android/app/capacitor.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
sourceCompatibility JavaVersion.VERSION_21
targetCompatibility JavaVersion.VERSION_21
}
}

apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
dependencies {
implementation project(':capacitor-community-sqlite')
implementation project(':capacitor-splash-screen')
implementation project(':powersync-capacitor')

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
android:theme="@style/AppTheme">

<activity
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode|navigation"
android:name=".MainActivity"
android:label="@string/title_activity_main"
android:theme="@style/AppTheme.NoActionBarLaunch"
Expand Down
4 changes: 2 additions & 2 deletions demos/example-capacitor/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.2.1'
classpath 'com.google.gms:google-services:4.4.0'
classpath 'com.android.tools.build:gradle:8.7.2'
classpath 'com.google.gms:google-services:4.4.2'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
6 changes: 6 additions & 0 deletions demos/example-capacitor/android/capacitor.settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,11 @@
include ':capacitor-android'
project(':capacitor-android').projectDir = new File('../../../node_modules/@capacitor/android/capacitor')

include ':capacitor-community-sqlite'
project(':capacitor-community-sqlite').projectDir = new File('../../../node_modules/@capacitor-community/sqlite/android')

include ':capacitor-splash-screen'
project(':capacitor-splash-screen').projectDir = new File('../../../node_modules/@capacitor/splash-screen/android')

include ':powersync-capacitor'
project(':powersync-capacitor').projectDir = new File('../../../packages/capacitor/android')
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
22 changes: 13 additions & 9 deletions demos/example-capacitor/android/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -83,7 +85,9 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -144,15 +148,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -201,11 +205,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
22 changes: 12 additions & 10 deletions demos/example-capacitor/android/gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down Expand Up @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
20 changes: 10 additions & 10 deletions demos/example-capacitor/android/variables.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
ext {
minSdkVersion = 22
compileSdkVersion = 34
targetSdkVersion = 34
androidxActivityVersion = '1.8.0'
androidxAppCompatVersion = '1.6.1'
minSdkVersion = 23
compileSdkVersion = 35
targetSdkVersion = 35
androidxActivityVersion = '1.9.2'
androidxAppCompatVersion = '1.7.0'
androidxCoordinatorLayoutVersion = '1.2.0'
androidxCoreVersion = '1.12.0'
androidxFragmentVersion = '1.6.2'
androidxCoreVersion = '1.15.0'
androidxFragmentVersion = '1.8.4'
coreSplashScreenVersion = '1.0.1'
androidxWebkitVersion = '1.9.0'
androidxWebkitVersion = '1.12.1'
junitVersion = '4.13.2'
androidxJunitVersion = '1.1.5'
androidxEspressoCoreVersion = '3.5.1'
androidxJunitVersion = '1.2.1'
androidxEspressoCoreVersion = '3.6.1'
cordovaAndroidVersion = '10.1.1'
}
6 changes: 6 additions & 0 deletions demos/example-capacitor/capacitor.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,11 @@
"SplashScreen": {
"launchShowDuration": 0
}
},
"android": {
"loggingBehavior": "production"
},
"ios": {
"loggingBehavior": "production"
}
}
8 changes: 4 additions & 4 deletions demos/example-capacitor/ios/App/App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -334,7 +334,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
Expand All @@ -350,7 +350,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.0;
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
Expand All @@ -370,7 +370,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.powersync.example;
Expand Down
4 changes: 3 additions & 1 deletion demos/example-capacitor/ios/App/Podfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require_relative '../../../../node_modules/@capacitor/ios/scripts/pods_helpers'

platform :ios, '13.0'
platform :ios, '14.0'
use_frameworks!

# workaround to avoid Xcode caching of Pods that requires
Expand All @@ -11,7 +11,9 @@ install! 'cocoapods', :disable_input_output_paths => true
def capacitor_pods
pod 'Capacitor', :path => '../../../../node_modules/@capacitor/ios'
pod 'CapacitorCordova', :path => '../../../../node_modules/@capacitor/ios'
pod 'CapacitorCommunitySqlite', :path => '../../../../node_modules/@capacitor-community/sqlite'
pod 'CapacitorSplashScreen', :path => '../../../../node_modules/@capacitor/splash-screen'
pod 'PowersyncCapacitor', :path => '../../../../packages/capacitor'
end

target 'App' do
Expand Down
48 changes: 40 additions & 8 deletions demos/example-capacitor/ios/App/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,28 +1,60 @@
PODS:
- Capacitor (6.0.0):
- Capacitor (7.4.3):
- CapacitorCordova
- CapacitorCordova (6.0.0)
- CapacitorSplashScreen (6.0.0):
- CapacitorCommunitySqlite (7.0.2):
- Capacitor
- SQLCipher
- ZIPFoundation
- CapacitorCordova (7.4.3)
- CapacitorSplashScreen (7.0.3):
- Capacitor
- powersync-sqlite-core (0.4.8)
- PowersyncCapacitor (0.0.1):
- Capacitor
- powersync-sqlite-core (~> 0.4.6)
- SQLCipher (~> 4.0)
- SQLCipher (4.10.0):
- SQLCipher/standard (= 4.10.0)
- SQLCipher/common (4.10.0)
- SQLCipher/standard (4.10.0):
- SQLCipher/common
- ZIPFoundation (0.9.20)

DEPENDENCIES:
- "Capacitor (from `../../../../node_modules/@capacitor/ios`)"
- "CapacitorCommunitySqlite (from `../../../../node_modules/@capacitor-community/sqlite`)"
- "CapacitorCordova (from `../../../../node_modules/@capacitor/ios`)"
- "CapacitorSplashScreen (from `../../../../node_modules/@capacitor/splash-screen`)"
- PowersyncCapacitor (from `../../../../packages/capacitor`)

SPEC REPOS:
trunk:
- powersync-sqlite-core
- SQLCipher
- ZIPFoundation

EXTERNAL SOURCES:
Capacitor:
:path: "../../../../node_modules/@capacitor/ios"
CapacitorCommunitySqlite:
:path: "../../../../node_modules/@capacitor-community/sqlite"
CapacitorCordova:
:path: "../../../../node_modules/@capacitor/ios"
CapacitorSplashScreen:
:path: "../../../../node_modules/@capacitor/splash-screen"
PowersyncCapacitor:
:path: "../../../../packages/capacitor"

SPEC CHECKSUMS:
Capacitor: 559d073c4ca6c27f8e7002c807eea94c3ba435a9
CapacitorCordova: 8c4bfdf69368512e85b1d8b724dd7546abeb30af
CapacitorSplashScreen: 5431ab8d19c1c6e95777d53bfaa7a36a6c3d94c7
Capacitor: b4741ca7affb32c1b70debd03df92cbf522d8a80
CapacitorCommunitySqlite: b8e23cd2fd5bff7da8cb2a3a1cb3a6ffb9714a32
CapacitorCordova: 435121e81a2df4d0034f0fb11fcefab5104cfdb5
CapacitorSplashScreen: d06ae8804808e9f649a08e7bb7f283c77b688084
powersync-sqlite-core: f48d06a7a9e6f73fee5bbc74da542466be2bb06f
PowersyncCapacitor: d7dcf7f15e24b512571dc87f545855f936ef9537
SQLCipher: eb79c64049cb002b4e9fcb30edb7979bf4706dfc
ZIPFoundation: dfd3d681c4053ff7e2f7350bc4e53b5dba3f5351

PODFILE CHECKSUM: 30a5df536d5e7830e635f84e1fe35fa438802eaa
PODFILE CHECKSUM: 1c728e00549cebade63eaffb81de205fd020c4ea

COCOAPODS: 1.15.2
COCOAPODS: 1.16.2
8 changes: 5 additions & 3 deletions demos/example-capacitor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
"preview": "vite preview"
},
"dependencies": {
"@capacitor/android": "^6.0.0",
"@capacitor-community/sqlite": "^7.0.2",
"@capacitor/android": "^7.4.3",
"@capacitor/core": "latest",
"@capacitor/ios": "^6.0.0",
"@capacitor/ios": "^7.4.3",
"@capacitor/splash-screen": "latest",
"@powersync/capacitor": "workspace:*",
"@journeyapps/wa-sqlite": "^1.3.2",
"@powersync/react": "workspace:*",
"@powersync/web": "workspace:*",
Expand All @@ -31,7 +33,7 @@
"react-router-dom": "^6.23.0"
},
"devDependencies": {
"@capacitor/cli": "^6.0.0",
"@capacitor/cli": "^7.4.3",
"@swc/core": "~1.6.0",
"@types/node": "^20.12.12",
"@types/react": "^18.3.2",
Expand Down
Loading