Claude Skills
CollectionsCompareWorkflowsNominate
Sign inSign up
© 2026 Curated Agent Skills·Learn more about Agent Skills
Back to repository

typeorm-queries

verified

TypeORM query patterns

View on GitHub

Marketplace

alphaagent-team

the-answerai/alphaagent-team

Plugin

aai-stack-typeorm

stack

Repository

the-answerai/alphaagent-team

plugins/aai-stack-typeorm/skills/typeorm-queries/SKILL.md

Last Verified

February 1, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/the-answerai/alphaagent-team/blob/main/plugins/aai-stack-typeorm/skills/typeorm-queries/SKILL.md -a claude-code --skill typeorm-queries

Installation paths:

Claude
.claude/skills/typeorm-queries/
Powered by add-skill CLI

Instructions

# TypeORM Queries Skill

Patterns for querying data with TypeORM.

## Repository Pattern

### Basic CRUD

```typescript
import { Repository } from 'typeorm'
import { AppDataSource } from './data-source'
import { User } from './entities/User'

const userRepository: Repository<User> = AppDataSource.getRepository(User)

// Create
const user = userRepository.create({
  email: 'john@example.com',
  name: 'John',
})
await userRepository.save(user)

// Or create and save
const user = await userRepository.save({
  email: 'john@example.com',
  name: 'John',
})

// Find one
const user = await userRepository.findOne({
  where: { id: '123' },
})

const user = await userRepository.findOneBy({ email: 'john@example.com' })

const user = await userRepository.findOneOrFail({
  where: { id: '123' },
})

// Find many
const users = await userRepository.find()

const users = await userRepository.find({
  where: { active: true },
  order: { createdAt: 'DESC' },
  take: 10,
  skip: 0,
})

// Update
await userRepository.update({ id: '123' }, { name: 'John Doe' })

// Or find and save
const user = await userRepository.findOneBy({ id: '123' })
user.name = 'John Doe'
await userRepository.save(user)

// Delete
await userRepository.delete({ id: '123' })

// Soft delete (requires @DeleteDateColumn)
await userRepository.softDelete({ id: '123' })
await userRepository.restore({ id: '123' })
```

### Advanced Find Options

```typescript
const users = await userRepository.find({
  // Select specific columns
  select: ['id', 'email', 'name'],

  // Where conditions
  where: {
    active: true,
    role: 'admin',
  },

  // Or conditions
  where: [
    { role: 'admin' },
    { role: 'moderator' },
  ],

  // Relations
  relations: ['profile', 'posts'],

  // Order
  order: {
    createdAt: 'DESC',
    name: 'ASC',
  },

  // Pagination
  take: 10,
  skip: 20,

  // Include soft-deleted
  withDeleted: true,

  // Cache
  cache: true,
  // or
  cache: {
    id: 'users_active',
    milliseconds: 60000,
  

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
6852 chars