Drift KV Documentation
Welcome to Drift KV! Drift KV is a powerful, flexible, and type-safe ORM designed to simplify database interactions and provide a seamless developer experience.
Introduction
Drift KV is a robust Object Relational Mapper (ORM) for modern JavaScript and TypeScript projects. Built to support Deno, Node, and Bun environments, Drift KV helps developers interact with databases efficiently, while maintaining type safety and a rich set of features, including real-time subscriptions, job queues, and type-safe queries.
Drift KV aims to provide an intuitive API, inspired by Prisma and other modern ORMs, but designed to maximize flexibility and performance.
Getting Started
To get started with Drift KV, follow these steps:
- Install Drift KV from npm or deno.land.
- Create and configure your database connections.
- Define entities and use the powerful CRUD API to interact with your database.
Detailed guides are available in the Getting Started Guide.
Features
- Type-Safe QueriesDrift KV provides full type safety, ensuring consistent data interactions.
- Real-Time SubscriptionsSubscribe to data changes and react in real-time.
- Job QueuesBuilt-in support for background processing.
Installation
Node.js
Install Drift KV using npm:
npm install @drift-kv/core
Deno
Import Drift KV directly from deno.land:
deno add jsr:@drift-kv/core;
Basic Usage
Here is an example of how to set up Drift KV:
import { Drift } from "drift-kv";
// Initialize the database client
const client = Deno.openKv();
// Set up Drift KV instance
const drift = new Drift({
client,
schemas: {
entities: {
user: {
name: "user",
schema: (z) => ({
id: z.string().uuid(),
name: z.string().min(3).max(100),
email: z.string().email(),
}),
},
},
},
});
// Use CRUD operations
await drift.entities.user.create({
data: {
id: "123",
name: "Felipe",
email: "felipe@example.com",
},
});
For more usage examples, visit the Basic Usage Guide.
Documentation
For complete documentation, visit the Documentation folder.
Community and Contributing
We welcome contributions from the community. For details on how to contribute, please check out our Contributing Guide.
Reporting Issues
If you encounter issues or bugs, please open an issue.
Join the Community
- Follow me on X: @feldbarcelospro
- Join us on GitHub Discussions: Drift Community
- Project Link: https://github.com/felipebarcelospro/drift-kv
License
Drift KV is open-source software, licensed under the MIT License.
Discover Drift KV: The Ultimate Type-Safe ORM for Deno KV
Experience a powerful ORM with real-time subscriptions, job queues, and seamless compatibility across Deno KV, Node.js, Bun.js, and Edge environments.