1.0.5 • Published 3 years ago

ciqtek-db v1.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

ciqtek-db

一个基于indexDB的数据持久化解决方案。

安装

npm install ciqtek-db

or

yarn add ciqtek-store

使用

import DB from 'ciqtek-db'
const db = new DB({
  name: "baseSource",
  version: 1,
  storeName:"base"
})

API

/**
 * 创建数据库
 * @param {string| Array<string>} sourceName 资源名称
 */
addSource(sourceName: string | Array<string>)


/**
 * 更新字段
 * @param {string} currentSource 表字段
 * @param {string} key 数据key
 * @param {any} data 更新数据
 */ 
updateItem (currentSource: string, key: string,data:any)


/**
 * 数据get
 * @param {string} currentSource 表字段
 * @param {string} key 数据key
 * @returns {Promise} any 数据
 */ 
getItem(currentSource: string, key: string): Promise<any>


/**
 * 数据set
 * @param {string} currentSource 表字段
 * @param {string} key 数据key
 * @param {any} data 更新数据
 * @returns {Promise} any 数据
 */  
setItem(currentSource: string, key: string, value: any): Promise<any>


/**
 * 数据remove
 * @param {string} currentSource 表字段
 * @param {string} key 数据key
 * @returns {Promise} any 数据
 */  
removeItem(currentSource: string, key: string): Promise<any> 


/**
 * 清空数据
 */   
clearOrgin()
1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.0

3 years ago