Skip to content

Commit

Permalink
Update op-sqlite (#421)
Browse files Browse the repository at this point in the history
  • Loading branch information
mugikhan authored Nov 28, 2024
1 parent 5647e48 commit 7c9c41d
Show file tree
Hide file tree
Showing 4 changed files with 18,373 additions and 23,220 deletions.
5 changes: 5 additions & 0 deletions .changeset/early-guests-jam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@powersync/op-sqlite': patch
---

Update op-sqlite to v10.1.0 for compatibility with React Native >0.76
6 changes: 3 additions & 3 deletions packages/powersync-op-sqlite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"access": "public"
},
"peerDependencies": {
"@op-engineering/op-sqlite": "^9.2.1",
"@op-engineering/op-sqlite": "^10.1.0",
"@powersync/common": "workspace:^1.21.0",
"react": "*",
"react-native": "*"
Expand All @@ -75,7 +75,7 @@
"async-lock": "^1.4.0"
},
"devDependencies": {
"@op-engineering/op-sqlite": "^9.2.1",
"@op-engineering/op-sqlite": "^10.1.0",
"@react-native/eslint-config": "^0.73.1",
"@types/async-lock": "^1.4.0",
"@types/react": "^18.2.44",
Expand Down Expand Up @@ -133,4 +133,4 @@
"javaPackageName": "com.powersync.opsqlite"
}
}
}
}
4 changes: 2 additions & 2 deletions packages/powersync-op-sqlite/src/db/OPSQLiteConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ export class OPSQLiteConnection extends BaseObserver<DBAdapterListener> {

async getAll<T>(sql: string, parameters?: any[]): Promise<T[]> {
const result = await this.DB.execute(sql, parameters);
return result.rows ?? [];
return (result.rows ?? []) as T[];
}

async getOptional<T>(sql: string, parameters?: any[]): Promise<T | null> {
const result = await this.DB.execute(sql, parameters);
return result.rows?.[0] ?? null;
return (result.rows?.[0] as T) ?? null;
}

async get<T>(sql: string, parameters?: any[]): Promise<T> {
Expand Down
Loading

0 comments on commit 7c9c41d

Please sign in to comment.