GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - supabase/pg_graphql: GraphQL support for PostgreSQL

BranchesTags
Open more actions menu

Latest commit

 

History

1,489 Commits
1,489 Commits

Folders and files

NameName
Last commit message
Last commit date
.cargo
.cargo
 
 
.ci
.ci
 
 
.github
.github
 
 
bin
bin
 
 
dockerfiles
dockerfiles
 
 
docs
docs
 
 
sql
sql
 
 
src
src
 
 
test
test
 
 
.clang-format
.clang-format
 
 
.dockerignore
.dockerignore
 
 
.gitignore
.gitignore
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
Cargo.lock
Cargo.lock
 
 
Cargo.toml
Cargo.toml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
docker-compose.yaml
docker-compose.yaml
 
 
mkdocs.yaml
mkdocs.yaml
 
 
pg_graphql.control
pg_graphql.control
 
 

Repository files navigation

pg_graphql

PostgreSQL version License tests


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

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


pg_graphql adds GraphQL support to your PostgreSQL database.

  • Performant
  • Consistent
  • Serverless
  • Open Source

Overview

pg_graphql reflects a GraphQL schema from the existing SQL schema.

The extension keeps schema translation and query resolution neatly contained on your database server. 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,
    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
);

-- This enables default inflection, which automatically renames
-- snake_case to PascalCase for type names, and snake_case to camelCase for field names.
-- See https://supabase.github.io/pg_graphql/configuration/#inflection for more details.
COMMENT ON SCHEMA public IS e'@graphql({"inflect_names": true})';

Translates into a GraphQL schema displayed below.

Each table receives an entrypoint in the top level Query type that is a pageable collection with relationships defined by its foreign keys. Tables similarly receive entrypoints in the Mutation schema that enable bulk operations for insert, update, and delete.

GraphiQL

Contributing

Please refer to the contributing docs for more information.

About

GraphQL support for PostgreSQL

supabase.github.io/pg_graphql

Topics

apigraphqlgraphql-serverpostgrespostgresqlsql

Resources

Readme
Apache-2.0 license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

3.4k stars

Watchers

45 watching

Forks

144 forks
Report repository

Releases

Sponsor this project

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.