simple-jsonsql
v1.2.0
Published
Non SQL DB using JSON
Downloads
25
Maintainers
Readme
simple-jsonsql
How to install
npm i simple-jsonsql
How to Use
const nosqlJson = require('simple-jsonsql)
const nosql = new nosqlJson()
Create DataBase
nosql.createDB(() => {
console.log('Created Database');
})
Create Table
nosql.createTable('user',(res) => {
res.created ? console.log('created table') :
console.error(res.error)
})
Insert row to table
nosql.insertInto('users', ['name', 'email', 'age'],
['arul', '[email protected]', 28], function (data) {
res.inserted ? console.log('created table') :
console.error(res.error)
})
Read table
Get all column data
-------------------
nosql.selectItem('users', '*', (data) => {
console.log(JSON.stringify(data))
});
Get all specific column data
-----------------------------
nosql.selectItem('users', ['age', 'emails'], (data) => {
console.log(JSON.stringify(data))
});