I would like to use PlanetScale with my App Platform app, how can I configure it to use the proxy that is required?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Please, do NOT follow the answer from Jon Friesen anymore. It was probably written before PlanetScale implement its connection strings feature.
Instead:
MYSQL_ATTR_SSL_CA
env variable also with the value/etc/ssl/certs/ca-certificates.crt
You can also find more details here
👋
Great question! Since PlanetScale has a neat client that creates a proxy to the database instance, we will have to install and authenticate that tool so that it can inject a
DATABASE_URL
environment variable into the app.Don’t forget to set the required PlanetScale environment variables from the tutorial!
And that’s it! PlanetScale connections in App Platform! If you want to support PlanetScale with an a dockerfile based app add the install command above prefixed with
RUN
to your dockerfile, for example:Don’t forget to ensure your run command is wrapped in the
pscale connect...
command :)Here’s an example app spec: