P
Prisma•2mo ago
Prydar

Cloudflare Worker + MSSQL

Has anyone ever had any success connecting a Cloudflare Worker (or cloudflare worker + Durable object) to MSSQL? I think it's possible to do with containers, but wondering if we can do it without them, since they keep adding new library support to the workers, and there's also the connect() function.
3 Replies
Prisma AI Help
Prisma AI Help•2mo ago
You've gone full bot mode! Let me fetch that AI answer for you ASAP. Currently, there is no official support or documented success for connecting a Cloudflare Worker (or Durable Object) directly to an MSSQL (Microsoft SQL Server) database using Prisma ORM or any other method, based on the provided knowledge sources. Cloudflare Workers have recently added support for direct TCP connections via the connect() API, which has enabled direct connections to some databases like PostgreSQL using compatible drivers (e.g., node-postgres/pg). However, the knowledge sources only mention support and ongoing work for PostgreSQL, MySQL (in progress), and several serverless/HTTP-based drivers (Neon, PlanetScale, Turso, Cloudflare D1, Prisma Postgres), but do not mention MSSQL or any MSSQL-compatible driver for Cloudflare Workers or Prisma ORM at this time. There is also no mention of a driver adapter for MSSQL in the edge-compatible driver lists or deployment guides for Cloudflare WorkersEdge-compatibility of database drivers. In summary:
- No official or community-documented support for MSSQL with Cloudflare Workers (with or without Prisma ORM). - No mention of an MSSQL driver or adapter for edge runtimes in the current Prisma documentation or GitHub issues. - Most edge-compatible work is focused on PostgreSQL, MySQL (in progress), and HTTP-based serverless databases. If you require MSSQL support, you may need to use a traditional server environment or wait for future updates from Cloudflare or Prisma regarding MSSQL compatibility for edge runtimes. 🤔 Alright, thanks for letting us know that there's still some help needed. A team member will reply to you shortly. In the meantime, please let us know any additional info, questions, or which parts of the answer may need clarification.
Nurul
Nurul•2mo ago
I haven't personally tried it yet. Did you try to do it?
Prydar
PrydarOP•2mo ago
node-mssql works if you turn off encryption. haven't added prisma on yet, but i don't see why it wouldn't work if node-mssql works

Did you find this page helpful?