{"id":16548110,"url":"https://github.com/mattrobenolt/ps-http-sim","last_synced_at":"2025-04-06T05:15:38.637Z","repository":{"id":140551854,"uuid":"527803546","full_name":"mattrobenolt/ps-http-sim","owner":"mattrobenolt","description":"UNOFFICIAL PlanetScale HTTP simulator","archived":false,"fork":false,"pushed_at":"2025-02-10T18:29:08.000Z","size":103,"stargazers_count":103,"open_issues_count":0,"forks_count":6,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-30T04:09:28.661Z","etag":null,"topics":["database","mysql","planetscale"],"latest_commit_sha":null,"homepage":"https://planetscale.com","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mattrobenolt.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":"2022-08-23T02:26:09.000Z","updated_at":"2025-03-22T16:20:44.000Z","dependencies_parsed_at":"2023-10-16T12:37:08.791Z","dependency_job_id":"51994a3b-1e24-44a8-bc5d-4b6cd5a7a1a2","html_url":"https://github.com/mattrobenolt/ps-http-sim","commit_stats":{"total_commits":33,"total_committers":3,"mean_commits":11.0,"dds":0.06060606060606055,"last_synced_commit":"a25c36f350f0076d01eb1a26ae59a3e0c2b28cc0"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattrobenolt%2Fps-http-sim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattrobenolt%2Fps-http-sim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattrobenolt%2Fps-http-sim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattrobenolt%2Fps-http-sim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattrobenolt","download_url":"https://codeload.github.com/mattrobenolt/ps-http-sim/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247436285,"owners_count":20938533,"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":["database","mysql","planetscale"],"created_at":"2024-10-11T19:24:58.103Z","updated_at":"2025-04-06T05:15:38.614Z","avatar_url":"https://github.com/mattrobenolt.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# ps-http-sim\n\n`ps-http-sim` stands in as a proxy in front of a normal MySQL database, and provides a PlanetScale HTTP API compatibility layer.\n\nAt the moment, this is not an official PlanetScale project, and is in early stage development and quality. Please do not use this in production environments.\n\nThis is intended to aid when adopting `@planetscale/database` in your application and wanting to run against a local database.\n\nPlease open issues for bugs or any feedback.\n\n# Installation\n\n## Binaries\n\nCompiled binaries can be found in GitHub Releases: https://github.com/mattrobenolt/ps-http-sim/releases\n\n## Docker\n\nImages are published to [ghcr.io/mattrobenolt/ps-http-sim:latest](https://github.com/mattrobenolt/ps-http-sim/pkgs/container/ps-http-sim)\n\n### docker-compose\n\nA sample docker-compose.yml is available in the examples folder.\nThis will spin up a mysql server on the default port of 3306, and ps-http-sim on port 3900.\n\nWhen setting up your connection, the config object needs to use the `url` property with a `http://` address with a non-null password, instead of `host`, `username` \u0026 `password`.\ne.g. `{ url: 'http://root:nonNullPassword@localhost:3900'}`\nUsing `host` will force https.\n\nYou can connect directly to the mysql server using a mysql uri\n`mysql://root:nonNullPassword@localhost/planetscale`\n\n## Build from source\n\nGo is required:\n\n```\n$ go install github.com/mattrobenolt/ps-http-sim@latest\n```\n\nor from within this repository:\n\n```\n$ make\n```\n\n# Usage\n\n```\n$ ps-http-sim -help\nUsage of ps-http-sim:\n  -listen-addr string\n        HTTP server address (default \"127.0.0.1\")\n  -listen-port uint\n        HTTP server port (default 8080)\n  -log-level string\n        Log level (debug, info, warn, error, dpanic, panic, fatal) (default \"debug\")\n  -mysql-addr string\n        MySQL address (default \"127.0.0.1\")\n  -mysql-dbname string\n        MySQL database to connect to (default \"mysql\")\n  -mysql-idle-timeout duration\n        MySQL connection idle timeout (default 10s)\n  -mysql-listen-port uint\n        Run a TCP proxy back to the underlying MySQL server\n  -mysql-max-rows uint\n        Max rows for a single query result set (default 1000)\n  -mysql-no-pass\n        Don't use password for MySQL connection\n  -mysql-port uint\n        MySQL port (default 3306)\n```\n\nThere is an example Node configuration in the `example/` folder.\n\nA sample `mysqld` docker container can be run by doing:\n\n```\n$ make run-mysql\n```\n\nIf you'd prefer not to run a binary directly, a docker container can be built with:\n\n```\n$ make docker\n```\n\nI'm not good at docker, so if this is bad or any suggestions, I'm open to anything.\n\n## Authentication\n\nThe authentication you configure in your database-js application, is passed along as-is to your local MySQL database. So you'd want to match up the authentication to match what you'd with a normal MySQL client.\n\nIf your database is configured to not use a password, the `-mysql-no-pass` flag must be set on `ps-http-sim`, but database-js must be configured still to send a password. The password may be anything except blank.\n\nThis is a bit of a \"wart\" in that the PlanetScale API would fail if not being presented with a password at all since it's impossible to have a PlanetScale database without a password.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattrobenolt%2Fps-http-sim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattrobenolt%2Fps-http-sim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattrobenolt%2Fps-http-sim/lists"}