1.0.6 • Published 6 years ago

yf-jsql v1.0.6

Weekly downloads
5
License
ISC
Repository
github
Last release
6 years ago

yf-jsql

A simple sql queries translation to javascript

Install

$ npm install yf-jssql

Setting up our database

The first thing we need to do is setup a database.

const Jsql = require('yf-jssql');

let jsql = new Jsql({
  port: 3000,
  database: {
    DATABASE: 'hospital',
    USERNAME: 'root',
    PASSWORD: 'fly',
    PORT: '3306',
    HOST: 'localhost'
  }
});

async function excute() {
  let data = await jsql.select('article', {id: 2}, ['id']).page(5, 0);
  console.log(data);
  data = await jsql.one('article', {id: 2}, ['id', 'title', 'description', 'content', 'create_time']);
  console.log(data);
}

excute();
1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago