fib-orm
v2.0.0
Published
ORM for fibjs - unified package
Downloads
207
Readme
fib-orm
ORM for fibjs — a unified ORM package supporting SQLite, MySQL, and PostgreSQL.
Install
npm install fib-ormQuick Start
const ORM = require('fib-orm');
const db = ORM.connectSync('sqlite:test.db');
const User = db.define('user', {
name: String,
age: Number
});
db.syncSync();
User.createSync({ name: 'Alice', age: 30 });
const users = User.findSync();
console.log(users);
db.closeSync();Build
npm run buildTest
# SQLite
ORM_PROTOCOL=sqlite fibjs test
# MySQL
ORM_PROTOCOL=mysql fibjs test
# PostgreSQL
ORM_PROTOCOL=postgres fibjs testLicense
MIT
