CL ORM is a lightweight ORM for Cloudflare Workers, supporting both D1 and Durable Objects SQL Storage. Version 2.1.3 is the latest stable release, with a rapid release cadence. It provides a unified Connection interface across different database drivers, automatic prepared statements, and user-friendly query building with operators like eq, ne, gt, lt, gte, lte. It is designed to be intuitive and productive, focusing on essential functionality without the overhead of larger ORMs like Prisma or Drizzle.
npm install cl-ormNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to connect to D1, create a table, insert a row, and select using an operator in a Cloudflare Worker.
Use ES module imports. For CommonJS projects, consider dynamic import or upgrade to ESM.
Always create connections via useD1(env.DB) or useDO(this.ctx.storage.sql).
When using limit: 1, handle single object result. For arrays, omit limit or use limit > 1.
Use OP.eq(), OP.ne(), etc. instead of importing eq, ne separately.
Ensure env is passed correctly and bindings are configured in wrangler.toml.
Call useDO only inside a Durable Object class method, passing this.ctx.storage.sql.
Use import type { Connection } from 'cl-orm' or ensure your project is ESM.No dependency data recorded yet.