MCPcopy Index your code
hub / github.com/PoloDB/PoloDB

github.com/PoloDB/PoloDB @v5.1.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release v5.1.4 ↗ · + Follow
860 symbols 2,246 edges 119 files 45 documented · 5%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Crates.io Discord docs.rs License

PoloDB is an embedded document database.

| Documentations |

Introduction

PoloDB is a library written in Rust that implements a lightweight MongoDB.

Why

PoloDB aims to offer a modern alternative to SQLite, which is currently the almost exclusive option for client-side data storage. Although SQLite is an old and stable software, it lacks some modern features. That's why we developed PoloDB, which is NoSQL, supports multi-threading and multi-sessions, and retains the embedded and lightweight features of SQLite.

Features

  • Simple and Lightweight
  • can be embedded library or a standalone server
  • Easy to learn and use
  • NoSQL
  • MongoDB-like API
  • Cross-Platform

Quick start

PoloDB is easy to learn and use:

use polodb_core::Database;
use serde::{Serialize, Deserialize};

#[derive(Debug, Serialize, Deserialize)]
struct Book {
    title: String,
    author: String,
}

let db = Database::open_path(db_path)?;
let collection = db.collection::<Book>("books");
collection.insert_one(Book {
    title: "The Three-Body Problem".to_string(),
    author: "Liu Cixin".to_string(),
})?;

Packages

  • polodb: The standalone server of PoloDB, which is compatible with MongoDB's wire protocol.
  • polodb_core: The core library of PoloDB, which can be embedded in your application.

Platform

Theoretically, PoloDB supports all platforms that the Rust compiler supports. But PoloDB is a personal project currently. Limited by my time, I have only compiled and tested on the following platforms:

  • macOS Big Sur x64
  • Linux x64 (Tested on Fedora 32)
  • Windows 10 x64

Manual

Roadmap

The features will be implemented one by one in order.

  • [x] Basic database API
  • [x] CRUD
  • [x] Transactions
  • [x] Serde
  • [x] Indexes(Alpha)
  • [x] Aggregation(Alpha)
  • [x] Command line Tools
  • [ ] Platforms
  • [x] MacOS
  • [x] Linux
  • [x] Windows
  • [ ] iOS
  • [ ] Android
  • [ ] Languages
  • [ ] Python
  • [ ] JavaScript

Extension points exported contracts — how you extend this code

Runner (Interface)
(no doc) [6 implementers]
src/polodb/main.rs
VmExternalFunc (Interface)
(no doc) [7 implementers]
src/polodb_core/vm/vm_external_func.rs
Handler (Interface)
(no doc) [11 implementers]
src/polodb/handlers/mod.rs
UpdateOperator (Interface)
(no doc) [9 implementers]
src/polodb_core/vm/update_operators/mod.rs
SyncLittleEndianRead (Interface)
(no doc) [1 implementers]
src/polodb/sync_read_ext.rs
CollectionT (Interface)
(no doc) [2 implementers]
src/polodb_core/coll/collection.rs
VmOperator (Interface)
(no doc) [2 implementers]
src/polodb_core/vm/operators/mod.rs

Core symbols most depended-on inside this repo

add
called by 111
src/polodb_core/errors.rs
len
called by 77
py-polodb/polodb/core.py
emit
called by 77
src/polodb_core/vm/codegen.rs
read
called by 61
src/polodb/wire/util.rs
run
called by 56
src/polodb_core/action/find.rs
get
called by 54
src/polodb/checked.rs
emit_goto
called by 51
src/polodb_core/vm/codegen.rs
get
called by 45
src/polodb_core/db/client_cursor.rs

Shape

Method 495
Function 233
Class 114
Enum 11
Interface 7

Languages

Rust96%
Python3%
C++1%

Modules by API surface

src/polodb_core/db/db_inner.rs57 symbols
src/polodb_core/vm/codegen.rs50 symbols
src/polodb_core/vm/subprogram.rs31 symbols
src/polodb_core/vm/vm.rs29 symbols
src/librocksdb-sys/tests/ffi.rs26 symbols
py-polodb/polodb/core.py21 symbols
src/polodb_core/coll/collection.rs19 symbols
src/polodb/bson_util.rs19 symbols
py-polodb/src/py_database.rs19 symbols
src/polodb_core/coll/txn_collection.rs18 symbols
src/polodb_line_diff/lib.rs16 symbols
src/polodb_core/errors.rs16 symbols

Datastores touched

(mongodb)Database · 1 repos

For agents

$ claude mcp add PoloDB \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page