{"_id":"@alt-javascript/jsdbc-sqljs","_rev":"3-9fc4c2b30a488556a9e76160ee5c015f","name":"@alt-javascript/jsdbc-sqljs","dist-tags":{"latest":"1.2.0"},"versions":{"1.0.0":{"name":"@alt-javascript/jsdbc-sqljs","version":"1.0.0","keywords":["jsdbc","jdbc","database","sqlite","sql.js","wasm","browser","isomorphic","driver"],"author":{"name":"Craig Parravicini"},"license":"MIT","_id":"@alt-javascript/jsdbc-sqljs@1.0.0","maintainers":[{"name":"craigparra","email":"craigparra@gmail.com"}],"contributors":[{"url":"Anthropic","name":"Claude"}],"homepage":"https://github.com/alt-javascript/jsdbc/tree/main/packages/sqljs#readme","bugs":{"url":"https://github.com/alt-javascript/jsdbc/issues"},"dist":{"shasum":"9b81f240b903d1bd3e95f1f12e8a433210c24b13","tarball":"https://registry.npmjs.org/@alt-javascript/jsdbc-sqljs/-/jsdbc-sqljs-1.0.0.tgz","fileCount":8,"integrity":"sha512-mUg3irpbHndtPa0Yr5AX8u/kFywF44d6SCgaHARwxynJjcd6ui8cwx/eyrS6RQfG+4+G06jJi668Wm/MPqGZcA==","signatures":[{"sig":"MEQCIA7hGNMxjywKzz1BAiqGKBe5w1SCYQlwuxDZs0IjTFLsAiBrfH5SttZM/dzm6rzBAczoGQAQ+eo0azl8Nb/QX0VZnQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8828},"main":"index.js","type":"module","gitHead":"cb11bcfac234e6e38e0dafe1b3cd6be438404c03","scripts":{"test":"mocha --recursive test/**/*.spec.js"},"_npmUser":{"name":"craigparra","email":"craigparra@gmail.com"},"repository":{"url":"git+https://github.com/alt-javascript/jsdbc.git","type":"git","directory":"packages/sqljs"},"_npmVersion":"11.12.0","description":"JSDBC driver for SQLite via sql.js (isomorphic — Node + browser)","directories":{},"_nodeVersion":"24.14.0","dependencies":{"sql.js":"^1.11.0","@alt-javascript/jsdbc-core":"*"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.7","mocha":"^10.2.0"},"_npmOperationalInternal":{"tmp":"tmp/jsdbc-sqljs_1.0.0_1773967820743_0.7104959584896875","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@alt-javascript/jsdbc-sqljs","version":"1.1.1","keywords":["jsdbc","jdbc","database","sqlite","sql.js","wasm","browser","isomorphic","driver"],"author":{"name":"Craig Parravicini"},"license":"MIT","_id":"@alt-javascript/jsdbc-sqljs@1.1.1","maintainers":[{"name":"craigparra","email":"craigparra@gmail.com"}],"contributors":[{"url":"Anthropic","name":"Claude"}],"homepage":"https://github.com/alt-javascript/jsdbc/tree/main/packages/sqljs#readme","bugs":{"url":"https://github.com/alt-javascript/jsdbc/issues"},"dist":{"shasum":"6b1cc6f411e3b437ef398ab41c2a09ca5b4f02ec","tarball":"https://registry.npmjs.org/@alt-javascript/jsdbc-sqljs/-/jsdbc-sqljs-1.1.1.tgz","fileCount":8,"integrity":"sha512-Il3DWGXccQUa+QJUretiMRlJyqcOG4PPmANSugMKdC8kBBQS9TDLuA9j2NS+CUvoUVgatPK5zMlzkCOHy1WnQQ==","signatures":[{"sig":"MEQCIGHGBN+ra8WqfZ27CQN5rvWjPyUACU0+yphwUkYgF6GAAiBpyf8nUWhO2CO4t3F8JeD0cM1JWlYUd8sV/ZHXWmgNQg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8828},"main":"index.js","type":"module","gitHead":"0769b436f75d65bb153cdb9cf00186f464416cff","scripts":{"test":"mocha --recursive test/**/*.spec.js"},"_npmUser":{"name":"craigparra","email":"craigparra@gmail.com"},"repository":{"url":"git+https://github.com/alt-javascript/jsdbc.git","type":"git","directory":"packages/sqljs"},"_npmVersion":"11.12.0","description":"JSDBC driver for SQLite via sql.js (isomorphic — Node + browser)","directories":{},"_nodeVersion":"24.14.0","dependencies":{"sql.js":"^1.11.0","@alt-javascript/jsdbc-core":"*"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.7","mocha":"^10.2.0"},"_npmOperationalInternal":{"tmp":"tmp/jsdbc-sqljs_1.1.1_1774504404370_0.9315739599837782","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@alt-javascript/jsdbc-sqljs","version":"1.2.0","description":"JSDBC driver for SQLite via sql.js (isomorphic — Node + browser)","keywords":["jsdbc","jdbc","database","sqlite","sql.js","wasm","browser","isomorphic","driver"],"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"homepage":"https://github.com/alt-javascript/jsdbc/tree/main/packages/sqljs#readme","repository":{"type":"git","url":"git+https://github.com/alt-javascript/jsdbc.git","directory":"packages/sqljs"},"type":"module","main":"index.js","scripts":{"test":"mocha --recursive test/**/*.spec.js"},"dependencies":{"@alt-javascript/jsdbc-core":"*","sql.js":"^1.11.0"},"devDependencies":{"chai":"^4.3.7","mocha":"^10.2.0"},"author":{"name":"Craig Parravicini"},"contributors":[{"name":"Claude","url":"Anthropic"}],"license":"MIT","gitHead":"29c62c831f3b9c6007b21904aba69c61281ffd41","_id":"@alt-javascript/jsdbc-sqljs@1.2.0","bugs":{"url":"https://github.com/alt-javascript/jsdbc/issues"},"_nodeVersion":"24.14.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-HzcSF/ZdZyH6LBC2qbuS4VQ60suyK24xh14whCtk6tDFJeV7EUadU5a8aC4kab9oUDXC3/GpyjT+Ehgq1W/0dQ==","shasum":"684468c0db33ee8fab788e3b62265dd560d7b287","tarball":"https://registry.npmjs.org/@alt-javascript/jsdbc-sqljs/-/jsdbc-sqljs-1.2.0.tgz","fileCount":8,"unpackedSize":8828,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCjwresLQEiS93oh2f58/fOa3lSCUs8VPmX7PvsxZjmxAIgPFKbhOF1BiXP+QT9b5s3EsE/thnEGw1eYGK/Z8OHrYA="}]},"_npmUser":{"name":"craigparra","email":"craigparra@gmail.com"},"directories":{},"maintainers":[{"name":"craigparra","email":"craigparra@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/jsdbc-sqljs_1.2.0_1774900898048_0.4595606515432791"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-20T00:50:20.652Z","modified":"2026-03-30T20:01:38.320Z","1.0.0":"2026-03-20T00:50:20.879Z","1.1.1":"2026-03-26T05:53:24.521Z","1.2.0":"2026-03-30T20:01:38.180Z"},"bugs":{"url":"https://github.com/alt-javascript/jsdbc/issues"},"author":{"name":"Craig Parravicini"},"license":"MIT","homepage":"https://github.com/alt-javascript/jsdbc/tree/main/packages/sqljs#readme","keywords":["jsdbc","jdbc","database","sqlite","sql.js","wasm","browser","isomorphic","driver"],"repository":{"type":"git","url":"git+https://github.com/alt-javascript/jsdbc.git","directory":"packages/sqljs"},"description":"JSDBC driver for SQLite via sql.js (isomorphic — Node + browser)","contributors":[{"name":"Claude","url":"Anthropic"}],"maintainers":[{"name":"craigparra","email":"craigparra@gmail.com"}],"readme":"# @alt-javascript/jsdbc-sqljs\n\n[![Language](https://img.shields.io/badge/language-JavaScript-yellow.svg)](https://developer.mozilla.org/en-US/docs/Web/JavaScript)\n[![npm version](https://img.shields.io/npm/v/%40alt-javascript%2Fjsdbc-sqljs)](https://www.npmjs.com/package/@alt-javascript/jsdbc-sqljs)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![CI](https://github.com/alt-javascript/jsdbc/actions/workflows/node.js.yml/badge.svg)](https://github.com/alt-javascript/jsdbc/actions/workflows/node.js.yml)\n\nJSDBC driver for SQLite via [sql.js](https://github.com/sql-js/sql.js) (WebAssembly). Runs the same SQL in Node.js and the browser — no native dependencies, no build step.\n\n**Part of the [@alt-javascript/jsdbc](https://github.com/alt-javascript/jsdbc) monorepo.**\n\n## Install\n\n```bash\nnpm install @alt-javascript/jsdbc-core @alt-javascript/jsdbc-sqljs\n```\n\n## Usage\n\n```javascript\nimport { SingleConnectionDataSource } from '@alt-javascript/jsdbc-core';\nimport '@alt-javascript/jsdbc-sqljs'; // self-registers with DriverManager\n\nconst ds = new SingleConnectionDataSource({ url: 'jsdbc:sqljs:memory' });\nconst conn = await ds.getConnection();\n\nconst stmt = await conn.createStatement();\nawait stmt.executeUpdate('CREATE TABLE notes (id INTEGER PRIMARY KEY, text TEXT)');\n\nconst ps = await conn.prepareStatement('INSERT INTO notes (text) VALUES (?)');\nps.setParameter(1, 'Hello from the browser');\nawait ps.executeUpdate();\n\nconst query = await conn.prepareStatement('SELECT * FROM notes');\nconst rs = await query.executeQuery();\nconsole.log(rs.getRows()); // [{id: 1, text: 'Hello from the browser'}]\n\nrs.close();\n// Don't close conn — SingleConnectionDataSource keeps it alive\nawait ds.destroy(); // when truly done\n```\n\n## URL Scheme\n\n```\njsdbc:sqljs:memory\n```\n\nCurrently supports in-memory databases only. Each connection creates a new empty database — use `SingleConnectionDataSource` to share a single database instance across operations.\n\n## Browser Usage\n\n```html\n<script type=\"module\">\n  import { SingleConnectionDataSource } from '@alt-javascript/jsdbc-core';\n  import '@alt-javascript/jsdbc-sqljs';\n\n  const ds = new SingleConnectionDataSource({ url: 'jsdbc:sqljs:memory' });\n  const conn = await ds.getConnection();\n  // Same API as Node.js\n</script>\n```\n\nThe sql.js WebAssembly binary (~1MB) is loaded automatically.\n\n## When to Use\n\n- **Browser applications** needing client-side SQL\n- **Isomorphic code** that must run identically in Node.js and the browser\n- **Testing** without native dependencies — CI environments with no C++ compiler\n- **Offline-first apps** with in-memory data\n\nFor Node.js-only applications where performance matters, use [`@alt-javascript/jsdbc-sqlite`](https://www.npmjs.com/package/@alt-javascript/jsdbc-sqlite) (better-sqlite3) instead.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}