Skip to content

AlexAnimateMp4/easy-better-sqlite3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Easy better-sqlite3

The easier and safer better-sqlite3 package.

NPM Package Last commit Release date NPM Package download by week NPM Package download by month NPM Package download total Downloads Downloads@latest NPM Package collaborators Contributors Vulnerabilities Open issues Closed issues Open pull requests Closed pull requests Commit activity by week Commit activity by month Version Main file Languages Top language License Code size Repo size Watchers Stars Forks

Installation

$ npm i easy-better-sqlite3
const easy_better_sqlite3 = require(`easy-better-sqlite3`);

(OPTIONS, CALLBACK) ⇒ Object

The easier and safer better-sqlite3 package.

Param Type Description
OPTIONS Object The options of better-sqlite3.
OPTIONS.PATH String The name of the database file.
OPTIONS.UNSAFE_PATH Boolean Whether or not to set the database path to the current path.
CALLBACK function The callback function.

.TABLE.ALL(CALLBACK) ⇒ Object

Retrieves all tables from the database.

Param Type Description
CALLBACK function The callback function.

.TABLE.HAS(ID, CALLBACK) ⇒ Boolean

Checks whether the given table exists or not.

Param Type Description
ID String The table id.
CALLBACK function The callback function.

.TABLE.IS_READ_ONLY(ID, CALLBACK) ⇒ Boolean

Indicates whether the table is read-only or not.

Param Type Description
ID String The table id.
CALLBACK function The callback function.

.TABLE.GET(ID, CALLBACK) ⇒ Object

Retrieves values from the given table.

Param Type Description
ID String The table id.
CALLBACK function The callback function.

.TABLE.SET(DATA, CALLBACK) ⇒ Boolean

Create a table if it does not exist.

Param Type Description
DATA Object
DATA.ID String The table id.
DATA.READ_ONLY Boolean Sets the table read-only or not.
CALLBACK function The callback function.

.TABLE.DEL(ID, CALLBACK) ⇒ Boolean

Delete a table.

Param Type Description
ID String The table id.
CALLBACK function The callback function.

.ALL(TABLE, CALLBACK) ⇒ Object

Retrieves values from the given table.

Param Type Description
TABLE String The table id.
CALLBACK function The callback function.

.HAS(DATA, CALLBACK) ⇒ Boolean

Checks whether the given id exists or not.

Param Type Description
DATA Object
DATA.TABLE String The table id.
DATA.ID String The id.
CALLBACK function The callback function.

.IS_READ_ONLY(DATA, CALLBACK) ⇒ Boolean

Indicates whether the id is read-only or not.

Param Type Description
DATA Object
DATA.TABLE String The table id.
DATA.ID String The id.
CALLBACK function The callback function.

.GET(DATA, CALLBACK) ⇒ any

Retrieves the id of a given table.

Param Type Description
DATA Object
DATA.TABLE String The table id.
DATA.ID String The id.
CALLBACK function The callback function.

.SET(DATA, CALLBACK) ⇒ any

Create or modify an id.

Param Type Description
DATA Object
DATA.TABLE String The table id.
DATA.ID String The id.
DATA.VALUE any The value of the id.
DATA.READ_ONLY Boolean Sets the id as read-only or not.
CALLBACK function The callback function.

.DEL(DATA, CALLBACK) ⇒ Boolean

Delete an id.

Param Type Description
DATA Object
DATA.TABLE String The table id.
DATA.ID String The id.
CALLBACK function The callback function.