$ npm i easy-better-sqlite3
const easy_better_sqlite3 = require(`easy-better-sqlite3`);
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. |
Retrieves all tables from the database.
Param | Type | Description |
---|---|---|
CALLBACK | function |
The callback function. |
Checks whether the given table exists or not.
Param | Type | Description |
---|---|---|
ID | String |
The table id. |
CALLBACK | function |
The callback function. |
Indicates whether the table is read-only or not.
Param | Type | Description |
---|---|---|
ID | String |
The table id. |
CALLBACK | function |
The callback function. |
Retrieves values from the given table.
Param | Type | Description |
---|---|---|
ID | String |
The table id. |
CALLBACK | function |
The callback function. |
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. |
Delete a table.
Param | Type | Description |
---|---|---|
ID | String |
The table id. |
CALLBACK | function |
The callback function. |
Retrieves values from the given table.
Param | Type | Description |
---|---|---|
TABLE | String |
The table id. |
CALLBACK | function |
The callback function. |
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. |
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. |
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. |
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. |