firebase/agent-skills

firebase-data-connect

用GraphQL模型与授权操作连接PostgreSQL和客户端

  • SKILL.md 已保存
  • 中文用法已整理
  • 安装与运行未实测
先判断是否解决你的问题

firebase-data-connect 是什么?

firebase-data-connect 指导使用Firebase的PostgreSQL关系数据服务,编写GraphQL表模型、带授权的查询和变更,再生成类型化客户端SDK。捕获版本将产品称为SQL Connect,目录名仍保留Data Connect。

中文说明由本站依据来源整理;英文原文保留在页面下方。

适合用在

  • Firebase应用需要关系、事务与类型化数据操作,而非Firestore文档模型。

这些情况不适合

  • 普通CRUD直接绕过类型化操作拼接原生SQL,或把本地seed数据误当生产迁移。
按客户端选择安装入口

怎么接入你的 Agent?

  1. 定位完整 Skill 目录

    打开本项目来源,核对 SKILL.md 及其引用的脚本和资料。

  2. 交给你正在用的 Agent

    在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。

  3. 确认识别,再做具体任务

    让 Agent 回报安装目录和识别到的名称 firebase-data-connect,然后按本页使用示例提供材料。

展开并复制给 Codex 的安装指令
发送给 Codex

安装并检查 firebase-data-connect

请在 Codex 的当前工作环境中安装并检查 firebase-data-connect 这个 Skill。

项目身份:firebase/agent-skills / firebase-data-connect
来源:https://github.com/firebase/agent-skills/blob/99954a30898bb5ddc8152ee10e124dc3b4106bf7/skills/firebase-data-connect-basics/SKILL.md
已定位的源文件:skills/firebase-data-connect-basics/SKILL.md

1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。
准备输入,再按步骤执行

装好以后,具体怎么用?

准备哪些材料

  • 明确Firebase项目、关系模型、客户端平台与部署范围;保留schema、operations、security和SDK参考,实际云端使用涉及Cloud SQL配置。

会得到什么

  • 数据模型、授权查询/变更、生成SDK与编译结果;如获授权部署,还包括真实服务状态。

实际使用顺序

  1. 在dataconnect目录定义schema.gql的表与关系,检查自动生成的schema扩展。
  2. 在connector查询与变更中编写明确授权,按业务使用auth/check/redact、事务或upsert;只有实际需要高级PostgreSQL能力才考虑参数化Native SQL。
  3. 配置connector.yaml生成目标平台SDK;本地启动dataconnect模拟器并用本地seed构造输入。
  4. 运行dataconnect:compile检查操作与schema,再生成SDK并在应用调用;云端deploy与本地验证分开记录。
使用示例

从一个具体任务开始

本站根据源文件编写的使用示例,未在本站实际运行。示例中的文件由你提供。

安装并识别 Skill 后发送

复制一个具体任务

用 firebase-data-connect 为“用户收藏书籍”做本地原型。先设计用户、书籍与收藏关系,查询只能读取自己的收藏,重复收藏用合适的upsert或唯一约束处理。按源文生成Web SDK,在模拟器加入本地测试数据并编译,不部署Cloud SQL。报告实际编译结果。
预期结果

预期得到带所有权授权的关系模型、操作与客户端调用;本站未执行此例。

使用前先看这些限制

使用条件与边界

  • 产品改名是捕获源版本的说明,实际账户界面和文档可能仍使用Data Connect,使用时核对官方名称与CLI。
  • compile能检查操作结构,不代表所有授权业务场景已实测;原生SQL也没有同样的类型保障。
针对这个 Skill 的疑问

常见问题

为什么不直接写SQL完成所有操作?

来源默认使用Native GraphQL以保留类型与schema约束,只有特定扩展、窗口函数或复杂优化场景才走参数化原生SQL。

seed_data.gql会作为生产数据发布吗?

来源把它定位为本地原型与测试数据;生产迁移或批量数据操作需按对应参考另外规划。

需要核对时再展开原文

来源原文与资料状态

源文件
已保存 SKILL.md,抓取于 2026-11-19T19:32:10.677Z
中文使用说明
已针对下方源文件版本整理用途、用法和常见问题
安装与任务测试
本站未执行安装或任务测试
来源复核
本页中文用法已对照保存版本的完整 SKILL.md 阅读整理
展开 SKILL.md 原文、章节与历史收录资料

skills/firebase-data-connect-basics/SKILL.md · 抓取时间 2026-11-19T19:32:10.677Z

以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。

抓取成功不代表已完成安装或任务测试。

来源 description(原文)

Builds and deploys Firebase SQL Connect (aka Firebase Data Connect) backends with PostgreSQL securely. Use when designing schemas with tables and relations, writing authorized queries and mutations, configuring real-time data updates, or generating type-safe SDKs. Use when you need a relational database with Firebase, or when the user mentions SQL Connect or Data Connect.

查看源文件章节 / Source sections
  • 原文:Firebase SQL Connect
  • 原文:Project Structure
  • 原文:Key Tools for Validation
  • 原文:Operation Strategies: GraphQL vs. Native SQL
  • 原文:Development Workflow
  • 原文:1. Define Data Model (`schema/schema.gql`)
  • 原文:2. Define Authorized Operations (`connector/queries.gql`, `connector/mutations.gql`)
  • 原文:3. Use type-safe SDK in your apps
  • 原文:Feature Capability Map
  • 原文:Deployment & CLI
  • 原文:How to initialize SQL Connect in a Firebase project
  • 原文:How to build apps using SQL Connect locally
  • 原文:How to deploy SQL Connect to Cloud SQL
  • 示例 / Examples
原文:Firebase SQL Connect

Firebase SQL Connect is a relational database service using Cloud SQL for PostgreSQL with GraphQL schema, auto-generated queries/mutations, and type-safe SDKs. > [!NOTE] **Product Rename**: Firebase Data Connect was renamed to **Firebase > SQL Connect**. All instructions, references, and examples in this skill > repository referring to "Data Connect" or "Firebase Data Connect" apply to > "SQL Connect" and "Firebase SQL Connect" as well.

原文:Project Structure

```text dataconnect/ ├── dataconnect.yaml # Service configuration ├── seed_data.gql # LOCAL ONLY — prototype/test data ├── schema/ │ └── schema.gql # Data model (types with @table) └── connector/ ├── connector.yaml # Connector config + SDK generation ├── queries.gql # Queries └── mutations.gql # Mutations ```

原文:Key Tools for Validation

Rely on these two mechanisms to ensure project correctness: 1. **Review GraphQL Schema**: Both user-defined and generated extensions (in `.dataconnect/schema/main/`). 1. **Validate Operations**: Run `npx -y firebase-tools@latest dataconnect:compile` against the schema.

原文:Operation Strategies: GraphQL vs. Native SQL

Always default to **Native GraphQL**. **Native SQL lacks type safety** and bypasses schema-enforced structures. Only use **Native SQL** when the user explicitly requests it or when the task requires advanced database features. | Strategy | When to use | Implementation | | ---------------------------- | ---------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | | **Native GraphQL** (Default) | Almost all use cases. Standard CRUD, basic filtering/sorting, simple relational joins. Requires full type safety. | Auto-generated fields (`movie_insert`, `movies`). Strong typing and schema enforcement. | | **Native SQL** (Advanced) | PostgreSQL extensions (e.g., PostGIS), window functions (`RANK()`), complex aggregations, or highly tuned sub-queries. | Raw SQL string literals via `_select`, `_execute`, etc. Requires strict positional parameters (`$1`). No type safety. |

原文:Development Workflow

Follow this strict workflow to build your application. You **must** read the linked reference files for each step to understand the syntax and available features.

原文:1. Define Data Model (`schema/schema.gql`)

Define your GraphQL types, tables, and relationships (which map to a Postgres schema). > **Read [reference/schema.md](reference/schema.md)** for: > > - `@table`, `@col`, `@default` > - Relationships (`@ref`, one-to-many, many-to-many) > - Data types (UUID, Vector, JSON, etc.)

文件 SHA256:e4aa0e21bca50f967be5c3143f2503bba1cf199d5fe3d4098047e503ce66a493

仓库许可证记录:Apache-2.0;repository-license-recorded-scope-unverified,查看来源。

Skills.sh收录简介 · 2026-07-28

Builds and deploys Firebase SQL Connect (aka Firebase Data Connect) backends with PostgreSQL securely. Use when designing schemas with tables and relations,…

查看历史简介来源

这份历史简介在采集时已截断;完整用途和触发条件需打开来源核对。

历史收录数据

Skill标识firebase-data-connect
来源仓库firebase/agent-skills
榜单快照2026-07-28
榜单口径Skills.sh累计安装量
快照名次212
快照累计安装量111633

历史资料说明

  • 所保留的来源简介在采集时已截断;完整触发条件、依赖及排除项须阅读源文件,本站不补写缺失部分。
  • 安装量用于说明当时的收录次序,不是效果、可信度或当前可用性的证明。

此页用于识别项目与来源。安装入口可在该Skill的Skills.sh页面查看;当前目录是否仍存在、附带脚本和账户依赖尚需按具体版本确认。

返回 Skills 目录,按任务继续筛选 · MCP与Skills教程与资源