Would it be possible to use Prisma in a “backendle...
# orm-help
d
Would it be possible to use Prisma in a “backendless” scenario? I.e., to use it to maintain local state in a javascript application?
✅ 1
j
If you mean in browser, there are no databases for browser so no
Only ones that exist are extremely hacky and problematic like https://github.com/sql-js/sql.js
Web assembly might eventually make sqlite feasible in browser but for now it's garbage
Even then, I do not think you could get Prisma to run in browser
It runs only in node
a
Isn't it a bit of an overkill to use such a large library for something in the browser? I think browsers are tired and start to do less and less work. SSR, or streaming components are meant to reduce that workload from browsers to make the page faster.
d
My thinking is this: in the back end there are tables, relationships, queries, and transactions. I think those systems would work just fine in the client. Whether or not you are dealing with local stuff or mirroring remote systems, it would be an effective system for state management. Further, if you can mirror the backend structure in the front end it makes synchronizing frontend systems easier as you can just keep pace with the backend schema.
n
Hi Dave, As of today PrismaClient is unable to run in the browser. We do have a Feature Request to support using prisma from within the browser to connect to SQLite JavaScript in memory database: #5385, but this is not on immediate roadmap