Live data from Hacker News

The PlanetScale serverless driver for JavaScript

planetscale.com

51–56 of 56 posts

Re: The PlanetScale serverless driver for JavaScript

#51

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: ' ', username: ' ', password: ' ' } https://github.com/planetscale/database-js

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.

Re: The PlanetScale serverless driver for JavaScript

#52
post #38

Earlier quoted context omitted.

That’s fair. They are the only game in town, last I checked, that has full (good) TypeScript support which is a must-have for me. TypeORM is the other I know about and I’ve used it as well but I greatly prefer Prisma. Other than having to bundle the engine I’ve been very happy with Prisma + PlanetScale. I’m open to any other TypeScript ORMs if you know of them.

I haven't used them, but https://github.com/koskimas/kysely and https://github.com/RobinBlomberg/kysely-codegen are doing some interesting things with TypeScript, focusing just on generating SQL queries, quite a bit more lightweight than Prisma.

I've also been following Kysely and am a big fan, having used Objection.js and Knex a lot in the past. I consider Kysely to be the TypeScript-native spiritual successor to Knex.

For a theoretical new Node + TypeScript + SQL project, the three options I would consider are, from most-ORMy to least:

- Prisma

- Kysely + kysely-codegen (query builder)

- slonik + @slonik/typegen (raw postgres driver with good types; not sure if there's a good MySQL equivalent)

Re: The PlanetScale serverless driver for JavaScript

#54

While this is cool tech and convenient, I worry about run-away costs and what happens if the company goes down? Seems like a LOT of risk.

> what happens if the company goes down? It's open-source. What's your concern now? https://github.com/planetscale/database-js

The server is NOT open source.

Re: The PlanetScale serverless driver for JavaScript

#55

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. 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. I've been using P…

> Zero-downtime deploys, with rollback support, feel magical.

How does this work?

Re: The PlanetScale serverless driver for JavaScript

#56

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. 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. I've been using P…

> Zero-downtime deploys, with rollback support, feel magical. How does this work?

You can learn more about the zero-downtime deploys here [0] which also covers the rollback support ("Rewind"). You can also read more about Rewind in this blog post [1]

[0] https://planetscale.com/docs/concepts/deploy-requests

[1] https://planetscale.com/blog/its-fine-rewind-revert-a-migrat...

Post reply on HN