Firebase Data Connect provides a managed PostgreSQL database with GraphQL APIs and type-safe SDK generation for web and mobile applications.
Manage Data Connect services and their lifecycle.
/**
* List all deployed Data Connect services
* @param options - Configuration options
* @returns Promise resolving to array of service objects
*/
function dataconnectServicesList(options?: Options): Promise<any[]>;Manage SQL schema, migrations, and database operations.
/**
* Compare and display differences between local and deployed schemas
* @param serviceId - Service identifier (optional)
* @param options - Configuration options
* @returns Promise resolving when diff completes
*/
function dataconnectSqlDiff(
serviceId?: string,
options?: Options
): Promise<void>;
/**
* Set up CloudSQL database for Data Connect service
* @param serviceId - Service identifier (optional)
* @param options - Configuration options
* @returns Promise resolving when setup completes
*/
function dataconnectSqlSetup(
serviceId?: string,
options?: Options
): Promise<void>;
/**
* Apply schema migrations to the database
* @param serviceId - Service identifier (optional)
* @param options - Configuration options
* @returns Promise resolving when migration completes
*/
function dataconnectSqlMigrate(
serviceId?: string,
options?: Options & {
/** Automatically approve migration without confirmation */
auto?: boolean;
}
): Promise<void>;
/**
* Grant necessary permissions for Data Connect service
* @param serviceId - Service identifier (optional)
* @param options - Configuration options
* @returns Promise resolving when permissions are granted
*/
function dataconnectSqlGrant(
serviceId?: string,
options?: Options
): Promise<void>;
/**
* Open interactive SQL shell for the database
* @param serviceId - Service identifier (optional)
* @param options - Configuration options
* @returns Promise resolving when shell session ends
*/
function dataconnectSqlShell(
serviceId?: string,
options?: Options
): Promise<void>;Generate type-safe SDKs for web and mobile platforms.
/**
* Generate typed SDKs for Data Connect connectors
* @param options - Configuration options
* @returns Promise resolving when SDK generation completes
*/
function dataconnectSdkGenerate(options?: Options & {
/** Watch for changes and regenerate SDKs automatically */
watch?: boolean;
}): Promise<void>;import * as client from "firebase-tools";
// List all Data Connect services
const services = await client.dataconnect.services.list({
project: "my-project"
});
console.log(`Found ${services.length} Data Connect services`);
services.forEach(service => {
console.log(`- ${service.name}`);
});// Set up CloudSQL database
await client.dataconnect.sql.setup("my-service", {
project: "my-project"
});
// Check schema differences
await client.dataconnect.sql.diff("my-service", {
project: "my-project"
});
// Apply migrations
await client.dataconnect.sql.migrate("my-service", {
project: "my-project",
auto: true
});
// Grant permissions
await client.dataconnect.sql.grant("my-service", {
project: "my-project"
});// Generate SDKs for all configured connectors
await client.dataconnect.sdk.generate({
project: "my-project"
});
// Generate SDKs with watch mode
await client.dataconnect.sdk.generate({
project: "my-project",
watch: true
});# List all Data Connect services
firebase dataconnect:services:list# Set up CloudSQL database
firebase dataconnect:sql:setup my-service
# Check schema differences
firebase dataconnect:sql:diff my-service
# Apply migrations with auto-approval
firebase dataconnect:sql:migrate my-service --auto
# Grant necessary permissions
firebase dataconnect:sql:grant my-service
# Open SQL shell
firebase dataconnect:sql:shell my-service# Generate SDKs
firebase dataconnect:sdk:generate
# Generate with watch mode
firebase dataconnect:sdk:generate --watchData Connect services are configured through dataconnect.yaml files that define:
sql:migrate command