Skip to content

feat(firestore): support vector query in transactions - #14460

Merged
bhshkh merged 2 commits into
googleapis:mainfrom
bhshkh:fix/fs-vq-txn
Apr 21, 2026
Merged

feat(firestore): support vector query in transactions#14460
bhshkh merged 2 commits into
googleapis:mainfrom
bhshkh:fix/fs-vq-txn

Conversation

@bhshkh

@bhshkh bhshkh commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

Fixes #12837

  • Implements the unexported query() method on the VectorQuery struct in query.go. This satisfies the Queryer interface, allowing VectorQuery to be used natively with Transaction.Documents(q Queryer) and Transaction.GetAll(q Queryer).
  • Adds exported Serialize() and Deserialize([]byte) methods to VectorQuery, enabling developers to marshal and unmarshal vector queries back into protobuf format.

@bhshkh
bhshkh requested review from a team as code owners April 20, 2026 19:35
@product-auto-label product-auto-label Bot added the api: firestore Issues related to the Firestore API. label Apr 20, 2026
@bhshkh
bhshkh enabled auto-merge (squash) April 20, 2026 19:37

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a query() method to the VectorQuery struct and adds a new test case, TestRunTransaction_VectorQuery, to verify vector query functionality within transactions. Feedback suggests using a pointer receiver for the query() method to avoid unnecessary copying of the underlying Query struct and to prevent heap escape.

Comment thread firestore/query.go
Comment thread firestore/query.go Outdated
@bhshkh
bhshkh requested a review from hongalex April 21, 2026 15:52
@bhshkh
bhshkh merged commit 4b8c904 into googleapis:main Apr 21, 2026
11 checks passed
@bhshkh
bhshkh deleted the fix/fs-vq-txn branch April 21, 2026 18:29
shollyman pushed a commit that referenced this pull request Jul 9, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.23.0](firestore/v1.22.0...firestore/v1.23.0)
(2026-07-09)


### Features

* **firestore:** Add Data and DataTo methods to AggregationResult
([#14592](#14592))
([66c66c5](66c66c5)),
closes
[#13646](#13646)
* **firestore:** Add limit, offset, and languageCode options
([#20029](#20029))
([bfbbee6](bfbbee6))
* **firestore:** Configure client to support 16MB documents
([#14684](#14684))
([1a52421](1a52421))
* **firestore:** Support BSON types
([#14622](#14622))
([fac54ad](fac54ad))
* **firestore:** Support Transaction ReadTime
([#14615](#14615))
([b54d7a4](b54d7a4))
* **firestore:** Support vector query in transactions
([#14460](#14460))
([4b8c904](4b8c904))
* Update API sources and regenerate
([#19950](#19950))
([c7607be](c7607be))


### Bug Fixes

* **firestore:** Bubble up errors in BulkWriter
([#14481](#14481))
([3553da6](3553da6))
* **firestore:** Enforce backpressure in BulkWriter
([#12938](#12938))
([820d0a2](820d0a2)),
closes
[#11422](#11422)
* **firestore:** More precision fixes
([#20073](#20073))
([7843ebf](7843ebf))
* **firestore:** Retry transient connection errors during document reads
([#20057](#20057))
([875f97e](875f97e)),
closes
[#10350](#10350)
* **firestore:** Robust transaction rollback on cancellation
([#14687](#14687))
([7c5b013](7c5b013))
* **firestore:** Use higher precision for read times
([#20068](#20068))
([61471b8](61471b8))
* **firestore:** Use passthrough scheme for emulator connections
([#14616](#14616))
([f8eb671](f8eb671))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: firestore Issues related to the Firestore API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

firestore: vector queries not compatible with transaction

2 participants