Loading...
Loading...
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.
npx skill4agent add falahat/agent-skills firebase-data-connect[!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.
dataconnect/
├── dataconnect.yaml # Service configuration
├── schema/
│ └── schema.gql # Data model (types with @table)
└── connector/
├── connector.yaml # Connector config + SDK generation
├── queries.gql # Queries
└── mutations.gql # Mutations.dataconnect/schema/main/npx -y firebase-tools@latest dataconnect:compile| 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 ( |
| Native SQL (Advanced) | PostgreSQL extensions (e.g., PostGIS), window functions ( | Raw SQL string literals via |
schema/schema.gqlRead reference/schema.md for:
,@table,@col@default- Relationships (
, one-to-many, many-to-many)@ref- Data types (UUID, Vector, JSON, etc.)
connector/queries.gqlconnector/mutations.gqlRead reference/operations.md for:
- Queries: Filtering (
), Ordering (where), Pagination (orderBy/limit).offset- Mutations: Create (
), Update (_insert), Delete (_update)._delete- Upserts: Use
to "insert or update" records (CRITICAL for user profiles)._upsert- Transactions: Use
for multi-step atomic operations. Use@transactionto pass data between steps._expr: "response.<prevStep>"Read reference/security.md for authorization:
for PUBLIC, USER, or NO_ACCESS.@auth(level: ...) and@checkfor row-level security and validation.@redactRead reference/realtime.md for real-time subscriptions:
directive for time-based polling and event-driven updates.@refresh- CEL conditions to scope refresh triggers precisely.
Read reference/native_sql.md for Native SQL operations:
- Embedding raw SQL with
,_select,_selectFirst_execute- Strict rules for positional parameters (
,$1), quoting, and CTEs$2- Advanced PostgreSQL features (PostGIS, Window Functions)
connector.yamlconnectorId: my-connector
generate:
javascriptSdk:
outputDir: "../web-app/src/lib/dataconnect"
package: "@movie-app/dataconnect"
kotlinSdk:
outputDir: "../android-app/app/src/main/kotlin/com/example/dataconnect"
package: "com.example.dataconnect"
swiftSdk:
outputDir: "../ios-app/DataConnect"npx -y firebase-tools@latest dataconnect:sdk:generate| Feature | Reference File | Key Concepts |
|---|---|---|
| Data Modeling | reference/schema.md | |
| Vector Search | reference/advanced.md | |
| Full-Text Search | reference/advanced.md | |
| Upserting Data | reference/operations.md | |
| Complex Filters | reference/operations.md | |
| Transactions | reference/operations.md | |
| Environment Config | reference/config.md | |
| Realtime Subscriptions | reference/realtime.md | |
| Starter Templates | templates.md | CRUD, user-owned resources, many-to-many, SDK init |
Read reference/config.md for deep dive on configuration.
npx -y firebase-tools@latest init dataconnectnpx -y firebase-tools@latest emulators:start --only dataconnectnpx -y firebase-tools@latest dataconnect:compilenpx -y firebase-tools@latest dataconnect:sdk:generatenpx -y firebase-tools@latest deploy --only dataconnect