← FirebaseCONTENT HISTORYWHAT CHANGED · RULE-BASED ANALYSIS
Update to Firebase
Snapshot Sep 30, 2026 · 23:02 UTC · version 1.0.0
Collection source: not recorded for this historical snapshot.
First saved snapshot
No earlier snapshot is available to establish a change.
Compare saved observations
Download comparison JSONFull technical diff · 0 changed fields
Full snapshot data
{
"name": "firebase-data-connect",
"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.",
"included_files": [
{
"relative_path": "reference/cloud_functions.md",
"size_in_bytes": 6111
},
{
"relative_path": "reference/config.md",
"size_in_bytes": 6962
},
{
"relative_path": "reference/data_seeding.md",
"size_in_bytes": 5925
},
{
"relative_path": "reference/native_sql.md",
"size_in_bytes": 7066
},
{
"relative_path": "reference/operations.md",
"size_in_bytes": 11226
},
{
"relative_path": "reference/realtime.md",
"size_in_bytes": 7738
},
{
"relative_path": "reference/schema.md",
"size_in_bytes": 7622
},
{
"relative_path": "reference/sdk_admin_node.md",
"size_in_bytes": 4202
},
{
"relative_path": "reference/sdk_android.md",
"size_in_bytes": 3794
},
{
"relative_path": "reference/sdk_flutter.md",
"size_in_bytes": 3511
},
{
"relative_path": "reference/sdk_ios.md",
"size_in_bytes": 4332
},
{
"relative_path": "reference/sdk_web.md",
"size_in_bytes": 4005
},
{
"relative_path": "reference/search.md",
"size_in_bytes": 8922
},
{
"relative_path": "reference/security.md",
"size_in_bytes": 8944
}
],
"skill_md_contents": "---\nname: firebase-data-connect\ndescription: 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.\nmetadata:\n category: Databases\n---\n\n# Firebase SQL Connect\n\nFirebase SQL Connect is a relational database service using Cloud SQL for\nPostgreSQL with GraphQL schema, auto-generated queries/mutations, and type-safe\nSDKs.\n\n> [!NOTE] **Product Rename**: Firebase Data Connect was renamed to **Firebase\n> SQL Connect**. All instructions, references, and examples in this skill\n> repository referring to \"Data Connect\" or \"Firebase Data Connect\" apply to\n> \"SQL Connect\" and \"Firebase SQL Connect\" as well.\n\n## Project Structure\n\n```text\ndataconnect/\n├── dataconnect.yaml # Service configuration\n├── seed_data.gql # LOCAL ONLY — prototype/test data\n├── schema/\n│ └── schema.gql # Data model (types with @table)\n└── connector/\n ├── connector.yaml # Connector config + SDK generation\n ├── queries.gql # Queries\n └── mutations.gql # Mutations\n```\n\n## Key Tools for Validation\n\nRely on these two mechanisms to ensure project correctness:\n\n1. **Review GraphQL Schema**: Both user-defined and generated extensions (in\n `.dataconnect/schema/main/`).\n1. **Validate Operations**: Run\n `npx -y firebase-tools@latest dataconnect:compile` against the schema.\n\n## Operation Strategies: GraphQL vs. Native SQL\n\nAlways default to **Native GraphQL**. **Native SQL lacks type safety** and\nbypasses schema-enforced structures. Only use **Native SQL** when the user\nexplicitly requests it or when the task requires advanced database features.\n\n| Strategy | When to use | Implementation |\n| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |\n| **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. |\n| **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. |\n\n## Development Workflow\n\nFollow this strict workflow to build your application. You **must** read the\nlinked reference files for each step to understand the syntax and available\nfeatures.\n\n### 1. Define Data Model (`schema/schema.gql`)\n\nDefine your GraphQL types, tables, and relationships (which map to a Postgres\nschema).\n\n> **Read [reference/schema.md](reference/schema.md)** for:\n>\n> - `@table`, `@col`, `@default`\n> - Relationships (`@ref`, one-to-many, many-to-many)\n> - Data types (UUID, Vector, JSON, etc.)\n\n### 2. Define Authorized Operations (`connector/queries.gql`, `connector/mutations.gql`)\n\nWrite the queries and mutations your client will use, including authorization\nlogic. SQL Connect is secure by default.\n\n> **Read [reference/operations.md](reference/operations.md)** for:\n>\n> - **Queries**: Filtering (`where`), Ordering (`orderBy`), Pagination\n> (`limit`/`offset`).\n> - **Mutations**: Create (`_insert`), Update (`_update`), Delete (`_delete`).\n> - **Upserts**: Use `_upsert` to \"insert or update\" records (CRITICAL for user\n> profiles).\n> - **Transactions**: Use `@transaction` for multi-step atomic operations. Use\n> `_expr: \"response.<prevStep>\"` to pass data between steps.\n>\n> **Read [reference/security.md](reference/security.md)** for authorization:\n>\n> - `@auth(level: ...)` for PUBLIC, USER, or NO_ACCESS.\n> - `@check` and `@redact` for row-level security and validation.\n>\n> **Read [reference/realtime.md](reference/realtime.md)** for real-time\n> subscriptions:\n>\n> - `@refresh` directive for time-based polling and event-driven updates.\n> - CEL conditions to scope refresh triggers precisely.\n>\n> **Read [reference/native_sql.md](reference/native_sql.md)** for Native SQL\n> operations:\n>\n> - Embedding raw SQL with `_select`, `_selectFirst`, `_execute`\n> - Strict rules for positional parameters (`$1`, `$2`), quoting, and CTEs\n> - Advanced PostgreSQL features (PostGIS, Window Functions)\n\n### 3. Use type-safe SDK in your apps\n\nGenerate type-safe code for your client platform.\n\nConfigure SDK generation in `connector.yaml`:\n\n```yaml\nconnectorId: my-connector\ngenerate:\n javascriptSdk:\n outputDir: \"../web-app/src/lib/dataconnect\"\n package: \"@movie-app/dataconnect\"\n kotlinSdk:\n outputDir: \"../android-app/app/src/main/kotlin/com/example/dataconnect\"\n package: \"com.example.dataconnect\"\n swiftSdk:\n outputDir: \"../ios-app/DataConnect\"\n```\n\nGenerate SDKs:\n\n```bash\nnpx -y firebase-tools@latest dataconnect:sdk:generate\n```\n\nFor platform-specific instructions on how to use the generated SDKs, read:\n\n- **Web (TypeScript)**: [reference/sdk_web.md](reference/sdk_web.md)\n- **Android (Kotlin)**: [reference/sdk_android.md](reference/sdk_android.md)\n- **iOS (Swift)**: [reference/sdk_ios.md](reference/sdk_ios.md)\n- **Admin (Node.js)**:\n [reference/sdk_admin_node.md](reference/sdk_admin_node.md)\n- **Flutter (Dart)**: [reference/sdk_flutter.md](reference/sdk_flutter.md)\n\n______________________________________________________________________\n\n## Feature Capability Map\n\nIf you need to implement a specific feature, consult the mapped reference file:\n\n| Feature | Reference File | Key Concepts |\n| :------------------------------ | :----------------------------------------------------------- | :------------------------------------------------- |\n| **Data Modeling** | [reference/schema.md](reference/schema.md) | `@table`, `@unique`, `@index`, Relations |\n| **Vector Search** | [reference/search.md](reference/search.md) | `Vector`, `@col(dataType: \"vector\")`, embeddings |\n| **Full-Text Search** | [reference/search.md](reference/search.md) | `@searchable`, `movies_search` |\n| **Upserting Data** | [reference/operations.md](reference/operations.md) | `_upsert` mutations |\n| **Complex Filters** | [reference/operations.md](reference/operations.md) | `_or`, `_and`, `_not`, `eq`, `contains` |\n| **Transactions** | [reference/operations.md](reference/operations.md) | `@transaction`, `response` binding |\n| **Environment Config** | [reference/config.md](reference/config.md) | `dataconnect.yaml`, `connector.yaml` |\n| **Realtime Subscriptions** | [reference/realtime.md](reference/realtime.md) | `@refresh`, `subscribe()`, auto-refresh |\n| **Cloud Functions Integration** | [reference/cloud_functions.md](reference/cloud_functions.md) | `onMutationExecuted`, triggering events |\n| **Data Seeding & Migrations** | [reference/data_seeding.md](reference/data_seeding.md) | `seed_data.gql`, `_insertMany`, Admin SDK bulk |\n| **Starter Templates** | [templates.md](templates.md) | CRUD, user-owned resources, many-to-many, SDK init |\n\n______________________________________________________________________\n\n## Deployment & CLI\n\n> **Read [reference/config.md](reference/config.md)** for deep dive on\n> configuration.\n\nFollow these patterns based on your current task:\n\n### How to initialize SQL Connect in a Firebase project\n\n1. Understand the app idea. Ask clarification questions if unclear.\n1. Run `npx -y firebase-tools@latest init dataconnect`.\n1. Validate that the app template and generated SDK are setup.\n\n### How to build apps using SQL Connect locally\n\n1. Start the emulator:\n `npx -y firebase-tools@latest emulators:start --only dataconnect`.\n1. Write schema and operations.\n1. Seed local test data into `seed_data.gql`. Read\n [reference/data_seeding.md](reference/data_seeding.md#local-prototyping-data-seeding).\n1. Run `npx -y firebase-tools@latest dataconnect:compile` or\n `npx -y firebase-tools@latest dataconnect:sdk:generate` to validate them.\n1. Use the operations in your app and build it.\n\n### How to deploy SQL Connect to Cloud SQL\n\n1. Run `npx -y firebase-tools@latest deploy --only dataconnect`.\n\n## Examples\n\nFor complete, working code examples of schemas and operations, see\n**[examples.md](examples.md)**.\n\nFor ready-to-use starter templates (CRUD, user-owned resources, many-to-many,\nYAML configs, SDK init), see **[templates.md](templates.md)**.\n"
}SHA-256: d85a3a03701b8c823f26eaf3900d5f1e8390651cc3571a7eb8f6278a1fe1710c