Comment on The PlanetScale serverless driver for JavaScriptComments−mandeepj4yPlease forgive my ignorance. Is it right if I say the password seems to be available on the client side?import { connect } from '@planetscale/database'const config = { host: '<host>', username: '<user>', password: '<password>' }https://github.com/planetscale/database-js−thundergolfer4yThey say in the post to use environment variables when deploying. I think they’re talking about server-side JS, not JS running in an end-user’s browser.−jakear4yThe intended runtime platform is serverless/edge compute, not client side. Think Cloudflare Workers, Vercel Edge Functions, AWS Lambda, etc.The idea is these runtimes typically only allow HTTP outbound requests, not whatever protocol is typically used to connect to a planetscale db.−mattrobenolt4yCorrect. I would not recommend doing that. This is analogous to a database driver. It's raw access to the database.
Comments
Please forgive my ignorance. Is it right if I say the password seems to be available on the client side?
import { connect } from '@planetscale/database'
const config = { host: '<host>', username: '<user>', password: '<password>' }
https://github.com/planetscale/database-js
They say in the post to use environment variables when deploying. I think they’re talking about server-side JS, not JS running in an end-user’s browser.
The intended runtime platform is serverless/edge compute, not client side. Think Cloudflare Workers, Vercel Edge Functions, AWS Lambda, etc.
The idea is these runtimes typically only allow HTTP outbound requests, not whatever protocol is typically used to connect to a planetscale db.
Correct. I would not recommend doing that. This is analogous to a database driver. It's raw access to the database.