-
-
Notifications
You must be signed in to change notification settings - Fork 407
update op-sqlite for @effect/sql-sqlite-react-native #5500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 03fc278 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the React Native SQLite client to be compatible with newer versions of @op-engineering/op-sqlite by migrating from the legacy API to the current API structure.
- Updates method calls from
db.executetodb.executeSync/db.executeAsync - Changes result access from
result.rows?._arraytoresult.rows - Raises minimum peer dependency version from 7.1.0 to >=12.0.0
Reviewed Changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/sql-sqlite-react-native/src/SqliteClient.ts | Updates API calls to use current op-sqlite methods and result structure |
| packages/sql-sqlite-react-native/package.json | Raises minimum version requirement for op-sqlite dependency |
| .changeset/short-lamps-vanish.md | Adds changeset entry for the minor version update |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Can the augmentation be directly in the |
ab4f132 to
03fc278
Compare
| declare module "@op-engineering/op-sqlite" { | ||
| export type OPDB = { | ||
| close(): void | ||
| executeSync(query: string, params?: Array<unknown>): { rows?: Array<unknown> } | ||
| executeAsync(query: string, params?: Array<unknown>): Promise<{ rows?: Array<unknown> }> | ||
| } | ||
|
|
||
| export function open(options: { | ||
| name: string | ||
| location?: string | ||
| encryptionKey?: string | ||
| }): OPDB | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ DONE: move temporary declare module into packages/sql-sqlite-react-native/src/SqliteClient.ts
✅ DONE: Land upstream PR: OP-Engineering/op-sqlite#324
✅ DONE: Release @op-engineering/op-sqlite@^15.0.4 https://github.com/OP-Engineering/op-sqlite/releases/tag/15.0.4
☑️ TODO: Update the dev deps to @op-engineering/op-sqlite@^15.0.4 and drop the declare module (not blocking this PR)
|
Type
Description
This PR updates our React Native SQLite client to align with the newer
@op-engineering/op-sqliteAPI. The prior implementation was valid for older peerdependency versions; this is a routine refactor plus a dependency floor
adjustment.
db.executeand readrows?._array, which belongedto older versions. The current API returns results via
QueryResult.rows.db.executeSyncfor the sync path anddb.executeAsyncfor the async path, and to consumeQueryResult.rows.Sqlite.openmoduleResolution: "NodeNext", TypeScript omits star re‑exports frominternal subpaths not exposed in the package
exportsmap, hidingopen/openSync/openRemotein@op-engineering/op-sqlitetypes.src/op-sqlite-augmentation.d.tsto surfaceopenand a narrowDBtype sothis package type‑checks in NodeNext environments.
Changes
executeSync/executeAsyncand consumeQueryResult.rowssrc/op-sqlite-augmentation.d.tsto exposeopenfor NodeNext@op-engineering/op-sqlitetoImpact
Related