Relational (SQL) to Graph (GraphQL) transformation tool. Fast.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
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:
To get started using rtg,
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
- Clone the repo
git clone https://github.com/rtg-project/rtg.git
- Install NPM packages
npm install
- Create a Model
- Process a graphql document using this model
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 |
🔴 | 🔴 | 🔴 | 🔴 |
See the project road map on Github https://github.com/rtg-project/rtg/projects/1
- 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
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'
rtg is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).
See LICENSE for details.
Vincent Lecrubier - @VLecrubier
Project Link: https://github.com/rtg-project/rtg/
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!