Very cool and lightweight way to talk to PlanetScale but for now I'll stick with Prisma. Prisma is much heavier (engine weighs in at ~50MB) and that can be a non-starter for serverless in some cases but it works for me on AWS Lambda.<p>The nice thing about PlanetScale is you get nearly unlimited connections (soft limit of like 250K IIRC) so making 1 connection per active lambda isn't a problem at all.<p>I've been using PlanetScale since shortly after they went GA and I've been very happy so far. Cheaper than Aurora Serverless, less hassle, and the branching feature is super cool. Zero-downtime deploys, with rollback support, feel magical.
Please forgive my ignorance. Is it right if I say the password seems to be available on the client side?<p>import { connect } from '@planetscale/database'<p>const config = {
host: '<host>',
username: '<user>',
password: '<password>'
}<p><a href="https://github.com/planetscale/database-js" rel="nofollow">https://github.com/planetscale/database-js</a>
This is great! Potentially the missing piece in the world of "serverless": a serverless SQL database accessible over HTTP with no minimum price. I saw AWS Aurora has a Data API but currently that does have a minimum monthly cost. Fauna is possibly the closest, but that appears to involve translating SQL to its FQL. How stable is the beta?
This is huge for me. I went down the path of trying to build an entire API on CF Workers and the biggest stumbling block was no easy access to external relational databases due to a lack of v8 compatible connectors. This was before the D1 announcement of course.
Has anyone tested edge functions + planetscale (or similar) vs edge functions + a database read replica also located at the edge?<p>It seems like you lose most of the benefit of your code running at the edge if your database is still in an AWS region.
Please consider using a custom string interpolation function to sanitize SQL, not an additional array of parameters. See styled components for inspiration.