-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
65 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,65 @@ | ||
# KVStorage | ||
# KVStorage | ||
[![](https://jitpack.io/v/Reone/KVStorage.svg)](https://jitpack.io/#Reone/KVStorage) | ||
|
||
a simple easy NoSQL database | ||
|
||
* 一个简单的容易使用的数据库 | ||
* 非关系型Key-value数据库 | ||
* 底层使用sqlite实现 | ||
|
||
|
||
## 引用,添加依赖 | ||
``` | ||
allprojects { | ||
repositories { | ||
... | ||
maven { url 'https://jitpack.io' } | ||
} | ||
} | ||
dependencies { | ||
implementation 'com.github.Reone:KVStorage:v.1.0.1' | ||
} | ||
``` | ||
|
||
## 使用方式 | ||
> 详细的使用可以查看[SimpleActivity](https://github.com/Reone/KVStorage/blob/master/app/src/main/java/com/reone/kvstorage/SimpleActivity.java) | ||
- 在Application中初始化 | ||
```java | ||
KVStorage.init(context); | ||
``` | ||
|
||
- 保存 | ||
```java | ||
KVStorage.rxSave(demoKey, demoValue).subscribe(); | ||
``` | ||
|
||
- 查找 | ||
```java | ||
KVStorage.rxGet(demoKey) | ||
.subscribe(new AsyncObserver<String>() { | ||
@Override | ||
public void onSuccess(String result) { | ||
|
||
} | ||
|
||
@Override | ||
public void onError(Throwable e) { | ||
|
||
} | ||
}); | ||
``` | ||
- 删除 | ||
```java | ||
KVStorage.rxRemove(demoKey1...).subscribe(); | ||
``` | ||
##功能接口 | ||
- 异步保存 | ||
- 同步保存 | ||
- 异步获取 | ||
- 异步删除 | ||
- 获取所有key | ||
- 清除所有key | ||
- 合并保存json | ||
- 待开发... |