Registry / database / remote-sql

remote-sql

JSON →
library0.0.7jsnpmunverified

TypeScript interface for remote SQL databases with batch transaction support, version 0.0.7. Provides a minimal set of type-safe abstractions for preparing statements, binding parameters, and executing batch transactions, designed for serverless and edge computing environments. Releases are rare; only 7 versions as of early 2025. Differentiates from full ORMs like Prisma or Drizzle by focusing solely on remote database operations with a lightweight, framework-agnostic interface. Ships TypeScript types and is ESM-only.

npm install remote-sql
INSTALL
IMPORT
SIG · REMOTE-SQL
R
remote-sql
databasejavascriptv0.0.7
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RemoteSQL
import type { RemoteSQL } from 'remote-sql'
import RemoteSQL from 'remote-sql'
type-only import; RemoteSQL is an interface, not a class
SQLPreparedStatement
import type { SQLPreparedStatement } from 'remote-sql'
const { SQLPreparedStatement } = require('remote-sql')
type-only import; CommonJS require will fail in ESM-only package
SQLResult
import type { SQLResult } from 'remote-sql'
import { SQLResult } from 'remote-sql'
value import works but unused at runtime; prefer type import
SQLStatement
import type { SQLStatement } from 'remote-sql'
union type {sql: string; args: any[]} | string

Demonstrates batch execution using RemoteSQL interface. Shows prepare, bind, and batch usage.

import type { RemoteSQL, SQLPreparedStatement, SQLResult } from 'remote-sql'; // Assume remoteSQL instance is provided by a backend adapter // Not a concrete implementation — this package is an interface only. async function runBatch(remoteSQL: RemoteSQL) { const stmt1 = remoteSQL.prepare('INSERT INTO users (name) VALUES (?)').bind('Alice'); const stmt2 = remoteSQL.prepare('INSERT INTO users (name) VALUES (?)').bind('Bob'); const results: SQLResult<{id: number}>[] = await remoteSQL.batch([stmt1, stmt2]); console.log(results); }
Debug
Known issues
gotchaThe package only provides TypeScript interfaces — no runtime implementation. Cannot be used directly; requires an adapter.
fix
Use a concrete adapter like '@remote-sql/planetscale' or implement the RemoteSQL interface.
affects: >=0.0.1
breakingResults array in batch() may reorder or deduplicate across versions; not guaranteed to correspond 1:1 with input statements.
fix
Check documentation for batch() ordering contract before upgrading.
affects: <0.1.0
gotchaThe 'bind()' method may not mutate the original prepared statement; it might return a new instance. Always use the returned value.
fix
Use chaining: remoteSQL.prepare('...').bind(...).all()
affects: >=0.0.1
Errors
Common errors & fixes
TypeError: remoteSQL.prepare is not a function
Passed an object that does not implement RemoteSQL interface; no concrete adapter exists.
fix
Ensure remoteSQL is an instance of a concrete adapter that implements RemoteSQL.
Cannot find module 'remote-sql' or its corresponding type declarations.
TypeScript cannot resolve module because package is ESM-only and tsconfig may require different moduleResolution.
fix
Set moduleResolution to 'node16' or 'bundler' in tsconfig.json.
Upgrade
Version history
0.0.7latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
28 hits · last 30 days
node
18
Bingbot
10
Resources
remote-sql — npm install remote-sql · libregistry