Skip to content

Commit

Permalink
Update en and cn README.MD
Browse files Browse the repository at this point in the history
  • Loading branch information
artbits committed Apr 22, 2023
1 parent c71f2ce commit 71b5733
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 18 deletions.
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
[![](https://www.jitpack.io/v/artbits/quickio.svg)](https://www.jitpack.io/#artbits/quickio)
[![](https://img.shields.io/badge/JDK-%3E%3D%208-orange)](https://jdk.java.net/)
[![](https://img.shields.io/badge/license-Apache--2.0-blue)](#license)
[![](https://img.shields.io/badge/JDK-8%20%2B-%23DD964D)](https://jdk.java.net/)
[![](https://img.shields.io/badge/license-Apache--2.0-%234377BF)](#license)
[![](https://visitor-badge.glitch.me/badge?page_id=artbits.quickio&right_color=%23C482AA&left_text=views)](https://github.com/jwenjian/visitor-badge)

![](https://img.shields.io/github/repo-size/artbits/quickio)
![](https://img.shields.io/tokei/lines/github/artbits/quickio)

English | [中文](README_CN.md)


## QuickIO
QuickIO is a Java embedded database. The underlying layer is based on the ``LevelDB`` engine and Java NIO design, and uses ``Protostaff`` to serialize/deserialize data. Support the storage of **document, key-value and file** type data. Directly use Java code to operate the database, which is simple and efficient.
QuickIO is a Java embedded database. The underlying layer is based on the ``LevelDB`` engine and Java NIO design, and uses ``Protostaff`` to serialize/deserialize data. Support the storage of **document, key-value and file** type data. Directly using Java code to operate databases is simple, flexible, and efficient.


## Features
Expand All @@ -26,7 +30,7 @@ repositories {
}
dependencies {
implementation 'com.github.artbits:quickio:1.3.2'
implementation 'com.github.artbits:quickio:1.3.3'
}
```
Maven:
Expand All @@ -39,15 +43,15 @@ Maven:
<dependency>
<groupId>com.github.artbits</groupId>
<artifactId>quickio</artifactId>
<version>1.3.2</version>
<version>1.3.3</version>
</dependency>
```


## Usage
Store data of document type.
```java
try(DB db = QuickIO.usingDB("example_db")) {
try (DB db = QuickIO.usingDB("example_db")) {
Collection<Document> collection = db.collection(Document.class);

collection.save(new Document().put("city", "Canton").put("area", 7434.4));
Expand All @@ -71,7 +75,7 @@ public class Book extends IOEntity {
}


try(DB db = QuickIO.usingDB("example_db")) {
try (DB db = QuickIO.usingDB("example_db")) {
Collection<Book> collection = db.collection(Book.class);

collection.save(Book.of(b -> {
Expand All @@ -86,7 +90,7 @@ try(DB db = QuickIO.usingDB("example_db")) {
```
Store data of Key-Value type, and support any key and value that can be serialized and deserialized.
```java
try(KV kv = QuickIO.usingKV("example_kv")) {
try (KV kv = QuickIO.usingKV("example_kv")) {
kv.write("Pi", 3.14);
kv.write(3.14, "Pi");

Expand All @@ -97,7 +101,7 @@ try(KV kv = QuickIO.usingKV("example_kv")) {
```
Stores data for file types.
```java
try(Tin tin = QuickIO.usingTin("example_tin")) {
try (Tin tin = QuickIO.usingTin("example_tin")) {
tin.put("photo.png", new File("..."));

File file = tin.get("photo.png");
Expand Down
22 changes: 13 additions & 9 deletions README_CN.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
[![](https://www.jitpack.io/v/artbits/quickio.svg)](https://www.jitpack.io/#artbits/quickio)
[![](https://img.shields.io/badge/JDK-%3E%3D%208-orange)](https://jdk.java.net/)
[![](https://img.shields.io/badge/license-Apache--2.0-blue)](#license)
[![](https://img.shields.io/badge/JDK-8%20%2B-%23DD964D)](https://jdk.java.net/)
[![](https://img.shields.io/badge/license-Apache--2.0-%234377BF)](#license)
[![](https://visitor-badge.glitch.me/badge?page_id=artbits.quickio.cn&right_color=%23C482AA&left_text=views)](https://github.com/jwenjian/visitor-badge)

![](https://img.shields.io/github/repo-size/artbits/quickio)
![](https://img.shields.io/tokei/lines/github/artbits/quickio)

[English](README.md) | 中文


## QuickIO
QuickIO 是一个 Java 嵌入式数据库。底层基于 ``LevelDB`` 引擎和 Java NIO 设计,使用 ``Protostuff`` 序列化/反序列化数据。支持存储 **文档、key-value、文件** 类型的数据。直接使用 Java 代码操作数据库,简单高效
QuickIO 是一个 Java 嵌入式数据库。底层基于 ``LevelDB`` 引擎和 Java NIO 设计,使用 ``Protostuff`` 序列化/反序列化数据。支持存储 **文档、key-value、文件** 类型的数据。直接使用 Java 代码操作数据库,简单,灵活,高效


## 特性
Expand All @@ -26,7 +30,7 @@ repositories {
}
dependencies {
implementation 'com.github.artbits:quickio:1.3.2'
implementation 'com.github.artbits:quickio:1.3.3'
}
```
Maven:
Expand All @@ -39,15 +43,15 @@ Maven:
<dependency>
<groupId>com.github.artbits</groupId>
<artifactId>quickio</artifactId>
<version>1.3.2</version>
<version>1.3.3</version>
</dependency>
```


## 使用
存储文档类型的数据。
```java
try(DB db = QuickIO.usingDB("example_db")) {
try (DB db = QuickIO.usingDB("example_db")) {
Collection<Document> collection = db.collection(Document.class);

collection.save(new Document().put("city", "Canton").put("area", 7434.4));
Expand All @@ -71,7 +75,7 @@ public class Book extends IOEntity {
}


try(DB db = QuickIO.usingDB("example_db")) {
try (DB db = QuickIO.usingDB("example_db")) {
Collection<Book> collection = db.collection(Book.class);

collection.save(Book.of(b -> {
Expand All @@ -86,7 +90,7 @@ try(DB db = QuickIO.usingDB("example_db")) {
```
存储 Key-Value 类型的数据,支持任意可序列化和反序列化的 key 和 value。
```java
try(KV kv = QuickIO.usingKV("example_kv")) {
try (KV kv = QuickIO.usingKV("example_kv")) {
kv.write("Pi", 3.14);
kv.write(3.14, "Pi");

Expand All @@ -97,7 +101,7 @@ try(KV kv = QuickIO.usingKV("example_kv")) {
```
存储文件类型的数据。
```java
try(Tin tin = QuickIO.usingTin("example_tin")) {
try (Tin tin = QuickIO.usingTin("example_tin")) {
tin.put("photo.png", new File("..."));

File file = tin.get("photo.png");
Expand Down

0 comments on commit 71b5733

Please sign in to comment.