Skip to content

cordiverse/minato

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6a8f29c · Mar 20, 2025
Nov 7, 2024
Dec 16, 2023
Mar 20, 2025
Apr 20, 2022
Jul 29, 2023
Dec 16, 2023
Oct 30, 2022
Dec 16, 2023
Feb 7, 2024
Dec 16, 2023
Apr 20, 2022
Mar 20, 2025
Feb 7, 2024
Mar 20, 2025
Feb 7, 2024
Aug 22, 2024

Repository files navigation

minato

Codecov downloads npm GitHub

Type Driven Database Framework.

Features

  • Compatibility. Complete driver-independent. Supports many drivers with a unified API.
  • Powerful. It can do everything that SQL can do, even though you are not using SQL drivers.
  • Well-typed. Minato is written with TypeScript, and it provides top-level typing support.
  • Extensible. Simultaneous accesss to different databases based on your needs.
  • Modern. Perform all the operations with a JavaScript API or even in the browser with low code.

Driver Supports

Driver Version Notes
Memory npm In-memory driver support
MongoDB npm
MySQL npm MySQL 5.7+, MariaDB 10.5
PostgreSQL npm PostgreSQL 14+
SQLite npm

Basic Usage

import Database from 'minato'
import MySQLDriver from '@minatojs/driver-mysql'

const database = new Database()

await database.connect(MySQLDriver, {
  host: 'localhost',
  port: 3306,
  user: 'root',
  password: '',
  database: 'minato',
})

Data Definition

database.extend('user', {
  id: 'number',
  name: 'string',
  age: 'number',
  money: { type: 'number', initial: 100 },
}, {
  primary: 'id',
  autoInc: true,
})

Simple API

create

const user = await driver.create('user', {
  name: 'John',
  age: 20,
}) // { id: 1, name: 'John', age: 20, money: 100 }

get

remove

set

upsert

Selection API

Using TypeScript

Using Multiple Drivers

About

Type Driven Database Framework.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published