1.4.1 • Published 1 year ago

ezito-entity v1.4.1

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

EzitoIR easy-sqlite

Installation

npm i easy-sqlite

Usage

const isFunction = requrie('ezito-utils/public/is/function');
const resolve = requrie('ezito-utils/server/fs/resolve');

const easy = require('easy-sqlite');
const sqlite3 = require('sqlite3').verbose();

const db = easy(new sqlite3.Database('./db.sqlite'));

async function init (){

    await db.createTable( "test" , {

        id : db.types.AUTO_KEY_NUMBER ,
        name : db.types.VALIDATOR( db.types.TEXT , function(val = ""){
            return val.length > 4
        }),
        time : db.types.AUTO_DATE,
    });

    var table = db.table("test");
    await table.add({ name : "namedd -" + Math.floor(100000 + Math.random() * 900000) }) ;
    table.add({ name : "namedd -" + Math.floor(100000 + Math.random() * 900000) },(err ,res)=>{

    }) ;
    
    table.find([],{}, async (er,res)=>{
        await table.change({name : "muhammad rasoul"}, { id : 1 });
        table.find([],{name:"muhammad rasoul"}, (er,res)=>{
            console.log(res)
        });
    });
}
 
init()
1.4.1

1 year ago

1.4.0

1 year ago

1.2.1

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago