Coder Social home page Coder Social logo

dbsystel / datalake-graphql-wrapper Goto Github PK

View Code? Open in Web Editor NEW
18.0 5.0 0.0 301 KB

The DataLake GraphQL Wrapper provides a GraphQL API for presto/trino.

JavaScript 3.08% TypeScript 86.20% EJS 10.72%
graphql pothos trino yoga-graphql boilerplate cli datalake generator presto prestodb

datalake-graphql-wrapper's Introduction

DataLake GraphQL Wrapper
Made with ❤️ by DB Systel GmbH

The DataLake GraphQL Wrapper provides a GraphQL API for presto/trino.

REUSE status

Features

  • Automatic endpoint generation via interactive cli
    • Generates the interfaces and available endpoint fields based on the fetched database schema
    • Generates the filter fields for all root fields
    • Sorting
    • Pagination
  • Support for nested fields
  • date/time transformation
  • Written in TypeScript
  • Easy to extend
  • Using only Open Source Software
  • It's free

Installation

git clone [email protected]:dbsystel/datalake-graphql-wrapper.git
cd datalake-graphql-wrapper
npm i
cp .env.example .env

Run the dev server

# Generate the index file to have all schemas available
npm run cli:index

# Start the dev server
npm run dev

Configuration

To get started, you have to update the .env file.

Variable Required Description
ENGINE_TYPE Yes Changes the header variable to switch between presto and trino. The value will be used in the sql client.
Valid values are: trino / presto
ENGINE_HOST Yes Presto/Trino coordinator hostname or address
ENGINE_PORT Yes Presto/Trino coordinator port
ENGINE_CATALOG Yes Presto/Trino catalog name
ENGINE_USERNAME Yes User which will be used to login
ENGINE_PASSWORD Yes Password for the user
ENGINE_SOURCE No Source name which will be used for the query. Default is nodejs-client

Command Line Interface

Available commands

# Start the interactive endpoint generation
npm run cli

# Generate only the index.ts with all generated schemata
npm run cli:index

The following args are available for npm run cli

Arg Description Example
--schema Sets the schema name and skips the cli prompt npm run cli -- --schema<schemaname>
--table Sets the table and skips the cli prompt.
You can define multiple tables.
Should be only used if you use --schema
npm run cli -- --schema<schemaname> --table <table1_in_schema> --table <table2_in_schema>
--lint Disable lint.
Helpful if you want to run the code generator multiple times.
( e.g. for different schemas )
npm run cli -- --lint false
--index Disable index file generation.
Helpful if you want to run the code generator multiple times.
( e.g. for different schemas )
npm run cli -- --index false
--indexonly Skips the questions for schema/table and generates only the
src/schema/index.ts file based on the existing endpoints.
( helpful if you created your own endpoint)
npm run cli -- --onlyindex true / Alias: npm run cli:index

Generate Endpoints

To start the code generator you have to run the following command.

npm run cli

Or if you know the schema and tablename, you can also use this command:

npm run cli -- --schema <schemaname> --table <tablename>

Generate only the src/schema/index.ts

npm run cli:index

Start the server

To run the server in development mode:

npm run dev

Otherwise, use:

npm run start

Compliance

We're using REUSE to ensure everything is compliant.

To install it locally, please ensure that you have python installed.

Run the following command to install it:

pip install -r requirements.txt

To run the linter:

reuse lint

Todos

  • Add tests
  • More documentation
  • Add/Create some HowTos
    • Manual endpoint creation
    • Authorization

Credits

License

This project is licensed under Apache-2.0

Contribute

See how to contribute


Trino is open source software licensed under the Apache License 2.0 and supported by the Trino Software Foundation.

Presto is a registered trademark of LF Projects, LLC.

datalake-graphql-wrapper's People

Contributors

noxify avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  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.