惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Engineering at Meta
Engineering at Meta
人人都是产品经理
人人都是产品经理
大猫的无限游戏
大猫的无限游戏
博客园 - 三生石上(FineUI控件)
量子位
腾讯CDC
The Cloudflare Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
云风的 BLOG
云风的 BLOG
Vercel News
Vercel News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
L
LangChain Blog
aimingoo的专栏
aimingoo的专栏
The Hacker News
The Hacker News
T
The Exploit Database - CXSecurity.com
B
Blog
S
SegmentFault 最新的问题
P
Privacy & Cybersecurity Law Blog
T
Threatpost
博客园 - 聂微东
T
Tailwind CSS Blog
The Last Watchdog
The Last Watchdog
C
Check Point Blog
N
Netflix TechBlog - Medium
D
DataBreaches.Net
爱范儿
爱范儿
IT之家
IT之家
S
Secure Thoughts
M
MIT News - Artificial intelligence
NISL@THU
NISL@THU
C
Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog
有赞技术团队
有赞技术团队
A
Arctic Wolf
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
P
Proofpoint News Feed
Spread Privacy
Spread Privacy
Schneier on Security
Schneier on Security
Simon Willison's Weblog
Simon Willison's Weblog
G
GRAHAM CLULEY
雷峰网
雷峰网
Project Zero
Project Zero
博客园 - Franky
H
Heimdal Security Blog
A
About on SuperTechFans
Security Latest
Security Latest
Webroot Blog
Webroot Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Hugging Face - Blog
Hugging Face - Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More

Supabase Blog

AI Agents Know About Supabase. They Don't Always Use It Right. Custom OIDC Providers for Supabase Auth 100,000 GitHub stars Supabase docs over SSH Navigating Regional Network Blocks Supabase Joins the Stripe Projects Developer Preview Log Drains: Now available on Pro Supabase Storage: major performance, security, and reliability updates Supabase incident on February 12, 2026 Hydra joins Supabase X / Twitter OAuth 2.0 is now available for Supabase Auth BKND joins Supabase Supabase is now an official Claude connector Supabase PrivateLink is now available Introducing: Postgres Best Practices When to use Read Replicas vs. bigger compute Introducing TRAE SOLO integration with Supabase Supabase Security Retro: 2025 Sync Stripe Data to Your Supabase Database in One Click Building ChatGPT Apps with Supabase Edge Functions and mcp-use Own Your Observability: Supabase Metrics API Introducing iceberg-js: A JavaScript Client for Apache Iceberg Introducing Supabase for Platforms Adding Async Streaming to Postgres Foreign Data Wrappers Build "Sign in with Your App" using Supabase Auth Introducing Seven New Email Templates for Supabase Auth The new Supabase power for Kiro Introducing Supabase ETL Introducing Analytics Buckets Introducing Vector Buckets Snap, Inc. Launches Snap Cloud, Powered by Supabase Triplit joins Supabase Supabase Series E 1000 Y Combinator Founders Choose Supabase gm 👋 web3, welcome aboard to Sign in with Web3 (Solana, Ethereum) Announcing the Supabase Remote MCP Server Enterprise speed, enterprise standards with Bolt Cloud + Supabase PostgREST 13 Lovable Cloud + Supabase: The Default Platform for AI Builders Processing large jobs with Edge Functions, Cron, and Queues Defense in Depth for MCP Servers OrioleDB Patent: now freely available to the Postgres community Supabase Launch Week 15 Hackathon Winner Announcement The Vibe Coder's Guide to Supabase Environments Testing for Vibe Coders: From Zero to Production Confidence The Vibe Coding Master Checklist Vibe Coding: Best Practices for Prompting Supabase Auth: Build vs. Buy Top 10 Launches of Launch Week 15 Supabase Launch Week 15 Hackathon Storage: 10x Larger Uploads, 3x Cheaper Cached Egress, and 2x Egress Quota Persistent Storage and 97% Faster Cold Starts for Edge Functions Algolia Connector for Supabase New Observability Features in Supabase Improved Security Controls and A New Home for Security Introducing Branching 2.0 Stripe-To-Postgres Sync Engine as standalone Library Supabase Analytics Buckets with Iceberg Support Create a Supabase backend using Figma Make Introducing JWT Signing Keys Supabase UI: Platform Kit Build a Personalized AI Assistant with Postgres Announcing Multigres: Vitess for Postgres Building on open table formats Open Data Standards: Postgres, OTel, and Iceberg Simplifying back-end complexity with Supabase Data APIs PostgreSQL Event Triggers without superuser access Top 10 Launches of Launch Week 14 Supabase MCP Server Data API Routes to Nearest Read Replica Declarative Schemas for Simpler Database Management Realtime: Broadcast from Database Keeping Tabs on What's New in Supabase Studio Edge Functions: Deploy from the Dashboard + Deno 2.1 Automatic Embeddings in Postgres Introducing the Supabase UI Library Supabase Auth: Bring Your Own Clerk Postgres Language Server: Initial Release Migrating from Fauna to Supabase Migrating from the MongoDB Data API to Supabase Dedicated Poolers Postgres as a Graph Database: (Ab)using pgRouting AI Hackathon at Y Combinator Calendars in Postgres using Foreign Data Wrappers Supabase Launch Week 13 Hackathon Winners How to Hack the Base! Running Durable Workflows in Postgres using DBOS database.build v2: Bring-your-own-LLM Restore to a New Project Hack the Base! with Supabase Top 10 Launches of Launch Week 13 Supabase Queues High Performance Disk Supabase Cron Supabase CLI v2: Config as Code Supabase Edge Functions: Introducing Background Tasks, Ephemeral Storage, and WebSockets Supabase AI Assistant v2 OrioleDB Public Alpha Executing Dynamic JavaScript Code on Supabase with Edge Functions ClickHouse Partnership, improved Postgres Replication, and Disk Management
What's New in pg_graphql v1.2
Oliver Rice · 2023-04-21 · via Supabase Blog

What's New in pg_graphql v1.2

It's been 4 months since the 1.0.0 release of pg_graphql. Since then, we’ve pushed several features to improve the APIs that pg_graphql produces.

In this article, we’ll walk through those features and show examples of each.

📢 These features are only available on projects with Postgres version 15.1.0.63 or higher. For help with upgrading, please review the migrating and upgrading projects guide.

View Support#

Prior to v1.1, pg_graphql would only reflect standard tables. Since then, views, materialized views, and foreign tables are now also reflected in the GraphQL schema.

For example:


_10

create view "ProjectOwner" as

_10

select

_10

acc.id,

_10

acc.name

_10

from

_10

account as acc

_10

join role as r on r.id = acc.role_id

_10

where acc.role = 'project_owner';


Since all entities exposed by pg_graphql require primary keys, we must define that constraint for the view. We do that using a comment directive:


_10

comment on view "ProjectOwner"

_10

is '@graphql({"primary_key_columns": ["id"]})';


Which yields the GraphQL type:


_10

type ProjectOwner implements Node {

_10

nodeId: ID!

_10

id: UUID!

_10

name: String

_10

}


With associated Edge and Connection types. That enables querying via:


_10

{

_10

projectOwnerCollection(first: 2) {

_10

edges {

_10

node {

_10

nodeId

_10

name

_10

}

_10

}

_10

}

_10

}


Additionally, simple views automatically support mutation events like inserts and updates. You might use these to migrate underlying tables while maintaining backwards compatibility with previous API versions.

Filtering in SQL is endlessly flexible. We’ve taken two incremental steps to bring more of that flexibility to the GraphQL interface.

is null and is not null#

Handling null values can be tricky in both SQL and GraphQL. However, there are similarities we can take advantage of. In pg_graphql, every scalar data type has its own filter type, such as IntFilter and StringFilter. Each of these filter types now includes an is argument, which allows you to filter based on whether a value is null or not null. You can do this by using {is: NULL} for null values and {is: NOT_NULL} for non-null values.


_10

enum FilterIs {

_10

NULL

_10

NOT_NULL

_10

}

_10

_10

type IntFilter {

_10

...

_10

is: FilterIs

_10

}


For example:


_10

{

_10

blogCollection(filter: { name: {is: NULL}}) {

_10

...

_10

}

_10

}


to return all blogs where the name is null.

like, ilike, and startsWith#

Text filtering options in pg_graphql have historically been restricted to equality checks. The hesitation was due to concerns about exposing a default filter that is difficult to index. The combination of citext and PGroonga available on the platform solves those scalability risks and enabled us to expand the StringFilter with options for like ilike and startsWith.


_10

input StringFilter {

_10

eq: String

_10

...

_10

startsWith: String

_10

like: String

_10

ilike: String

_10

}


Note that startsWith filters should be preferred where appropriate because they can leverage simple B-Tree indexes to improve performance.


_11

{

_11

generalLedgerCollection(filter: { identifierCode: { startsWith: "BX1:" } }) {

_11

edges {

_11

node {

_11

nodeId

_11

identifierCode

_11

amount

_11

}

_11

}

_11

}

_11

}


GraphQL directives @skip and @include#

The GraphQL spec has evolved over time. Although the spec is clear, it is common for GraphQL servers to selectively omit some chunks of functionality. For example, some frameworks intentionally do not expose an introspection schema as a form of security through obscurity.

pg_graphql aims to be unopinionated and adhere exactly to the spec. The @skip and @include directives are part of the GraphQL core specification and are now functional.

The @skip directive in GraphQL is used to conditionally skip a field or fragment during query execution based on a Boolean variable. It can be used to make the query more efficient by reducing the amount of data retrieved from the server.

The @include directive is the mirror of @skip where a field or fragment is conditionally included depending on the value of a Boolean variable.

Here's an example of how the @skip directive can be used in a GraphQL query:


_11

query getBooks($includeDetails: Boolean!) {

_11

booksCollection {

_11

edges {

_11

node {

_11

id

_11

title

_11

description @skip(if: $includeDetails)

_11

}

_11

}

_11

}

_11

}


User Defined Descriptions#

Users can now use the comment directive system to assign descriptions to tables, views and columns.


_10

create table public.book(

_10

id int primary key,

_10

title text not null

_10

);

_10

_10

comment on table public.book

_10

is e'@graphql({"description": "a library book"})';

_10

_10

comment on column public.book.title

_10

is e'@graphql({"description": "the title of the book"})';


GraphQL IDEs, such as GraphiQL render those descriptions, allowing developers to provide clearer API documentation.

The headline features we aim to launch in coming releases of pg_graphql include:

  1. Support for user-defined functions: GitHub issue
  2. Support for nested inserts: GitHub issue
  3. An alternative approach to computed relationships based on SQL functions returning SET OF rather than comment directives (compatible with PostgREST)