Skip to content

Commit c5e2fb7

Browse files
committed
Use gradle dependency.
1 parent 8e57283 commit c5e2fb7

File tree

8 files changed

+13
-6
lines changed

8 files changed

+13
-6
lines changed

android/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ set_target_properties(
4949

5050
find_package(ReactAndroid REQUIRED CONFIG)
5151
find_package(fbjni REQUIRED CONFIG)
52+
find_package(powersync_sqlite_core REQUIRED CONFIG)
5253
find_library(LOG_LIB log)
5354

5455
if(${USE_HERMES})
@@ -67,5 +68,5 @@ target_link_libraries(
6768
ReactAndroid::react_nativemodule_core
6869
${JSEXECUTOR_LIB}
6970
android
70-
powersync ${CMAKE_SOURCE_DIR}/src/main/jniLibs/${CMAKE_ANDROID_ARCH_ABI}/libpowersync.so
71+
powersync_sqlite_core::powersync
7172
)

android/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ android {
109109
}
110110

111111
dependencies {
112+
implementation 'co.powersync:powersync-sqlite-core:0.2.0'
112113
//noinspection GradleDynamicVersion
113114
implementation 'com.facebook.react:react-android:+'
114115
}
Binary file not shown.
Binary file not shown.
-214 KB
Binary file not shown.
-210 KB
Binary file not shown.

cpp/bindings.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include <iostream>
1111
#include <string>
1212
#include <vector>
13+
#include <powersync>
14+
1315
using namespace std;
1416
using namespace facebook;
1517

@@ -18,11 +20,6 @@ string docPathStr;
1820
std::shared_ptr<react::CallInvoker> invoker;
1921
jsi::Runtime *runtime;
2022

21-
extern "C" {
22-
int sqlite3_powersync_init(sqlite3 *db, char **pzErrMsg,
23-
const sqlite3_api_routines *pApi);
24-
}
25-
2623
/**
2724
* This function loads the PowerSync extension into SQLite
2825
*/

tests/tests/sqlite/rawQueries.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ export function registerBaseTests() {
7777
}
7878
});
7979

80+
describe('PowerSync', () => {
81+
it('should load the extension', async () => {
82+
const rs = await db.execute('select powersync_rs_version() as version');
83+
// TODO: Check the version?
84+
// expect(rs.rows.item(0).version).to.equal('0.2.0...');
85+
});
86+
});
87+
8088
describe('Raw queries', () => {
8189
it('Insert', async () => {
8290
const res = await createTestUser();

0 commit comments

Comments
 (0)