Skip to content

Conversation

@bplatz
Copy link
Contributor

@bplatz bplatz commented Jan 9, 2026

Summary

Adds streaming query API that emits individual results as they are produced, rather than collecting all results into a vector. Supports all query types (SELECT, SELECT ONE, CONSTRUCT) and formats (FQL, SPARQL).

Note this is the same functionality in #1133 which I've closed in favor of this. That PR was based on the bm25 branch and this one is based on 'main' to aid review ease.

Key Features

  • Memory efficient streaming: Results emitted individually for large result sets
  • Metadata tracking: Optional :meta tracking emits final metadata map after results
  • CONSTRUCT streaming: Emits ungrouped graph nodes without @graph wrapper
  • Full query support: ORDER BY, GROUP BY, and aggregates (collect before emitting)
  • Cache validation: Early validation rejects :cache option for streaming queries

API Functions

  • fluree.db.api/query-stream - Stream query against database
  • fluree.db.api/query-connection-stream - Stream query via connection

Metadata Format

When :meta true is enabled, final result is:

{:_fluree-meta {:fuel 123, :time "5ms", :policy {...}, :status 200}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants