Type Safety
The @moduletrace/datasquirel package turns your live schema into TypeScript types, so the shape of your data stays consistent from the database to the API layer and the frontend.


How It Works
- Define your schema in Datasquirel with the fields, types, and constraints your app needs
- Install the npm package
@moduletrace/datasquirelin your project - Pull your schema into code so TypeScript interfaces are generated from the live database structure
- Use the generated types everywhere and let TypeScript surface mismatches before they turn into runtime bugs
Key Features
Auto-Generated TypeScript Types
Datasquirel generates types from the schema you are already maintaining, so table interfaces stay aligned with the real database without duplicate hand-written models.SDK with Full TypeScript Support
The @moduletrace/datasquirel package ships with first-class TypeScript support, so API calls for data, auth, and media all return shapes your editor can understand immediately.Schema-Driven Validation
Your schema stays the source of truth. The same field definitions that create the database also inform the generated types, which reduces drift between storage and application code.Shared Frontend and Backend Types
Import the same generated types on the server and in the client. When the schema changes, TypeScript helps you find everywhere that needs attention during the next build instead of after release.Use Cases
- TypeScript projects: Catch schema mismatches while coding instead of discovering them from bad data in production
- Full-stack type safety: Share one set of database-derived types across frontend and backend
- Safe refactoring: Let the compiler point out code paths affected by renamed fields or type changes
- Team onboarding: Help new developers read the data model through generated types instead of reverse-engineering the database manually