Minato is a type-driven database framework for JavaScript and TypeScript, designed to provide a unified API across various database backends. It supports a wide range of drivers including Memory, MongoDB, MySQL, PostgreSQL, and SQLite, allowing developers to switch databases with minimal code changes. Written entirely in TypeScript, Minato offers comprehensive type safety for schema definitions and queries, aiming to eliminate common database-related errors at compile time. It distinguishes itself by providing a powerful, extensible, and modern ORM experience that can handle complex SQL operations through a JavaScript API. Currently at version 4.0.1, Minato maintains an active, demand-driven release cadence, focusing on compatibility, performance, and a consistent developer experience across diverse data stores. Its tight integration capabilities with the Cordis framework make it particularly suitable for modular and extensible application architectures.
npm install minatoVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize Minato, define a type-safe schema, connect to a MySQL database using a separate driver, and perform common CRUD (Create, Read, Update, Delete) operations.
Consult the official Minato v4 release notes and documentation for specific migration instructions. Update method calls and schema definitions accordingly.
Ensure you install the correct driver package using `npm install @minatojs/driver-<database-name>` in addition to `minato` itself.
Utilize Minato's query builder features, population options, and careful schema design to minimize the number of database queries. Profile your application's database interactions in development.
Double-check your `database.extend` calls for accurate type mappings. Utilize IDE features for type hints and ensure your TypeScript configuration (`tsconfig.json`) is correctly set up for the project.
Install `cordis` in your project: `npm install cordis`. Ensure its version is compatible with the `cordis` peer dependency range specified by Minato.
Install the required driver: `npm install @minatojs/driver-mysql` (replace `mysql` with your database).
Change your import statement from `import { Database } from 'minato'` to `import Database from 'minato'`.Ensure your database server is running and accessible from your application's environment. Check database user permissions and connection string details. For local development, verify Docker containers are running or local services are active.
Pass the appropriate imported driver to the `connect` method: `await database.connect(MySQLDriver, config)`.