Rtg
Relational (SQL) to Graph (GraphQL) tranformation tool. Fast.
Install / Use
/learn @rtg-project/RtgREADME
About
rtg is a versatile relational (SQL) to graph (GraphQL) transformation tool in rust, for rust, javascript, typescript, and maybe python.
Here is the architecture of RTG, with the current area of focus in bold:
Built With
<p align="right">(<a href="#top">back to top</a>)</p>Getting Started
To get started using rtg,
Prerequisites
This is an example of how to list things you need to use the software and how to install them.
- npm
npm install npm@latest -g
Installation
- Clone the repo
git clone https://github.com/rtg-project/rtg.git - Install NPM packages
npm install
Usage
- Create a Model
- Process a graphql document using this model
Features
SQL to GraphQL matching coverage
| SQL Concept | GraphQL Concept | Model | Query | GraphQL Schema | SQL Schema |
|----------------------------------------------------|--------------------------------------------------|-------|-------|----------------|------------|
| Basic columns: INT, TEXT, etc. | Scalar fields: Integer, String, etc. | 🟢 | 🟢 | 🟢 | 🟢 |
| Non null columns NON NULL | Non null fields: Integer!, String!, etc. | 🟢 | 🟢 | 🟢 | 🟢 |
| Array columns: INT[], TEXT[], INTARRAY, etc. | Array fields: [Integer!]!, [String!]!, etc. | 🟢 | 🟢 | 🟢 | 🟢 |
| SELECT | allFoo queries | 🟢 | 🟢 | 🟢 | 🟢 |
| JOIN and FOREIGN KEY | Relation Fields: [Foo!]!, [Bar!]!, etc. | 🔴 | 🔴 | 🔴 | 🔴 |
| LIMIT and OFFSET | first, last, before, after arguments | 🔴 | 🔴 | 🔴 | 🔴 |
| CURSOR | allFooConnection queries | 🔴 | 🔴 | 🔴 | 🔴 |
| WHERE | where: {} argument, simple filter | 🔴 | 🔴 | 🔴 | 🔴 |
| ORDER BY | order: {} argument | 🔴 | 🔴 | 🔴 | 🔴 |
| INSERT | createFoo mutations | 🔴 | 🔴 | 🔴 | 🔴 |
| UPDATE | updateFoo mutations | 🔴 | 🔴 | 🔴 | 🔴 |
| DELETE | deleteFoo mutations | 🔴 | 🔴 | 🔴 | 🔴 |
| WHERE with JOIN | where: {} argument, relation filter | 🔴 | 🔴 | 🔴 | 🔴 |
| GROUP BY | aggregates field on allFooConnection queries | 🔴 | 🔴 | 🔴 | 🔴 |
| HAVING | where: {} argument, aggregation filter | 🔴 | 🔴 | 🔴 | 🔴 |
Roadmap
See the project road map on Github https://github.com/rtg-project/rtg/projects/1
- [x] Generate SQL Data Manipulation Language (DML) queries from GraphQL:
- [ ] Generate GraphQL SDL Schema from Rtg Model:
- [ ] Generate GraphQL SDL introspection schema from Rtg Model
- [ ] Validate GraphQL queries against the generated GraphQL SDL introspection schema
- [ ] Integrate Rtg Model and GraphQL Schema Definition Language (SDL):
- [ ] Generate Rtg Model from a GraphQL SDL
- [ ] Generate GraphQL SDL from a Rtg Model
- [ ] Integrate Rtg Model and SQL Data Definition Language (DDL) schemas:
- [ ] Generate Rtg Model from a Database DDL schema
- [ ] Generate Database DDL schema from a Rtg Model
- [ ] Automatically generate Typescript client SDK using [GraphQL codegen](graphql codegen)
- [ ] Generate basic client SDK
- [ ] Add features such as pagination streaming
- [ ] Automatically generate Python client SDK using Sgqlc
- [ ] Generate basic client SDK
- [ ] Add features such as pagination streaming
- [ ] Real time features
- [ ] Support GraphQL Subscriptions
Contributing
Not taking external contributions at this point
To test all packages, run:
cargo test --workspace -- --color always --nocapture
To run all tests in watch mode, run:
cargo watch --clear -x 'test --workspace -- --color always --nocapture'
<p align="right">(<a href="#top">back to top</a>)</p>
License
rtg is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).
See LICENSE for details.
<p align="right">(<a href="#top">back to top</a>)</p>Contact
Vincent Lecrubier - @VLecrubier
Project Link: https://github.com/rtg-project/rtg/
<p align="right">(<a href="#top">back to top</a>)</p>Acknowledgments
Use this space to list resources you find helpful and would like to give credit to. I've included a few of my favorites to kick things off!
<p align="right">(<a href="#top">back to top</a>)</p>Related Skills
feishu-drive
339.3k|
things-mac
339.3kManage Things 3 via the `things` CLI on macOS (add/update projects+todos via URL scheme; read/search/list from the local Things database)
clawhub
339.3kUse the ClawHub CLI to search, install, update, and publish agent skills from clawhub.com
yu-ai-agent
2.0k编程导航 2025 年 AI 开发实战新项目,基于 Spring Boot 3 + Java 21 + Spring AI 构建 AI 恋爱大师应用和 ReAct 模式自主规划智能体YuManus,覆盖 AI 大模型接入、Spring AI 核心特性、Prompt 工程和优化、RAG 检索增强、向量数据库、Tool Calling 工具调用、MCP 模型上下文协议、AI Agent 开发(Manas Java 实现)、Cursor AI 工具等核心知识。用一套教程将程序员必知必会的 AI 技术一网打尽,帮你成为 AI 时代企业的香饽饽,给你的简历和求职大幅增加竞争力。
