• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

supabase/pg_graphql: GraphQL support for PostgreSQL

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

supabase/pg_graphql

开源软件地址(OpenSource Url):

https://github.com/supabase/pg_graphql

开源编程语言(OpenSource Language):

PLpgSQL 98.3%

开源软件介绍(OpenSource Introduction):

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
);

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 recieve entrypoints in the Mutation schema that enable bulk operations for insert, update, and delete.

GraphiQL




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
prisma-labs/prisma-binding: GraphQL Binding for Prisma 1 (using GraphQL schema d ...发布时间:2022-06-12
下一篇:
eggjs/egg-graphql发布时间:2022-06-12
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap