Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GraphQL support for PostgreSQL

License

NotificationsYou must be signed in to change notification settings

supabase/pg_graphql

PostgreSQL versionLicensetests


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

createtableaccount(    idserialprimary key,    emailvarchar(255)not null,    created_attimestampnot null,    updated_attimestampnot null);createtableblog(    idserialprimary key,    owner_idintegernot nullreferences account(id),    namevarchar(255)not null,    descriptionvarchar(255),    created_attimestampnot null,    updated_attimestampnot null);createtypeblog_post_statusas enum ('PENDING','RELEASED');createtableblog_post(    id uuidnot null default uuid_generate_v4()primary key,    blog_idintegernot nullreferences blog(id),    titlevarchar(255)not null,    bodyvarchar(10000),    status blog_post_statusnot null,    created_attimestampnot null,    updated_attimestampnot 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 ISe'@graphql({"inflect_names": true})';

Translates into a GraphQL schema displayed below.

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

GraphiQL

Contributing

Please refer to thecontributing docs for more information.

Sponsor this project

 

Languages


[8]ページ先頭

©2009-2025 Movatter.jp