Skip to content

Relational (SQL) to Graph (GraphQL) tranformation tool. Fast.

License

Notifications You must be signed in to change notification settings

rtg-project/rtg

Repository files navigation


babel

RTG

Relational (SQL) to Graph (GraphQL) transformation tool. Fast.
Explore the docs »

View Demo · Report Bug · Request Feature



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:

Overview

Built With

(back to top)

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

  1. Clone the repo
    git clone https://github.com/rtg-project/rtg.git
  2. Install NPM packages
    npm install

(back to top)

Usage

  • Create a Model
  • Process a graphql document using this model

(back to top)

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 🔴 🔴 🔴 🔴

(back to top)

Roadmap

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

(back to top)

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' 

(back to top)

License

rtg is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE for details.

(back to top)

Contact

Vincent Lecrubier - @VLecrubier

Project Link: https://github.com/rtg-project/rtg/

(back to top)

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!

(back to top)

About

Relational (SQL) to Graph (GraphQL) tranformation tool. Fast.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published