Skip to main content

Introspection?

PostgreSQL has a powerful introspection API which allows us to ask it all about a database — what schemas, tables, columns, constraints, indexes, functions, comments, etc it has — and we use this information to construct the GraphQL schema automatically.

PostgreSQL 提供了强大的内省(introspection)API,使我们能够查询数据库的完整结构信息——包括其中包含哪些 schema、表、列、约束、索引、函数、注释等——PostGraphile 正是利用这些元数据来自动构建 GraphQL schema。

We’ve built a library to do this that deeply integrates the PostgreSQL documentation; should you wish to use this with your own projects (or just want to see how it works), check out pg-introspection.

我们为此专门打造了一个与 PostgreSQL 官方文档深度集成的工具库;如果你想在自己的项目中使用它(或者单纯好奇它的实现原理),欢迎了解 pg-introspection。