{"id":43755,"library":"remote-sql-libsql","title":"remote-sql-libsql","description":"An implementation of the RemoteSQL interface for LibSQL databases (including Turso), enabling batch transaction workflows. Current version: 0.0.7. Release cadence: early development, frequent minor updates. Key differentiator: provides a unified batch and prepared statement API on top of @libsql/core, allowing for transactional batching of multiple SQL statements. Requires @libsql/core as a peer dependency. Supports TypeScript with bundled types.","status":"active","version":"0.0.7","language":"javascript","source_language":"en","source_url":"https://github.com/wighawag/remote-sql","tags":["javascript","libsql","turso","sql","database","remote","batch","transaction","typescript"],"install":[{"cmd":"npm install remote-sql-libsql","lang":"bash","label":"npm"},{"cmd":"yarn add remote-sql-libsql","lang":"bash","label":"yarn"},{"cmd":"pnpm add remote-sql-libsql","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency: provides the underlying LibSQL client needed to instantiate RemoteLibSQL","package":"@libsql/core","optional":false}],"imports":[{"note":"Named export; library requires ESM. Default import not available.","wrong":"const RemoteLibSQL = require('remote-sql-libsql');\n// Wrong: CommonJS require does not work with named exports in this ESM-first library","symbol":"RemoteLibSQL","correct":"import { RemoteLibSQL } from 'remote-sql-libsql'"},{"note":"TypeScript type; exported alongside RemoteLibSQL.","wrong":"import { PreparedStatement } from 'remote-sql-libsql';\n// Wrong: symbol is LibSQLPreparedStatement, not PreparedStatement","symbol":"LibSQLPreparedStatement","correct":"import { LibSQLPreparedStatement } from 'remote-sql-libsql'"},{"note":"For type alignment, import the RemoteSQL interface from the main remote-sql package.","wrong":"import { RemoteSQL } from 'remote-sql-libsql';\n// Wrong: the interface is defined in remote-sql package, not this implementation","symbol":"RemoteSQL interface","correct":"import type { RemoteSQL } from 'remote-sql'"}],"quickstart":{"code":"import { RemoteLibSQL } from 'remote-sql-libsql';\nimport { createClient } from '@libsql/core';\n\nconst client = createClient({\n  url: process.env.TURSO_DATABASE_URL ?? 'libsql://your-database.turso.io',\n  authToken: process.env.TURSO_AUTH_TOKEN ?? ''\n});\n\nconst rls = new RemoteLibSQL(client);\n\nconst stmt = rls.prepare('SELECT name FROM users WHERE id = ?');\nconst result = await stmt.bind(1).all<{ name: string }>();\nconsole.log(result);\n\n// Batch transaction\nconst insert1 = rls.prepare('INSERT INTO users (name) VALUES (?)').bind('Alice');\nconst insert2 = rls.prepare('INSERT INTO users (name) VALUES (?)').bind('Bob');\nconst batchResults = await rls.batch([insert1, insert2]);\nconsole.log(batchResults);","lang":"typescript","description":"Demonstrates creating a RemoteLibSQL instance from a Turso client, preparing and executing a query, and running a batch transaction."},"warnings":[{"fix":"Run: pnpm add @libsql/core (or npm/yarn equivalent)","message":"The peer dependency @libsql/core must be installed explicitly; not bundled.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Update constructor usage to pass a @libsql/core Client instance: new RemoteLibSQL(client)","message":"Breaking change: In version 0.0.7, the constructor signature changed to require a Client object; previously may have accepted a config object.","severity":"breaking","affected_versions":"<0.0.7"},{"fix":"Replace .query() with .all()","message":"The method .query() is deprecated; use .all() instead.","severity":"deprecated","affected_versions":">=0.0.5"},{"fix":"Handle batch results individually; check result.error for each statement.","message":"Batch errors: If one statement in a batch fails, the entire batch may roll back depending on LibSQL transaction support.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Switch to ESM imports or use dynamic import('remote-sql-libsql').","message":"ESM-only library: Import via CommonJS require will fail. Use dynamic import() if needed.","severity":"deprecated","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'0.0.7':22 'allow':44 'api':39 'batch':17,35,47,69 'bundl':61 'cadenc':24 'current':20 'databas':13,67 'depend':57 'develop':26 'differenti':31 'earli':25 'enabl':16 'frequent':27 'implement':6 'includ':14 'interfac':10 'javascript':63 'key':30 'libsql':4,12,64 'libsql/core':43,53 'minor':28 'multipl':49 'peer':56 'prepar':37 'provid':32 'releas':23 'remot':2,68 'remote-sql-libsql':1 'remotesql':9 'requir':52 'sql':3,50,66 'statement':38,51 'support':58 'top':41 'transact':18,46,70 'turso':15,65 'type':62 'typescript':59,71 'unifi':34 'updat':29 'version':21 'workflow':19","created_at":"2026-06-05T17:01:19.679909+00:00","updated_at":"2026-06-05T17:01:19.679909+00:00","problems":[{"fix":"Use import { RemoteLibSQL } from 'remote-sql-libsql'","cause":"Importing as default instead of named export.","error":"RemoteLibSQL is not a constructor"},{"fix":"Install @libsql/core: pnpm add @libsql/core","cause":"Peer dependency not installed.","error":"Missing package: @libsql/core"},{"fix":"Ensure createClient() returns a valid Client object before constructing RemoteLibSQL.","cause":"Client passed to RemoteLibSQL constructor is undefined or invalid.","error":"TypeError: Cannot read properties of undefined (reading 'prepare')"},{"fix":"Use .all<T>() instead of .query<T>().","cause":"Trying to call .query() which was removed in favor of .all().","error":"Method 'query' does not exist"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/wighawag/remote-sql/tree/main/packages/remote-sql-libsql#readme","github":"https://github.com/wighawag/remote-sql","docs":null,"changelog":null,"pypi":null,"npm":"remote-sql-libsql","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}