Git Product home page Git Product logo

byos's Introduction

Bring Your Own Schema (BYOS)

Bring Your Own Schema (BYOS) is an implementation based on the concepts presented in my thesis, focusing on transpiling GraphQL queries to SQL. This repository provides a practical example of how to bring your own GraphQL schema and use it to generate efficient SQL queries.

This is very much a prototype for now!

Features

  • One SQL query for every root level query.
  • GraphQL schema and SQL schema are not generated and do not contain BYOS specific code.
  • jOOQ is used to ensure correctness of the SQL configuration.
  • Supports filter arguments, pagination and sorting.

Project structure

  • src/main/kotlin/byos contains the BYOS implementation.
  • src/main/kotlin/example contains the exemplary Spring Boot application.
  • src/main/resources/graphql contains the GraphQL schema.
  • src/test/kotlin/example contains the tests for the example application.

If you want to try it out...

... you will have to have a local psql version of the sakila database with this small addition:

ALTER TABLE category
    ADD COLUMN parent_category_id INTEGER;

You could also set up your own database by:

  • changing the connection of jOOQ (and the language if you do not want to use Postgres).
  • using a GraphQL schema matching the SQL schema.
  • defining relationships and how to resolve them.

To run the example run the main method in ByosApplication.kt. After that you can query the GraphQL endpoint at http://localhost:8080 or open the GraphiQL interface at http://localhost:8080/graphiql.


For more details about the approach and implementation, refer to the associated thesis.

Happy querying and transpiling!

byos's People

Contributors

lukassailer avatar

Stargazers

kepler avatar Florian Bütler avatar Maksim Gramin avatar Gavin Ray avatar artem avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.