{"id":13880890,"url":"https://github.com/planetscale/planetscale-node","last_synced_at":"2025-07-16T17:31:14.521Z","repository":{"id":43859804,"uuid":"334205432","full_name":"planetscale/planetscale-node","owner":"planetscale","description":"PlanetScale SQL Proxy NPM Module","archived":true,"fork":false,"pushed_at":"2024-03-12T17:47:10.000Z","size":13191,"stargazers_count":55,"open_issues_count":6,"forks_count":5,"subscribers_count":26,"default_branch":"main","last_synced_at":"2025-07-12T07:33:04.511Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/planetscale.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-29T16:47:15.000Z","updated_at":"2024-07-24T09:44:44.000Z","dependencies_parsed_at":"2024-10-28T08:12:55.121Z","dependency_job_id":null,"html_url":"https://github.com/planetscale/planetscale-node","commit_stats":{"total_commits":53,"total_committers":12,"mean_commits":4.416666666666667,"dds":0.7735849056603774,"last_synced_commit":"a0836f3bb5c5ed16661580b87ef2b6ae4fe39ada"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/planetscale/planetscale-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetscale%2Fplanetscale-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetscale%2Fplanetscale-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetscale%2Fplanetscale-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetscale%2Fplanetscale-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/planetscale","download_url":"https://codeload.github.com/planetscale/planetscale-node/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetscale%2Fplanetscale-node/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265527547,"owners_count":23782480,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-06T08:03:36.406Z","updated_at":"2025-07-16T17:31:14.258Z","avatar_url":"https://github.com/planetscale.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# planetscale-node\n\n⚠️ Do not use this package. It is from PlanetScale's early beta and no longer necessary. ⚠️\n\n- To use PlanetScale with a Node.js application, follow our [Node.js guide](https://planetscale.com/docs/tutorials/connect-nodejs-app). \n- PlanetScale is MySQL compatible and you can expect it to work with any MySQL node compatible library.\n- For applications that require edge (http) connectivity, we recommend [database.js](https://github.com/planetscale/database-js)\n\n⚠️ The rest of the readme is for archival purposes only. ⚠️\n\n## Installation\n\n```\n$ npm install planetscale-node\n```\n\n## Setup\n\nThis code uses the PlanetScale API to provision a TLS certificate, and then connects to the database. It uses Service Tokens for authentication, so you'll need to create one for the app:\n\n```bash\n~\u003e pscale service-token create\n  NAME           TOKEN\n -------------- ------------------------------------------\n  nyprhd2z6bd3   [REDACTED]\n\n~\u003e pscale service-token add-access nyprhd2z6bd3 connect_production_branch --database [YOUR DB]\n  DATABASE   ACCESSES\n ---------- ---------------------------\n  [YOUR DB]       connect_production_branch\n```\n\n## Usage\n\nSet the following environment variables in your application.\n\n```bash\nexport PLANETSCALE_TOKEN='[REDACTED]'\nexport PLANETSCALE_TOKEN_NAME='nyprhd2z6bd3'\nexport PLANETSCALE_ORG='[YOUR ORG]'\nexport PLANETSCALE_DB='[YOUR DB NAME]'\n```\n\n```javascript\nconst { PSDB } = require('planetscale-node')\nconst conn = new PSDB('main')\n\nasync function main() {\n  const [rows, fields] = await conn.query('select * from reminders')\n  console.log(rows, fields)\n}\n\nmain()\n```\n\n### Using prepared statements\n\n```javascript\nconst { PSDB } = require('planetscale-node')\nconst conn = new PSDB('main')\n\nasync function main() {\n  const [rows, fields] = await conn.execute('select * from reminders where id \u003e ?', [10])\n  console.log(rows, fields)\n}\n\nmain()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplanetscale%2Fplanetscale-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplanetscale%2Fplanetscale-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplanetscale%2Fplanetscale-node/lists"}