Skip to content

feat(sqlite-plugin): export SQL and bridge helpers for custom adapters#259

Merged
V3RON merged 2 commits into
mainfrom
feat/sqlite-plugin-export-sql-bridge-helpers
May 11, 2026
Merged

feat(sqlite-plugin): export SQL and bridge helpers for custom adapters#259
V3RON merged 2 commits into
mainfrom
feat/sqlite-plugin-export-sql-bridge-helpers

Conversation

@V3RON
Copy link
Copy Markdown
Contributor

@V3RON V3RON commented May 11, 2026

Why

When building a custom SQLite adapter for Rozenite (e.g. a driver not covered by the built-in Expo SQLite adapter), developers need to parse, classify, and normalise SQL statements themselves — and decode bridge-encoded values returned over the JS/native boundary. The relevant utilities already exist in shared/sql and shared/bridge-values, but they were not exported from the package, forcing consumers to either duplicate the logic or reach into internal paths.

What

Exports the following helpers from the react-native entry-point of sqlite-plugin:

shared/sql

  • SqlStatementSegment (type)
  • classifySqlStatement
  • normalizeSingleStatementSql
  • splitSqlStatements
  • statementReturnsRows

shared/bridge-values

  • decodeSqliteBridgeValue
  • formatSqliteError

Approach

An earlier attempt at this was made in #226, which tried to generate a new dedicated entry-point for these helpers. That approach turned out to be flaky, so for the time being the same pattern used for all other exported functions is applied here: let declarations assigned via inline require() calls that Metro can statically analyse, with passive no-op mocks assigned in the else branch for production/web/SSR builds. This ensures the helpers are completely tree-shaken out of production bundles.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
rozenite Skipped Skipped May 11, 2026 8:09am

Request Review

@V3RON V3RON merged commit 6fd13c0 into main May 11, 2026
4 checks passed
@V3RON V3RON deleted the feat/sqlite-plugin-export-sql-bridge-helpers branch May 11, 2026 09:01
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.

1 participant