Skip to content

Getting Started

D1-ORM is a library for Cloudflare's D1 Database product.


  • Dependency-free
  • Strictly typed, see TypeScript hints for your tables in your editor of choice
  • Object oriented - use classes to interact with your items
  • No SQL knowledge required


Use your preferred package manager to install the library, for example NPM.

npm install d1-orm
yarn add d1-orm
pnpm add d1-orm


Refer to the following guides for using the library.

  • Models - The simpler, recommended interface to querying with advantages such as automatically-generated types based on your table structure
  • Query Building - Advanced usage, not specific to D1
  • Upserting - What is it? How does it work?

API Reference

Refer to the Typedoc site

Last update: September 9, 2023
Created: September 9, 2023