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.
Page Hero Image

How It Works

  1. Define your schema in Datasquirel with the fields, types, and constraints your app needs
  2. Install the npm package @moduletrace/datasquirel in your project
  3. Pull your schema into code so TypeScript interfaces are generated from the live database structure
  4. 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

  1. TypeScript projects: Catch schema mismatches while coding instead of discovering them from bad data in production
  2. Full-stack type safety: Share one set of database-derived types across frontend and backend
  3. Safe refactoring: Let the compiler point out code paths affected by renamed fields or type changes
  4. Team onboarding: Help new developers read the data model through generated types instead of reverse-engineering the database manually

Ready to take control of your data?

Create a free account and start managing your databases in minutes, or deploy Datasquirel on your own infrastructure using the self-hosted community edition.