1.1.3 • Published 5 years ago
localedb v1.1.3
LocaleDb
LocaleDb can Convert Your Locale Project Storage Into a Database
Installation
npm install localedbImportation
let localeDb = require("localedb");Usage
Most of Functions are Promised Based So be aware to use it outside of async Functions.
Creating Database
let conn = await localeDb.createDB("MyDatabase");localeDb.createDB(dbName)Creates Database In our Project Folder.dbNametakes String of Database Name You want to Create.- Returns Connections Object.
Connection to Already Created Database
let conn = await localeDb.ConnectDb("MyDatabase");localeDb.ConnectDb(dbName)Connect to the Database.dbNametakes String of Database Name You want to Connect.- Returns Conection Object.
Deleting Database
await localeDb.deleteDB("MyDatabase");localeDb.deleteDB(dbName)Delete The Database.- Returns
LocaleDBPromiseDefaultResponse
Checking If Database Exists
await localeDb.isDBExists("MyDatabase");localeDb.isDBExists(dbName)Checks if Database Exists or Not.- Returns
boolean.
Db Connection Object
Db Connection Object Can Be Accessed by localeDb.ConnectDb(dbName).
let conn = await localeDb.Connect(dbName);- Returns
Db Connection Object
Usage
Getting Database Info
await conn.getDbInfo();- Returns
JSONObject Containing Database Information.
Creating Stage
await conn.createStage(stageName);- Takes
stageNameargument as the Name of the Stage Inside The Database. - Returns
Stage Connection Object.
Connecting To Stage
let stage = await conn.ConnectStage(stageName);- Creates Stage if Does not Exists.
- Returns
Stage Connection Object.
Checking If Stage Exists
await conn.isStageExists(stageName);- Returns
boolean.
Deleting Stage
await conn.deleteStage(stageName)- Returns
LocaleDBPromiseDefaultResponse.
Stage Connection Object
Stage Connection Object Can Be Accessed by conn.ConnectStage(stageName).
let stage = await conn.ConnectStage(stageName);- Returns
Stage Connection Object
Usage
Getting Parent Db Info
await stage.getDbInfo();- Returns
JSONObject Containing Database Info.
Getting Stage Info
await stage.getStageInfo();- Returns
JSONObject Containing Stage Info.
Adding Data To Stage
await stage.addData(data);- Takes
JSONObject. - Automatically Add
dataIdKey If Not Provided to Given Data and Value Will be Unique. - Returns
LocaleDBPromiseDefaultResponseObject.
Getting All Data From Stage
await stage.getAllData();- Returns
LocaleDBPromiseDefaultResponseContainingresultArray Of Data.
Getting Data Using dataId
await stage.getDataById(dataId);- Takes
dataIdas the Unique Key Generated/Provided While Adding Data. - Returns Single Object Or Array Of Object Containing Provided
dataId.
Deleting Data By Id
await stage.deleteDataById(dataId);- Returns Arrary Of Deleted Data.
Clearing All Data From Stage
await stage.clear();- Returns
LocaleDBPromiseDefaultResponseObject.
Updating Data Using dataId
await stage.updateDataById(dataId, data);- Takes Second Argument As the Data You Want to Update.
- Returns
LocaleDBPromiseDefaultResponseObject ContainingupdatedArray InsideresultObject.
Updating Data Using Keys
await stage.updateData(compareData, updateData);- Takes
compareDataAs the Keys You Want to Compare with All Data - If
datamatchescompareData's Keys and it Values, The Keys ofdataWill be Updated/Added todataCorresponding to the Keys ofupdateData.
1.1.1
5 years ago
1.0.19
5 years ago
1.1.0
5 years ago
1.0.18
5 years ago
1.0.17
5 years ago
1.0.16
5 years ago
1.0.9
5 years ago
1.0.8
5 years ago
1.0.7
5 years ago
1.0.6
5 years ago
1.0.5
5 years ago
1.1.3
5 years ago
1.0.4
5 years ago
1.1.2
5 years ago
1.0.3
5 years ago
1.0.22
5 years ago
1.0.21
5 years ago
1.0.20
5 years ago
1.0.24
5 years ago
1.0.23
5 years ago
1.0.11
5 years ago
1.0.10
5 years ago
1.0.15
5 years ago
1.0.14
5 years ago
1.0.13
5 years ago
1.0.12
5 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago