MiniORM

v1.0.0
TypeScript
MIT License

Lightweight TypeScript ORM for Efficient Database Operations

99% Type Safe
Minimal Overhead
Intuitive API

Why Choose MiniORM?

Lightweight

Minimal footprint with maximum performance for your database operations

🎯

Type Safety

Full TypeScript support with strong typing for all database interactions

🔌

Easy Integration

Simple setup with intuitive query builder and model system

Simple & Powerful API

Connection.ts
import { MiniOrm } from 'miniorm'

MiniOrm.connection('mysql_test', {
	type: 'mysql',
	host: 'localhost',
	user: 'root',
	password: '',
	database: 'serverDB'
})
QueryBuilder.ts
import { QueryBuilder } from 'miniorm'

class Users {
    id!: number | string
    name!: string
    email!: string
    role!: 'user' | 'admin'
    isAdmin!: boolean
}

const query = new QueryBuilder('mysql_test', Users)
UserModel.ts
import { QueryBuilder } from 'miniorm'

class Users {
    id!: number | string
    name!: string
    email!: string
    role!: 'user' | 'admin'
    isAdmin!: boolean
}

(async () => {
	const query = new QueryBuilder('mysql_test', Users)
	await query.select().run()
    await query.select().where({name: 'signor_p'}).run()
    await query.select().where({ 'email LIKE': 'signor_p%' }).run()
    await query.select(['name', 'role', 'email']).where({'id <': 5, isAdmin: true}).run()
    await query.select(['name', 'role', 'isAdmin']).where({'id <': 5}).order(['id'], 'ASC').run()
    await query.select(['name', 'role']).where({'id >=': 5, isAdmin: true}).order(['id'], 'ASC').limit(10).run()
})()