Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 39 additions & 40 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,46 @@ jobs:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2

build:
# Quick smoke test to catch obvious issues early
smoke:
needs: [ typos, toml, fmt, clippy, machete, deny ]
name: Smoke Test
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: Swatinem/rust-cache@v2
- name: Quick build check
run: cargo build --features ${{ env.DEFAULT_FEATURES }} -p minigu-cli
- name: Quick unit tests
run: cargo test --lib --features ${{ env.DEFAULT_FEATURES }} -- --test-threads=4
Comment on lines +88 to +92

# Combined build and test job to avoid duplicate compilation
build_and_test:
Comment on lines +79 to +95
needs: [ smoke ]
Comment on lines +79 to +96
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
name: Build on ${{ matrix.os }}
name: Build & Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: taiki-e/install-action@v2
with:
tool: cargo-nextest@0.9.88
- uses: Swatinem/rust-cache@v2
- run: cargo build --features ${{ env.DEFAULT_FEATURES }}
- name: Build
run: cargo build --features ${{ env.DEFAULT_FEATURES }}
- name: Run tests with nextest
run: cargo nextest run --features ${{ env.DEFAULT_FEATURES }}
- name: Run doc tests
run: cargo test --features ${{ env.DEFAULT_FEATURES }} --doc

build_no_std:
needs: [ typos, toml, fmt, clippy, machete, deny ]
needs: [ smoke ]
name: Build gql-parser in no_std mode
runs-on: ubuntu-latest
timeout-minutes: 30
Expand All @@ -104,21 +128,10 @@ jobs:
- uses: Swatinem/rust-cache@v2
- run: cargo build -p gql-parser --target aarch64-unknown-none --no-default-features -Zbuild-std=core,alloc

# Combined WASM check and test
wasm:
needs: [ typos, toml, fmt, clippy, machete, deny ]
name: WASM Check (minigu-wasm)
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: rustup target add wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
- run: cargo check -p minigu-wasm --target wasm32-unknown-unknown

wasm_test:
needs: [ typos, toml, fmt, clippy, machete, deny ]
name: WASM Tests (minigu-wasm)
needs: [ smoke ]
name: WASM Build & Test (minigu-wasm)
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
Expand All @@ -132,30 +145,16 @@ jobs:
with:
tool: wasm-pack@0.13.1
- uses: Swatinem/rust-cache@v2
- run: wasm-pack test --node minigu-wasm
- run: wasm-pack test --headless --chrome minigu-wasm

test:
needs: [ typos, toml, fmt, clippy, machete, deny ]
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: taiki-e/install-action@v2
with:
tool: cargo-nextest@0.9.88
- uses: Swatinem/rust-cache@v2
- run: cargo nextest run --features ${{ env.DEFAULT_FEATURES }}
- run: cargo test --features ${{ env.DEFAULT_FEATURES }} --doc
- name: WASM build check
run: cargo check -p minigu-wasm --target wasm32-unknown-unknown
- name: WASM tests (Node)
run: wasm-pack test --node minigu-wasm
- name: WASM tests (Chrome)
run: wasm-pack test --headless --chrome minigu-wasm

docs:
name: Build Docs
needs: [ typos, toml, fmt, clippy, machete, deny ]
needs: [ smoke ]
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
Expand Down
73 changes: 68 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,82 @@ MiniGU 是一个基于 Rust 语言实现的图数据库,旨在帮助学习者

# 文档

详细文档TBA
- [用户指南](docs/user-guide.md) - 安装、快速开始、GQL 语法参考
- [架构设计](docs/architecture.md) - 系统架构、核心模块、扩展指南
- [解析器开发指南](docs/parser/development.md) - GQL 解析器开发文档

## 快速上手

Start the interactive shell:
启动交互式 Shell:
```bash
cargo run -- shell # start in debug mode
cargo run -r -- shell # start in release mode
cargo run -- shell # 调试模式启动
cargo run -r -- shell # 发布模式启动(推荐)
```

执行脚本文件:
```bash
cargo run -- execute path/to/script.gql
```

### 基本示例

```sql
-- 创建图
CREATE GRAPH my_graph;
SET GRAPH my_graph;

-- 插入数据
INSERT (a:Person {name: 'Alice', age: 30}),
(b:Person {name: 'Bob', age: 25});

-- 查询数据
MATCH (p:Person)
WHERE p.age > 25
RETURN p.name, p.age
ORDER BY p.age DESC;
```

## 系统架构

TBA
miniGU 采用分层架构设计:

```
┌─────────────────────────────────────────────────────────────────┐
│ CLI Layer (minigu-cli) │
└─────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────┐
│ Core API Layer (minigu/core) │
└─────────────────────────────────────────────────────────────────┘
┌───────────────────────┼───────────────────────┐
│ │ │
▼ ▼ ▼
┌───────────────┐ ┌───────────────────┐ ┌─────────────────┐
│ Catalog │ │ Context │ │ Transaction │
└───────────────┘ └───────────────────┘ └─────────────────┘
│ │ │
└───────────────────────┼───────────────────────┘
┌───────────────────────┼───────────────────────┐
│ │ │
▼ ▼ ▼
┌───────────────┐ ┌───────────────────┐ ┌─────────────────┐
│ Common │ │ Storage │ │ GQL │
│ (公共类型) │ │ (存储引擎) │ │ (查询引擎) │
└───────────────┘ └───────────────────┘ └─────────────────┘
```

### 核心特性

- **GQL 查询语言**: 支持图模式匹配、过滤、聚合、排序等操作
- **事务支持**: 基于 MVCC 的事务管理,支持快照隔离和可串行化隔离级别
- **向量搜索**: 内置 DiskANN 向量索引,支持近似最近邻搜索
- **嵌入式设计**: 单文件存储格式,无需独立服务器进程
- **持久化存储**: 支持 WAL 和检查点机制

详细架构说明请参阅 [架构设计文档](docs/architecture.md)

# Contributing

Expand Down
Loading
Loading