GWP
A standalone, pure Rust gRPC wire protocol for GQL (ISO/IEC 39075) - the international standard query language for property graphs.
Any GQL-compatible database engine can plug in via the GqlBackend trait. GWP handles gRPC transport, session management, transactions, and the full GQL type system over the wire.
Features
- Spec-faithful - Full GQL type system, GQLSTATUS codes, session/transaction semantics
- Pure Rust - No C/C++ dependencies,
#![forbid(unsafe_code)] - Lightweight - Minimal deps: tonic, prost, tokio
- Fast - Streaming results via server-side gRPC streaming
- Embeddable - Library-first design, usable by any Rust project
Quick Start
Add to your Cargo.toml:
[]
= "0.1"
Implementing a Backend
Implement the GqlBackend trait to connect your database:
use ;
use GqlError;
Starting the Server
use GqlServer;
async
Using the Client
use GqlConnection;
use HashMap;
async
Architecture
Application (GQL statements, parameters, results)
|
v
gRPC Services
- SessionService: handshake, configure, reset, close, ping
- GqlService: execute, begin_transaction, commit, rollback
|
v
Protocol Buffers (prost)
- Full GQL type system: Value, Node, Edge, Path, Record
- GQLSTATUS codes for structured error reporting
|
v
GqlBackend trait (your database plugs in here)
GQL Type Support
| GQL Type | Wire Representation |
|---|---|
NULL, BOOLEAN, INTEGER, FLOAT, STRING, BYTES |
Native protobuf types |
DATE, TIME, DATETIME, DURATION |
Custom messages |
LIST, MAP |
Recursive Value containers |
NODE |
ID + labels + properties |
EDGE |
ID + type + endpoints + properties |
PATH |
Alternating nodes and edges |
BIGINTEGER, BIGFLOAT, DECIMAL |
String-encoded precision types |
Modules
| Module | Description |
|---|---|
proto |
Generated protobuf types and gRPC stubs |
types |
Ergonomic Rust wrappers over proto types |
server |
GqlBackend trait, session/transaction management, gRPC server |
client |
GqlConnection, GqlSession, ResultCursor, Transaction |
error |
GqlError enum |
status |
GQLSTATUS code constants and helpers |
Requirements
- Rust 1.85.0+ (edition 2024)
protoc(Protocol Buffers compiler) - required at build time
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.