{"_id":"@all2cf/database-connect","name":"@all2cf/database-connect","dist-tags":{"next":"0.2.0-rc.2","latest":"0.2.0-rc.2"},"versions":{"0.2.0-rc.2":{"name":"@all2cf/database-connect","version":"0.2.0-rc.2","description":"PostgreSQL-compatible Service Binding client and loopback connector for All2CF Database","type":"module","exports":{".":"./src/pg.js","./pg":{"types":"./src/pg.d.ts","import":"./src/pg.js","default":"./src/pg.js"},"./package.json":"./package.json"},"types":"./src/pg.d.ts","bin":{"a2c-db-connect":"bin/a2c-db-connect.mjs"},"engines":{"node":">=24.0.0"},"license":"UNLICENSED","_id":"@all2cf/database-connect@0.2.0-rc.2","_integrity":"sha512-EVVG8/UpoOD5E6eJSAJlFVkWTT8ZJibZ5wNjfGPuddCsDUFlOXFrJRXq3PeXh6VldBWrYEIbCkXdomW5Ud+6zQ==","_resolved":"/opt/1panel/apps/a2c-dev/database-install-short-code-artifacts-final/all2cf-database-connect-0.2.0-rc.2.tgz","_from":"file:/opt/1panel/apps/a2c-dev/database-install-short-code-artifacts-final/all2cf-database-connect-0.2.0-rc.2.tgz","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-EVVG8/UpoOD5E6eJSAJlFVkWTT8ZJibZ5wNjfGPuddCsDUFlOXFrJRXq3PeXh6VldBWrYEIbCkXdomW5Ud+6zQ==","shasum":"f771fab784391086baacbf852da14f8a5083226b","tarball":"https://registry.npmjs.org/@all2cf/database-connect/-/database-connect-0.2.0-rc.2.tgz","fileCount":6,"unpackedSize":33999,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCN1hi/ucM77VW+u7luD2Ym2sJff7w/BzOpmsby9vBlbwIgYF3heMgGmQbYXrwx5B3C5Rb/whb0J7fV8YDNrmp/Kik="}]},"_npmUser":{"name":"alex887885","email":"alex887885@gmail.com"},"directories":{},"maintainers":[{"name":"alex887885","email":"alex887885@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/database-connect_0.2.0-rc.2_1786829483260_0.21655860334143462"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-15T21:31:23.086Z","0.2.0-rc.2":"2026-08-15T21:31:23.418Z","modified":"2026-08-15T21:31:23.664Z"},"maintainers":[{"name":"alex887885","email":"alex887885@gmail.com"}],"description":"PostgreSQL-compatible Service Binding client and loopback connector for All2CF Database","license":"UNLICENSED","readme":"# All2CF Database Connect\n\nCloudflare Workers import `pg` through the lightweight Service Binding client:\n\nRun the short command shown by the database page from the Worker project root:\n\n```bash\nnpx @all2cf/database-connect@0.2.0-rc.2 db_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n```\n\nThe database identifier is not a credential. The installer uses the customer's existing\nWrangler login to confirm that the Database Worker is visible in the same Cloudflare account,\npreserves business source and the original Wrangler file, writes a deployment overlay, and runs\n`wrangler deploy --dry-run`. It never deploys automatically; it prints the exact deploy command.\n\nTo remove the generated local overlay and dependency, run:\n\n```bash\nnpx @all2cf/database-connect@0.2.0-rc.2 rm db_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n```\n\n```json\n{\n  \"alias\": { \"pg\": \"@all2cf/database-connect/pg\" },\n  \"services\": [{\n    \"binding\": \"ALL2CF_DATABASE\",\n    \"service\": \"edgepg-database-worker\",\n    \"entrypoint\": \"All2CFDatabase\",\n    \"remote\": true\n  }]\n}\n```\n\nApplication TypeScript and SQL stay unchanged. A connected client opens one RPC session; a\ntransaction therefore remains on one EdgePG client. Each session permits 28 query calls so\nCloudflare's 32-invocation request limit is never reached unexpectedly. Use `client.batch()`\nor a database job for larger units of work.\n\nNon-Worker applications and PostgreSQL tools continue to use the loopback connector below.\n\n`@all2cf/database-connect` exposes an All2CF-managed CF Postgres database\nWorker as a loopback-only PostgreSQL endpoint for local or non-Cloudflare\nNode.js projects.\n\n```bash\nnpm install --global ./all2cf-database-connect-0.1.0-rc.3.tgz\n\na2c-db-connect \\\n  --worker-url \"$A2C_DATABASE_WORKER_URL\" \\\n  --token \"$A2C_DATABASE_CONNECT_TOKEN\"\n```\n\nThe command prints a standard `DATABASE_URL`. Keep the process running while\nthe application is connected. Stop it and replace `DATABASE_URL` to switch the\napplication back to native PostgreSQL.\n\nThe connector:\n\n- binds only to `127.0.0.1`, `localhost`, or `[::1]`;\n- forwards PostgreSQL bytes directly over an authenticated WebSocket;\n- does not parse SQL, store database credentials, or deploy a Worker;\n- requires Node.js 24 or newer.\n","readmeFilename":"README.md","_rev":"1-ce0fa16ae08208315a3fa6425eac1ede"}