You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe I might have found a way to replace planetscale with a different mysql provider, while keeping the features from planetscale.ts working completely.
First, startup a hosted mysql instance somewhere. Can be anywhere. I chose aiven.io.
Get the mysql uri from them. it will look like this:
mysql://username:[email protected]:28146/dbname?ssl-mode=REQUIRED
add this to your .env as the DATABASE_URL
We will now work on a way to deploy the docker image for the planetscale http sim.
Create a folder anywhere (can be named anything). This folder should contain two files:
Dockerfile
FROM ghcr.io/mattrobenolt/ps-http-sim:latest
CMD ["-listen-port=3900", "-mysql-dbname=dbname", "-mysql-addr=hostname.a.aivencloud.com", "-mysql-port=28146"]
Deploy this docker image anywhere. I used render.com for free hosting (upload the above folder with two files to github, and then deploy to render using github). render will give you a url like this: https://examples.onrender.com
Use the url, to add the following to your dub .env file (the username and password come from the mysql uri above)
PLANETSCALE_DATABASE_URL="https://username:[email protected]"
now pnpm run dev, and everything should work as usual, and we dont have to pay the $$ for Planetscale.
Let me know what yall think, and if something can be improved!
The text was updated successfully, but these errors were encountered:
I believe I might have found a way to replace planetscale with a different mysql provider, while keeping the features from planetscale.ts working completely.
First, startup a hosted mysql instance somewhere. Can be anywhere. I chose aiven.io.
Get the mysql uri from them. it will look like this:
mysql://username:[email protected]:28146/dbname?ssl-mode=REQUIRED
add this to your .env as the DATABASE_URL
We will now work on a way to deploy the docker image for the planetscale http sim.
Create a folder anywhere (can be named anything). This folder should contain two files:
docker-compose.yml
version: "3"
services:
planetscale-proxy:
build:
context: .
dockerfile: Dockerfile
environment:
Dockerfile
FROM ghcr.io/mattrobenolt/ps-http-sim:latest
CMD ["-listen-port=3900", "-mysql-dbname=dbname", "-mysql-addr=hostname.a.aivencloud.com", "-mysql-port=28146"]
Deploy this docker image anywhere. I used render.com for free hosting (upload the above folder with two files to github, and then deploy to render using github). render will give you a url like this: https://examples.onrender.com
Use the url, to add the following to your dub .env file (the username and password come from the mysql uri above)
PLANETSCALE_DATABASE_URL="https://username:[email protected]"
now pnpm run dev, and everything should work as usual, and we dont have to pay the $$ for Planetscale.
Let me know what yall think, and if something can be improved!
The text was updated successfully, but these errors were encountered: