-
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Miguel Guevara edited this page Jan 9, 2026
·
2 revisions
Modern decorator-first ORM for AWS DynamoDB TypeScript decorators | Type-safe relationships | Automatic table sync | Minimal boilerplate
- Decorator-first design - Define models with TypeScript decorators
- Type-safe relationships - HasMany, BelongsTo, ManyToMany with full typing
- Automatic table sync - Tables and indexes created automatically
- Validation & transformation - Built-in decorators for data processing
- Soft deletes - @DeleteAt decorator for recoverable records
- Transactions - Full transaction support with rollback
import { Dynamite, Table, PrimaryKey, Default, CreatedAt } from '@arcaelas/dynamite';
// Define your model
class User extends Table<User> {
@PrimaryKey()
@Default(() => crypto.randomUUID())
declare id: string;
declare name: string;
declare email: string;
@CreatedAt()
declare created_at: string;
}
// Configure and connect
const dynamite = new Dynamite({
region: 'us-east-1',
tables: [User]
});
await dynamite.connect();
// Create
const user = await User.create({
name: 'John Doe',
email: 'john@example.com'
});
// Query
const users = await User.where('name', 'John Doe');
// Update
user.email = 'newemail@example.com';
await user.save();
// Delete
await user.destroy();| Decorator | Description |
|---|---|
@PrimaryKey() |
Partition key |
@Index() |
Global Secondary Index |
@Default(value) |
Default value (static or function) |
@Validate(fn) |
Validation on set |
@Mutate(fn) |
Transform on set |
@CreatedAt() |
Auto-set on create |
@UpdatedAt() |
Auto-set on update |
@DeleteAt() |
Soft delete timestamp |
@HasMany() |
One-to-many relationship |
@HasOne() |
One-to-one relationship |
@BelongsTo() |
Many-to-one relationship |
@ManyToMany() |
Many-to-many with pivot table |
- Installation - Complete installation and setup guide
- Getting Started - Step-by-step tutorial for beginners
- Decorators - Comprehensive decorator reference
- Relationships - Define and query relationships
- TypeScript Types - Type-safe development guide
- Transactions - Working with transactions
- Soft Deletes - Recoverable record deletion
- Basic CRUD - Create, read, update, delete operations
- Advanced Queries - Complex filtering and pagination
- Relations Example - Real-world relationship patterns
- Validation - Custom validators and transformations
- Table API - Static and instance methods
- Query Options - Filtering and query parameters
- Configuration - Dynamite configuration options
class User extends Table<User> {
@PrimaryKey()
declare id: string;
@HasMany(() => Post, 'user_id')
declare posts: NonAttribute<Post[]>;
}
class Post extends Table<Post> {
@PrimaryKey()
declare id: string;
declare user_id: string;
@BelongsTo(() => User, 'user_id')
declare user: NonAttribute<User | null>;
}
// Load with relations
const user = await User.first({ id: '123' }, { include: { posts: true } });
console.log(user.posts); // Post[]npm install @arcaelas/dynamite
# Peer dependencies
npm install @aws-sdk/client-dynamodb @aws-sdk/lib-dynamodbFor detailed setup instructions, see Installation.
- π¦ NPM: @arcaelas/dynamite
- π Documentation: https://arcaelas.github.io/dynamite/
- π Issues: GitHub Issues
- π¬ Discussions: GitHub Discussions
Developed by Arcaelas Insiders