Skip to content
FIRERUN.

The BaaS & deploy-platform newsroom for builders

Subscribe

Firebase

Firebase SQL Connect Streaming Lands in the JavaScript SDK

The Firebase JS SDK just gained streaming for SQL Connect, letting web apps subscribe to live PostgreSQL data using the @refresh directive.

Abstract flat-vector editorial illustration for "Firebase SQL Connect Streaming Lands in the JavaScript SDK"

Firebase shipped streaming support for SQL Connect in the JavaScript SDK this month, making the @refresh directive (announced at Cloud Next in April) usable in web apps for the first time.

Key Takeaways

  • JS SDK streaming support for SQL Connect is rolling out and will reach all projects by the end of June 2026 (Firebase JS SDK release notes).
  • Eight new expression functions landed alongside streaming: parent, timestamp_trunc, timestamp_diff, timestamp_extract, nor, switchOn, ifNull, and coalesce.
  • Any SQL Connect query can become a live subscription. The SDK pushes updates when backend data changes, without polling.
  • Streaming operations are billed at the same rate as standard queries: $0.90 per million operations (Firebase pricing).

What the @refresh directive does

SQL Connect’s realtime subscriptions bind a query to a stream of results. Annotate a query with @refresh and the client SDK holds an open connection, applying incremental updates as they arrive:

query GetLeaderboard @refresh {
  scores(orderBy: { score: DESC }, limit: 10) {
    player
    score
  }
}

Refresh behavior is configurable: trigger on a time interval, or tie it to a specific mutation so a score write only updates the leaderboard subscribers that care about it. The SQL Connect SDK also ships query-level and entity-level caching. The app shows cached data immediately, then replaces it when the subscription delivers fresh results (Realtime PostgreSQL: From Data Connect to SQL Connect, Firebase Blog, April 2026).

New expression functions

Eight functions joined the SQL Connect expression language in this release. timestamp_trunc and timestamp_diff cover date bucketing, specifically the hourly or daily groupings common in dashboards. switchOn provides multi-branch conditional logic, avoiding chains of nested ifNull calls. coalesce returns the first non-null value from a list, useful for fallback lookups across normalized tables. parent navigates document hierarchy in a single expression.

All eight work in both standard queries and @refresh-annotated subscriptions.

Availability

The rollout is gradual. If the streaming subscription API isn’t in your project yet, it should arrive before July 1. SQL Connect requires a Cloud SQL Postgres backend; Realtime Database and Firestore are unaffected. The feature is part of the broader SQL Connect product that replaced Firebase Data Connect at Cloud Next 2026; existing Data Connect project APIs are unchanged (Firebase SQL Connect).

Stay in the loop

Get new articles in your inbox

We'll only email you when a new article drops. Unsubscribe anytime.