Skip to content
Source
Sign inSign up
TanStack/db

fix(expo-db-sqlite-persistence): resolve TS2322 when passing SQLiteDatabase to createExpoSQLitePersistence #1560

ClosedPHILLIPS71(GitHub profile, opens in a new tab)wants to merge 4 commits intomain fromrefs/pull/1560/headopened

Showing 7 changed files with 29 additions and 43 deletions (loading 4).

x
0 of 7 viewed, 7 left
6 additions and 0 deletions.changeset/six-ties-leave.mdAdded
View file
@@ -0,0 +1,6 @@
+---
+'@tanstack/expo-db-sqlite-persistence-e2e-app': patch
+'@tanstack/expo-db-sqlite-persistence': patch
+---
+​
+fixes a TS2322 type error when passing a SQLiteDatabase from expo-sqlite to createExpoSQLitePersistence
14 additions and 39 deletionspackages/expo-db-sqlite-persistence/e2e/expo-runtime-app/App.tsxModified
View file
@@ -1,4 +1,4 @@
-import React, { useEffect, useMemo, useState } from 'react'
+import { useEffect, useMemo, useState } from 'react'
import { ScrollView, Text, View } from 'react-native'
import * as SQLite from 'expo-sqlite'
import { createCollection } from '@tanstack/db'
@@ -14,20 +14,12 @@
} from '../runtime-protocol'
​
type DatabaseHandle = Awaited<ReturnType<typeof SQLite.openDatabaseAsync>>
-type TransactionHandleLike = {
- execAsync: (sql: string) => Promise<void>
- getAllAsync: (
- sql: string,
- params?: ReadonlyArray<unknown> | Record<string, unknown>,
- ) => Promise<ReadonlyArray<unknown>>