Skip to content

Support Expo SQLite 57 in the Expo persistence adapter peer and database types #1888

Description

@cucumber-sp

Package and versions

  • @tanstack/expo-db-sqlite-persistence@0.2.23 (latest published)
  • expo-sqlite@57.0.3 (Expo SDK 57)
  • TypeScript 5.x

The adapter still declares expo-sqlite: ^55.0.10 as a peer dependency, both in the published package and in the current repository packages/expo-db-sqlite-persistence/package.json. Expo SDK 57 apps therefore get a peer mismatch with the official adapter.

There is a type compatibility problem as well. ExpoSQLiteDatabaseLike declares getAllAsync / runAsync parameters as ReadonlyArray<unknown> | Record<string, unknown>, while SDK 57's SQLiteDatabase methods accept the narrower SQLiteBindParams (string | number | null | boolean | Uint8Array | ArrayBuffer values). A direct SQLiteDatabase is not assignable to ExpoSQLiteDatabaseLike under strictFunctionTypes.

Minimal type-check scenario:

import { createExpoSQLitePersistence } from '@tanstack/expo-db-sqlite-persistence'
import * as SQLite from 'expo-sqlite'

const database = await SQLite.openDatabaseAsync('example.db')
createExpoSQLitePersistence({ database })

Our application currently bridges these signatures with a wrapper that validates bind values before forwarding calls to Expo SQLite. The wrapper also serializes access to a shared account database; that serialization is application-specific, but the peer/type incompatibility is not.

Expected: The official Expo adapter has a supported peer range and database type that work directly with supported Expo SDK 57 SQLite, with native runtime verification on iOS and Android. If SDK 57 is intentionally unsupported, please document the supported SDK versions and the intended migration path.

Actual: Installation reports an incompatible peer and direct database wiring fails TypeScript compatibility.

The direct assignment was reproduced with TypeScript (--strict --noEmit) and fails with TS2322: SQLiteDatabase is not assignable to ExpoSQLiteDatabaseLike; getAllAsync requires SQLiteBindParams, while the adapter interface permits ExpoSQLiteBindParams | undefined.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions