This package has been deprecated

Author message:

not

easysqlite

1.3.3 • Public • Published

A simple SQLITE/SQLITE3 Wrapper for People who are new To Coding and maybe Experienced ones to make SQLITE Easier and to Handle Databases Easier!

NPM

Usage

Note: The module must be Installed first, before use.

Parameter Type Optional Default Description
options Object none Options for the Database Name and File Name
options.name String 'database' Sets the Database Name and File Name
options.arrname String 'database_array' Sets the Database Array Name and Array File Name
options.objname String 'database_object' Sets the Database Object Name and Object File Name

open

const EasySqlite = require('easysqlite'); // Require the Package
const db = new EasySqlite(); // Make a new Constructor with options
        
db.open('1234567890').then(i => { // Gets the Information on the Database of ID: 1234567890
    console.log(i); // Returns { id: '1234567890', value: 0, text: '' }
});

Returns Promise<Object>

updateText

const EasySqlite = require('easysqlite'); // Require the Package
const db = new EasySqlite(); // Make a new Constructor with options
        
db.updateText('1234567890', 'Hello!').then(i => { // Updates the text of id: 1234567890
    console.log(i); // Returns { id: '1234567890', value: 0, text: 'Hello!' }
}); 

Returns Promise<Object>

updateValue

const EasySqlite = require('easysqlite'); // Require the Package
const db = new EasySqlite(); // Make a new Constructor with options
        
db.updateValue('1234567890', 20).then(i => { // Adds 20 to the Value of id: 1234567890
    console.log(i); // Returns { id: '1234567890', value: 20, text: ' }
}); 

Returns Promise<Object>

fetchArray

const EasySqlite = require('easysqlite'); // Require the Package
const db = new EasySqlite(); // Make a new Constructor with options
 
db.fetchArray('1234567890').then(i => { // Fetches the Array of ID: '1234567890'
    console.log(i); // Returns an Empty Array []
});

Returns Promise<Array>

setArray

const EasySqlite = require('easysqlite'); // Require the Package
const db = new EasySqlite(); // Make a new Constructor with options
 
db.setArray('1234567890', ['Hello', 'Hi!']).then(i => { // Adds the Array to the ID: 1234567890
    console.log(i); // Returns the Array ['Hello', 'Hi!']
 
    // Take Note: If there is an item in the elements, ( e.g 3rd element has 'XD' ) it will replace it
});

Returns Promise<Array>

fetchObject

const EasySqlite = require('easysqlite'); // Require the Package
const db = new EasySqlite(); // Make a new Constructor with options
 
db.fetchObject('12345').then(i => {
    console.log(i); // Returns: { id: '12345', obj: {} }
});

Returns Promise<Object>

setObject

const EasySqlite = require('easysqlite'); // Require the Package
const db = new EasySqlite(); // Make a new Constructor with options
 
db.setObject('12345', { a_key: 'a_value' }).then(i => {
    console.log(i); // Returns: { id: '12345', obj: { a_key: 'a_value' } }
});

Returns Promise<Object>

What's New in 1.3.3?

  • We have added a workaround for the manual JSON.parse() at your code
  • Instead of null on empty object at fetchObject() it will just return an empty object
  • Fixed where, when you add the File Name options, it doesn't set it
  • New Owner, kevlarfromdiscord

Have any Problems?

Join Here for us to resolve your Problems!

Package Sidebar

Install

npm i easysqlite

Weekly Downloads

1

Version

1.3.3

License

Apache-2.0

Unpacked Size

20.3 kB

Total Files

4

Last publish

Collaborators

  • kevlarfromdiscord