4 ms·
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
by mandeepj 4y ago
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 https://github.com/planetscale/database-js
- jakear 4y agoThe 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.
- mattrobenolt 4y agoCorrect. I would not recommend doing that. This is analogous to a database driver. It's raw access to the database.
- thundergolfer 4y agoThey 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.