Git Product home page Git Product logo

pg_graphql's Introduction

pg_graphql

PostgreSQL version License Tests


Documentation: https://supabase.github.io/pg_graphql

Source Code: https://github.com/supabase/pg_graphql


Query your existing PostgreSQL database with GraphQL

pg_graphql inspects your PostgreSQL schema and reflects a GraphQL schema with resolvers.

  • Performant: +2k requests/second
  • Always up-to-date: Reflected from the SQL schema
  • Pagination: Relay compliant
  • Serverless: Runs in your database with no additional server required
  • Open Source: Apache License 2.0

pg_graphql is pre-alpha software under active development

Overview

pg_graphql provides an SQL schema -> GraphQL schema reflection engine and an associated GraphQL query -> SQL query transpiler.

The extension keeps schema generation, query parsing, and resolvers all neatly contained on your database. This enables any programming language that can connect to PostgreSQL to query the database via GraphQL with no additional servers, processes, or libraries.

TL;DR

The SQL schema

create table account(
    id serial primary key,
    email varchar(255) not null,
    encrypted_password varchar(255) not null,
    created_at timestamp not null,
    updated_at timestamp not null
);

create table blog(
    id serial primary key,
    owner_id integer not null references account(id),
    name varchar(255) not null,
    description varchar(255),
    created_at timestamp not null,
    updated_at timestamp not null
);

create type blog_post_status as enum ('PENDING', 'RELEASED');

create table blog_post(
    id uuid not null default uuid_generate_v4() primary key,
    blog_id integer not null references blog(id),
    title varchar(255) not null,
    body varchar(10000),
    status blog_post_status not null,
    created_at timestamp not null,
    updated_at timestamp not null
);

Translates into a GraphQL schema exposing each table as a pageable collection with relationships defined by the foreign keys.

GraphiQL

pg_graphql's People

Contributors

dazzag24 avatar dthyresson avatar olirice avatar steve-chavez 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.