state-view-slice - Build State View Slices from Event Models
Creates read model projections that consume events and project them into queryable PostgreSQL database tables.
Tags
Updated: 2026-06-30Capabilities
What this skill does
- create projection handler file
- create database migration file
- create query API endpoint
- write projection tests
- register projection in event store
- generate slice JSON metadata
- perform upsert on conflict
- update database records
- delete database records
Inputs
- Event model definitions
- Event types
- PostgreSQL connection string
- Supabase client
- Slice configuration
Outputs
- Projection handler TypeScript files
- Database migration SQL files
- Query API route files
- Projection test files
- Slice JSON metadata file
- Queryable database tables
Requirements
- PostgreSQL database
- Node.js runtime
- Knex.js library
- @event-driven-io/emmett-postgresql package
- @testcontainers/postgresql for testing
- Flyway for database migrations
- Express.js for API routes
- Supabase client
- All database tables must include restaurant_id column
