Skip to content

Conversation

@joshua-journey-apps
Copy link
Contributor

Adds executeRawSync method for synchronous access to raw query results.

The library has async raw methods (executeRaw, executeRawAsync) but no sync equivalent. Using executeSync and accessing rawRows creates unnecessary overhead from row mapping that gets discarded.

Changes

  • Added executeRawSync that returns rawRows directly without column mapping
  • Follows same parameter sanitization pattern as existing methods
executeRawSync: (query: string, params?: Scalar[]) => any[]

src/index.ts Outdated
executeRawSync: (query: string, params?: Scalar[]) => {
const sanitizedParams = sanitizeArrayBuffersInArray(params);
let res = sanitizedParams
? db.executeSync(query, sanitizedParams as Scalar[])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't look correct. If you take a look at the function above a executeRaw is a different native implementation than executeSync.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right apologies - added the native call with a passing test in the latest commit.

@ospfranco
Copy link
Contributor

Things seem to be broken on iOS only (which is weird), just FYI @joshua-journey-apps

@joshua-journey-apps
Copy link
Contributor Author

Found this write up.

Looks like macos runner went through a migration to macos-15 on 4 August.

There was a some breakage regarding the default Xcode version being set 16.0 while macos-latest having 16.4 minimum requirement for newer IOS simulators.

A quick fix would be to pin the runner to macos-14 until the default Xcode version is updated to 16.4.

There are other workarounds like adding the following step to all the ios runners in the ci.yml:

steps:
  - name: Select Xcode 16.4
     run: sudo xcode-select -s '/Applications/Xcode_16.4.app/Contents/Developer'

or

steps:
  - name: Update Xcode
     run: xcodebuild -downloadPlatform iOS

@ospfranco
Copy link
Contributor

using xcode-select should work. That's what I did in another project.

@ospfranco ospfranco merged commit f8c848d into OP-Engineering:main Aug 24, 2025
8 checks passed
subtleGradient pushed a commit to effect-native/op-sqlite that referenced this pull request Sep 12, 2025
…e-raw-sync

Add execute sync raw endpoint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants