Description
The `pipeline.config.json` has `softDeleteDefault: true`, but there's no middleware or query filter implementation for soft deletes. Add a Drizzle query filter and middleware that automatically handles soft delete logic.
Why
Soft deletes are enabled by default in the pipeline config, but the generated code doesn't implement the pattern. This gap means users get a `deleted_at` column but still need to manually filter deleted records in every query.
Current State
`pipeline.config.json`:
```json
"database": {
"softDeleteDefault": true
}
```
No corresponding implementation exists in templates or skills.
Acceptance Criteria
Implementation
```typescript
// Soft delete helper
export async function softDelete(db: Database, table: Table, id: string) {
return db.update(table).set({ deletedAt: new Date() }).where(eq(table.id, id));
}
// Query filter
export function notDeleted<T extends { deletedAt: Column }>(table: T) {
return isNull(table.deletedAt);
}
```
Description
The `pipeline.config.json` has `softDeleteDefault: true`, but there's no middleware or query filter implementation for soft deletes. Add a Drizzle query filter and middleware that automatically handles soft delete logic.
Why
Soft deletes are enabled by default in the pipeline config, but the generated code doesn't implement the pattern. This gap means users get a `deleted_at` column but still need to manually filter deleted records in every query.
Current State
`pipeline.config.json`:
```json
"database": {
"softDeleteDefault": true
}
```
No corresponding implementation exists in templates or skills.
Acceptance Criteria
Implementation
```typescript
// Soft delete helper
export async function softDelete(db: Database, table: Table, id: string) {
return db.update(table).set({ deletedAt: new Date() }).where(eq(table.id, id));
}
// Query filter
export function notDeleted<T extends { deletedAt: Column }>(table: T) {
return isNull(table.deletedAt);
}
```