0.1.0 • Published 3 years ago
@keepzen/orm-for-sqlite3 v0.1.0
What is this package?
I use this package to learn ORM. So I create this one, it is a mini ORM. You can use this to operate sqlite tables.
How to use?
first install it
Use npm:
npm i @keepzen/orm-for-sqlite3
Use yarn
yarn add @keepzen/orm-for-sqlite3
Create your creat table sql script
- Create sqlite db file and Module class.
npx orm-sqlite3-cli db-path/db-name the-dir-you-want-module-to-keep the-sql-script-path
- Use the generate Code
const Customer = require('./Customer.table.js'); let a = Customer({Name:"Bob"}); async ()=>{ await a.add();//Insert customer whith Name -- bob a.Name = "Tom"; await a.update();//update await a.remove(); //delete await Customer.find({select:["ID","Name"],where:"ID != 0",orderBY:["ID"]});//[Customer] }