{"_id":"@alt-javascript/camel-lite-component-sql","_rev":"3-437b8c239ceb2ec78b299446c2bafc7f","name":"@alt-javascript/camel-lite-component-sql","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.2":{"name":"@alt-javascript/camel-lite-component-sql","version":"1.0.2","keywords":["alt-javascript","camel","camel-lite","eai","eip","integration","sql","sqlite","database","component"],"author":{"name":"Craig Parravicini"},"_id":"@alt-javascript/camel-lite-component-sql@1.0.2","maintainers":[{"name":"craigparra","email":"craigparra@gmail.com"}],"contributors":[{"url":"Anthropic","name":"Claude"},{"name":"Apache Camel — design inspiration and pattern source"}],"homepage":"https://github.com/alt-javascript/camel-lite#readme","bugs":{"url":"https://github.com/alt-javascript/camel-lite/issues"},"dist":{"shasum":"3f65e779a21ce2531b4195e1093e1f3b7dc8483b","tarball":"https://registry.npmjs.org/@alt-javascript/camel-lite-component-sql/-/camel-lite-component-sql-1.0.2.tgz","fileCount":10,"integrity":"sha512-c7z491wG/Ml/zlXQxgpuQQLyEvpW/RI9lPYAcQ2/PMyTkBpqdWHI+LA4b3FCUCSisWxR80GxSSa766lYgAMqBg==","signatures":[{"sig":"MEQCIEWPKbbiE3onVpvlQ5OboU03lhY808rPnIG8REapRGGPAiA04dUaUkT6ErD5sW8nw9+nq03uY1OMX3L2iMB+4tcdBg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alt-javascript%2fcamel-lite-component-sql@1.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":31503},"type":"module","exports":{".":"./src/index.js"},"gitHead":"9f948b9f02d85c9f593229684c475cd209369f2c","scripts":{"test":"node --test"},"_npmUser":{"name":"craigparra","email":"craigparra@gmail.com"},"repository":{"url":"git+https://github.com/alt-javascript/camel-lite.git","type":"git"},"_npmVersion":"11.9.0","description":"[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)","directories":{},"_nodeVersion":"24.14.0","dependencies":{"@alt-javascript/common":"^3.0.7","@alt-javascript/config":"^3.0.7","@alt-javascript/logger":"^3.0.7","@alt-javascript/camel-lite-core":"1.0.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/camel-lite-component-sql_1.0.2_1774595625620_0.4281229120905934","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@alt-javascript/camel-lite-component-sql","version":"1.1.0","keywords":["alt-javascript","camel","camel-lite","eai","eip","integration","sql","sqlite","database","component"],"author":{"name":"Craig Parravicini"},"_id":"@alt-javascript/camel-lite-component-sql@1.1.0","maintainers":[{"name":"craigparra","email":"craigparra@gmail.com"}],"contributors":[{"url":"Anthropic","name":"Claude"}],"homepage":"https://github.com/alt-javascript/camel-lite#readme","bugs":{"url":"https://github.com/alt-javascript/camel-lite/issues"},"dist":{"shasum":"ff6f763303abc88b7d74aeb44fc8ea702dba4347","tarball":"https://registry.npmjs.org/@alt-javascript/camel-lite-component-sql/-/camel-lite-component-sql-1.1.0.tgz","fileCount":10,"integrity":"sha512-z9mA6DYLlIG4A+5Qdr+y43Alai62WVj1o8OcBAT89F8eNJZyJOf8ezTs1YNEuJNR7DSBNiOMPRmKRfZ4rf/9Dg==","signatures":[{"sig":"MEUCIDKlLDj7212nbgQ7C302j2GBQL8QvVwIVqNfHqpeFdBAAiEAraUwkH9pasKXUZD/aF01Byn8gynMECjxY7MiUCVZhdQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alt-javascript%2fcamel-lite-component-sql@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":31441},"type":"module","exports":{".":"./src/index.js"},"gitHead":"c227a03632d4b1e2f93b4562c7e74f52ba87d340","scripts":{"test":"node --test"},"_npmUser":{"name":"craigparra","email":"craigparra@gmail.com"},"repository":{"url":"git+https://github.com/alt-javascript/camel-lite.git","type":"git"},"_npmVersion":"11.9.0","description":"[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)","directories":{},"_nodeVersion":"24.14.0","dependencies":{"@alt-javascript/common":"^3.0.7","@alt-javascript/config":"^3.0.7","@alt-javascript/logger":"^3.0.7","@alt-javascript/camel-lite-core":"1.1.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/camel-lite-component-sql_1.1.0_1774763526247_0.9278663860278895","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@alt-javascript/camel-lite-component-sql","version":"1.1.1","type":"module","exports":{".":"./src/index.js"},"dependencies":{"@alt-javascript/logger":"^3.0.7","@alt-javascript/config":"^3.0.7","@alt-javascript/common":"^3.0.7","@alt-javascript/camel-lite-core":"1.1.1"},"scripts":{"test":"node --test"},"repository":{"type":"git","url":"git+https://github.com/alt-javascript/camel-lite.git"},"author":{"name":"Craig Parravicini"},"contributors":[{"name":"Claude","url":"Anthropic"}],"keywords":["alt-javascript","camel","camel-lite","eai","eip","integration","sql","sqlite","database","component"],"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"gitHead":"ff8501eed381d38ac20f56aea721274466d64212","_id":"@alt-javascript/camel-lite-component-sql@1.1.1","description":"[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)","bugs":{"url":"https://github.com/alt-javascript/camel-lite/issues"},"homepage":"https://github.com/alt-javascript/camel-lite#readme","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-aVY1skfOfr6qZCzRBYMj5aMjyRnRJ9mFIfOVVloi/IzlEuPty/NoLbzgdJxs1XW49voHUQh1l1hPHWiPrGfjfQ==","shasum":"9658620ce718488f931d58f942d30ea98b63c5a6","tarball":"https://registry.npmjs.org/@alt-javascript/camel-lite-component-sql/-/camel-lite-component-sql-1.1.1.tgz","fileCount":10,"unpackedSize":31441,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alt-javascript%2fcamel-lite-component-sql@1.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCID/v1SWmcM0jrkS724rOSNXABq6xYl07gYSNpYXitBuYAiA7U1IHTl6uLesEhxJwdqLTSySS1GLC36yOSqKXK34cng=="}]},"_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/camel-lite-component-sql_1.1.1_1774764478746_0.8468917524451332"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-27T07:13:45.540Z","modified":"2026-03-29T06:07:59.178Z","1.0.2":"2026-03-27T07:13:45.773Z","1.1.0":"2026-03-29T05:52:06.396Z","1.1.1":"2026-03-29T06:07:58.884Z"},"bugs":{"url":"https://github.com/alt-javascript/camel-lite/issues"},"author":{"name":"Craig Parravicini"},"homepage":"https://github.com/alt-javascript/camel-lite#readme","keywords":["alt-javascript","camel","camel-lite","eai","eip","integration","sql","sqlite","database","component"],"repository":{"type":"git","url":"git+https://github.com/alt-javascript/camel-lite.git"},"description":"[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)","contributors":[{"name":"Claude","url":"Anthropic"}],"maintainers":[{"name":"craigparra","email":"craigparra@gmail.com"}],"readme":"[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## What\n\nSQL query and update producer using Node.js built-in [`node:sqlite`](https://nodejs.org/api/sqlite.html) — no native compilation required. The SQL statement is placed in the URI path (URL-encoded). Query results are set as the exchange body; for updates the row-change count is set.\n\n> **Requires Node.js 22.5.0 or later.** Uses `node:sqlite` (DatabaseSync / StatementSync). No `better-sqlite3` or other native dependency.\n\n## Install\n\n```sh\nnpm install camel-lite-component-sql\n```\n\n## URI Syntax\n\n```\nsql:<URL-encoded SQL>[?url=jdbc:sqlite::memory:]\n```\n\nURL-encode spaces as `+` in the SQL statement.\n\n| Parameter | Default | Description |\n|-----------|---------|-------------|\n| `url`     | *(required)* | SQLite connection URL. Format: `jdbc:sqlite:<file-path>` or `jdbc:sqlite::memory:` for in-memory. |\n\n## Usage\n\n```js\nimport { CamelContext } from 'camel-lite-core';\nimport { SqlComponent } from 'camel-lite-component-sql';\n\nconst context = new CamelContext();\ncontext.addComponent('sql', new SqlComponent());\n\ncontext.addRoutes({\n  configure(ctx) {\n    // Insert: exchange body provides the bound parameter value\n    ctx.from('direct:logEvent')\n      .to('sql:INSERT+INTO+events+(message)+VALUES+(?)?url=jdbc:sqlite:/tmp/events.db');\n\n    // Query: results returned as array of row objects\n    ctx.from('direct:fetchEvents')\n      .to('sql:SELECT+*+FROM+events?url=jdbc:sqlite:/tmp/events.db');\n  }\n});\n\nawait context.start();\n\nconst template = context.createProducerTemplate();\n\n// Insert\nawait template.sendBody('direct:logEvent', 'something happened');\n\n// Query\nconst exchange = await template.send('direct:fetchEvents', ex => { ex.in.body = []; });\nconsole.log('Rows:', exchange.in.body);\n\nawait context.stop();\n```\n\n## See Also\n\n[camel-lite — root README](../../README.md)\n","readmeFilename":"README.md"}