#structure #in-memory #db #embedded

nightly arthas_plugin

Compiler plugin for Arthas

2 releases

Uses old Rust 2015

0.1.1 Jan 17, 2017
0.1.0 Dec 19, 2016

#117 in #in-memory

Download history 97/week @ 2024-07-26

97 downloads per month

MIT license

17KB
371 lines

Arthas

Project Status: Abandoned – Initial development has started, but there has not yet been a stable, usable release; the project has been abandoned and the author(s) do not intend on continuing development.

Build Status docs

Arthas is an in-memory structure database.

Document

Prerequisites

Arthas requires Rust 1.15 or above.

Features

  • Support persistence.
  • Automatically update fields.
  • Automatic indexing.
  • Use structure without ORM.
  • Embedded.

Usage

Add dependencies to Cargo.toml

[dependencies]
arthas = "^0.3"
arthas_derive = "^0.1"
serde = "^0.9"
serde_derive = "^0.9"

In your main.rs or lib.rs:

extern crate arthas;
#[macro_use]
extern crate arthas_derive;
#[macro_use]
extern crate serde_derive;

CRUD Methods

  • insert()
  • remove()
  • replace()
  • find()
  • find_one()
  • count()

Query Methods

  • id()
  • limit()
  • offset()
  • field()
  • len()
  • eq()
  • ne()
  • gt()
  • lt()
  • ge()
  • le()
  • desc()
  • asc()

Examples

Examples can be found in the Documentation.

Upgrade to arthas 0.3 and arthas_derive

  1. Rename all your data files to only contains struct name. For example, rename "model.user.User" to "User".
  2. Replace attribute #[arthas] with #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Arthas)]
  3. If you use attribute value like #[arthas(one)], replace with the attribute #[arthas(is_one)]
  4. If you use the rename attribute like #[arthas_rename("from = to")], replace with the attribute #[arthas(rename = "from = to")]
  5. If you use both #[arthas(one)] and #[arthas_rename("from = to")], replace with #[arthas(is_one, rename = "from = to")]

License

arthas is primarily distributed under the terms of the MIT license. See LICENSE for details.

Dependencies

~3.5MB
~75K SLoC