Skip to content

Commit aa81c41

Browse files
docs: add a Data Connect guide and link it from the README
Add docs/data-connect.md describing the Data Connect secondary entry point, following the same shape as the other product guides: a short intro, the dependency-injection setup (provideDataConnect/getDataConnect with a connector config, then inject(DataConnect)), and the wrap-the-SDK note. Add the Data Connect entry to the README feature table in its alphabetical slot after Cloud Storage, and re-flow the table into even two-column rows, which also fixes the previously lopsided final row. This supersedes #3673, which added the README entry but linked it to a docs/data-connect.md that did not exist (a dead link) and placed the row out of alphabetical order. Credit to @maneesht for adding the entry and flagging the gap. Firebase now brands this product "Firebase SQL Connect"; the guide keeps "Data Connect" as the primary name to match the @angular/fire/data-connect entry point and notes the new branding.
1 parent 11e29ff commit aa81c41

2 files changed

Lines changed: 70 additions & 5 deletions

File tree

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,43 +144,49 @@ import { } from '@angular/fire/storage';
144144
<tr>
145145
<td>
146146

147+
#### [Data Connect](docs/data-connect.md#data-connect)
148+
```ts
149+
import { } from '@angular/fire/data-connect';
150+
```
151+
</td>
152+
<td>
153+
147154
#### [Performance Monitoring](docs/performance.md#performance-monitoring)
148155
```ts
149156
import { } from '@angular/fire/performance';
150157
```
151158
</td>
159+
</tr>
160+
<tr>
152161
<td>
153162

154163
#### [Realtime Database](docs/database.md#realtime-database)
155164
```ts
156165
import { } from '@angular/fire/database';
157166
```
158167
</td>
159-
</tr>
160-
<tr>
161168
<td>
162169

163170
#### [Remote Config](docs/remote-config.md#remote-config)
164171
```ts
165172
import { } from '@angular/fire/remote-config';
166173
```
167174
</td>
175+
</tr>
176+
<tr>
168177
<td>
169178

170179
#### [App Check](docs/app-check.md#app-check)
171180
```ts
172181
import { } from '@angular/fire/app-check';
173182
```
174183
</td>
175-
</tr>
176-
<tr>
177184
<td>
178185

179186
#### [Vertex AI](docs/vertexai.md#vertex-ai)
180187
```ts
181188
import { } from '@angular/fire/vertexai';
182189
```
183190
</td>
184-
185191
</tr>
186192
</table>

docs/data-connect.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<small>
2+
<a href="https://github.com/angular/angularfire">AngularFire</a> &#10097; <a href="../README.md#developer-guide">Developer Guide</a> &#10097; Data Connect
3+
</small>
4+
5+
# Data Connect
6+
7+
Firebase Data Connect (now known as "Firebase SQL Connect" in the Firebase documentation) is a backend service that pairs a Cloud SQL for PostgreSQL database with GraphQL, generating type-safe SDKs to query and mutate your data.
8+
9+
[Learn more](https://firebase.google.com/docs/data-connect)
10+
11+
## Dependency Injection
12+
13+
As a prerequisite, ensure that `AngularFire` has been added to your project via
14+
```bash
15+
ng add @angular/fire
16+
```
17+
18+
Provide a Data Connect instance in the application's `app.config.ts`. `getDataConnect` takes a connector config that identifies your service, connector, and location; this is generated for you when you set up Data Connect and is also exported from your generated SDK:
19+
20+
```ts
21+
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
22+
import { provideDataConnect, getDataConnect } from '@angular/fire/data-connect';
23+
24+
const connectorConfig = {
25+
connector: 'my-connector',
26+
service: 'my-service',
27+
location: 'us-central1',
28+
};
29+
30+
export const appConfig: ApplicationConfig = {
31+
providers: [
32+
provideFirebaseApp(() => initializeApp({ ... })),
33+
provideDataConnect(() => getDataConnect(connectorConfig)),
34+
...
35+
],
36+
...,
37+
}
38+
```
39+
40+
Next inject `DataConnect` into your component:
41+
42+
```typescript
43+
import { Component, inject } from '@angular/core';
44+
import { DataConnect } from '@angular/fire/data-connect';
45+
46+
@Component({ ... })
47+
export class MyComponent {
48+
private dataConnect = inject(DataConnect);
49+
...
50+
}
51+
```
52+
53+
## Firebase API
54+
55+
AngularFire wraps the Firebase JS SDK to ensure proper functionality in Angular, while providing the same API.
56+
57+
Update the imports from `import { ... } from 'firebase/data-connect'` to `import { ... } from '@angular/fire/data-connect'` and follow the official documentation.
58+
59+
[Getting Started](https://firebase.google.com/docs/data-connect/quickstart)

0 commit comments

Comments
 (0)