Database Example
Demonstrates database integration using @venturekit/data.
Source: examples/database/
Key Concepts Demonstrated
Section titled “Key Concepts Demonstrated”- Database intent — declarative PostgreSQL provisioning
- Drizzle schema — type-safe schema definitions
- Migrations — generate and apply via
vk migrate - Query utilities —
query(),mapResults() - Transactions —
withTransaction(), transactional handlers - Intent outputs — accessing database endpoint from
ctx.intentOutputs
Infrastructure
Section titled “Infrastructure”infrastructure: { databases: [{ id: 'main', type: 'postgres', size: 'small', name: 'app', backups: true, encrypted: true, }],}Run It
Section titled “Run It”cd examples/databasenpm installvk migrate generatevk migrate upvk dev