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.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
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: