Actor and REST interface for LEDB
The LEDB is an attempt to implement simple but efficient, lightweight but powerful document storage.
The abbreviation LEDB may be treated as an Lightweight Embedded DB, also Low End DB, also Literium Engine DB, also LitE DB, and so on.
Links
- ledb-actix Crate on crates.io
- ledb-actix API Docs on docs.rs
- ledb Crate on crates.io
- ledb API Docs on docs.rs
- ledb-types Crate on crates.io
- ledb-types API Docs on docs.rs
- ledb-derive Crate on crates.io
- ledb-derive API Docs on docs.rs
REST-interface
LEDB HTTP interface 0.1.0
Storage API
get database info
GET /info
get database statistics
GET /stats
Collection API
get list of collections
GET /collection
create new empty collection
POST /collection?name=_$collection_name_
drop collection with all documents
DELETE /collection/$collection_name
Index API
get indexes of collection
GET /collection/$collection_name/index
create new index for collection
POST /collection/$collection_name/index?path=_$field_name_&kind=_$index_kind_&key=_$key_type_
drop index of collection
DELETE /collection/$collection_name/document/$index_name
Document API
find documents using query
GET /collection/$collection_name/document?filter=_$query_&order=_$ordering_&offset=_$skip_&length=_$take_
GET /collection/$collection_name?filter=_$query_&order=_$ordering_&offset=_$skip_&length=_$take_
modify documents using query
PUT /collection/$collection_name/document?filter=_$query_&modify=_$modifications_
PATCH /collection/$collection_name?filter=_$query_&modify=_$modifications_
remove documents using query
DELETE /collection/$collection_name/document?filter=_$query_
PUT /collection/$collection_name?filter=_$query_
insert new document
POST /collection/$collection_name/document
POST /collection/$collection_name
get document by id
GET /collection/$collection_name/document/$document_id
GET /collection/$collection_name/$document_id
replace document
PUT /collection/$collection_name/document/$document_id
PUT /collection/$collection_name/$document_id
remove document
DELETE /collection/$collection_name/document/$document_id
DELETE /collection/$collection_name/$document_id
Supported index kinds
- uni -- Unique key
- dup -- Duplicated keys
Supported key types
- int -- 64-bit signed integer
- float -- 64-bit floating point number
- bool -- boolean value
- string -- UTF-8 string
- binary -- binary data
Actor
Usage example
extern crate actix;
extern crate futures;
extern crate tokio;
extern crate serde_derive;
extern crate serde_json;
extern crate ledb;
extern crate ledb_actix;
// This allows define typed documents easy
extern crate ledb_derive;
extern crate ledb_types;
extern crate log;
extern crate pretty_env_logger;
use System;
use Future;
use ;
use from_value;
use env;
use spawn;