basic-sql-query-builder-orm-framework
v1.0.3
Published
A basic SQL Query Builder ORM Framework.
Downloads
7
Readme
basic-sql-query-builder-orm-framework
A basic SQL Query Builder ORM Framework.
Installation
npm install --save basic-sql-query-builder-orm-framework
Usage
const { Select, Insert, Update, Delete } = require("basic-sql-query-builder-orm-framework");
console.log(
Select.create()
.table("Usuario")
.where([
["id", "=", 1],
["id", "!=", 2]
])
.orderBy([["id","DESC"],["name", "ASC"]])
.page(1)
.items(20)
.toString()
);
console.log(
Insert.create()
.table("Usuario")
.columns(["name", "password", "email"])
.values({ name: "admin", password: "admin", email: "[email protected]" })
.toString()
);
console.log(
Update.create()
.table("Usuario")
.values({ name: "admin", password: "admin", email: "[email protected]" })
.where([[ "id", "=", 8 ]])
.toString()
);
console.log(
Delete.create()
.table("Usuario")
.where([
["id", "=", 3]
])
.toString()
);
Simple.