Francesco Sardo
01/20/2022, 11:19 AMschema.prisma
, and manage migrations from the web UI or via a CLI.
• You connect to this service via a client (Prisma Lite) via a URL + secure token and you select a branch to point to
• Your Prisma Lite client downloads the typed definitions and typechecks your code.
• Your queries and mutations are pure JSONs that are sent to the Data Platform (it might need tweaking the api a bit)
◦ Maybe something like db({"projects": {"create": {"name": "foo" } } })
• Instead of managing migrations from your project, you manage them via the Data Platform. You create a new PlanetScale branch, migrate it and then you point your Prisma Lite client to it. Before deploying your client to production, you merge the DB branch. Every time you point to a different PlanetScale branch the client code pulls the new definitions and typechecks your code.
Considerations:
• Personally, I would love to use this kind of service. I'd be a much stronger offering than the other DBaaS because of the safe migrations / branching and type safe apis and I'd be more than happy to pay Prisma to abstract over the underlying db and the other features like Preview DB, Proxy etc.
• The client side code would be extremely light (it's just JSON over the wire!)
• Prisma DSL is so fluent that sending queries and mutations over http would just feel like using a graphql api, without the overhead of gql
• What about security? We're basically sending type-safe SQL over the wire... Well, of course this should come from a server that you own (not the browser!) and maybe there's some ip restriction that needs to be put in place, but it wouldn't be that different from using a Postgres connection string in your server.
I'm intrigued by this idea, and I'm curious to hear what do you think?tmoney
06/16/2022, 7:22 PM