Skip to content

Commit 43ee529

Browse files
committed
fix: revert using getDyLibPath
1 parent 4d8f23a commit 43ee529

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

packages/powersync-op-sqlite/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ Example usage:
8787
```ts
8888
let libPath: string
8989
if (Platform.OS === 'ios') {
90-
libPath = getDylibPath('powersync-sqlite-core', 'powersync-sqlite-core')
90+
const bundlePath: string = getBundlePath();
91+
libPath = `${bundlePath}/Frameworks/powersync-sqlite-core.framework/powersync-sqlite-core`;
9192
} else {
9293
libPath = 'libpowersync';
9394
}

packages/powersync-op-sqlite/src/db/OPSqliteAdapter.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ import {
1515
} from '@op-engineering/op-sqlite';
1616
import Lock from 'async-lock';
1717
import { OPSQLiteConnection } from './OPSQLiteConnection';
18-
import { Platform } from 'react-native';
18+
import { NativeModules, Platform } from 'react-native';
1919
import { SqliteOptions } from './SqliteOptions';
20+
import { getBundlePath } from '..';
2021

2122
/**
2223
* Adapter for React Native Quick SQLite
@@ -146,9 +147,10 @@ export class OPSQLiteDBAdapter extends BaseObserver<DBAdapterListener> implement
146147
}
147148
}
148149

149-
private loadPowerSyncExtension(DB: DB) {
150+
private async loadPowerSyncExtension(DB: DB) {
150151
if (Platform.OS === 'ios') {
151-
const libPath = getDylibPath('powersync-sqlite-core', 'powersync-sqlite-core')
152+
const bundlePath: string = getBundlePath();
153+
const libPath = `${bundlePath}/Frameworks/powersync-sqlite-core.framework/powersync-sqlite-core`;
152154
DB.loadExtension(libPath, 'sqlite3_powersync_init');
153155
} else {
154156
DB.loadExtension('libpowersync', 'sqlite3_powersync_init');

0 commit comments

Comments
 (0)