Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kuaikuaikim/easylite
easy nosql database for IoT device, clean api and cross platform
https://github.com/kuaikuaikim/easylite
iot nosql nosql-database
Last synced: 17 days ago
JSON representation
easy nosql database for IoT device, clean api and cross platform
- Host: GitHub
- URL: https://github.com/kuaikuaikim/easylite
- Owner: kuaikuaikim
- Created: 2019-03-17T18:36:00.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-09-30T07:59:57.000Z (over 5 years ago)
- Last Synced: 2024-11-17T13:38:16.889Z (3 months ago)
- Topics: iot, nosql, nosql-database
- Language: C
- Size: 445 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## EasyLite - Easy Embedded Nosql Database
[![Build Status](https://travis-ci.org/symisc/unqlite.svg?branch=master)](https://github.com/kuaikuaikim) [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/kuaikuaikim) [![GitHub license](https://img.shields.io/pypi/l/Django.svg)](https://github.com/kuaikuaikim)**EasyLite** is an open source embedded nosql database based on unqlite. We wrapper couples of easy CURD API for reading/writting a single file only nosql databse. EasyLite dont need any dependent library, it can run any devices easily.
## Installation
```shell
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make install
```## Usage
c++ wrapper api:
```c++
//set environment variables
export LD_LIBRARY_PATH=/libeasylite.so path/#include "easylite_api.h"
EasyLite* easydb = load_easylite();
easydb->openDB("easy.db");StaticJsonBuffer<200> jsonBuffer;
JsonObject& root = jsonBuffer.createObject();
root["test"] = 100.52;
std::string jstr;
root.printTo(jstr);std::string collection_name = "user";
int last_id_2 = fdb->insert(collection_name, jstr);std::string out_str;
int count = fdb->fetchById(collection_name, last_id_2, out_str);
```java wrapper api:
```java
System.loadLibrary("easylitejni");
EasyLite easyDB = new EasyLite();
easyDB.initLoad();
easyDB.openDB("easy.db");
//create user object
User user=new User();
user.setUsername("kylin");
user.setPassword("123456");//object to json object
JSONObject jsonObject=JSONObject.fromObject(user);
//json object to json string
String jsonStr=jsonObject.toString();
int lastid = easyDB.insert("user", jsonStr);
//select user json string by user id
String userJsonStr = easyDB.fetchById(lastid);
```