Skip to content

feat(spanner): add send_message and ack_message to Transaction - #263

Open
torreypayne wants to merge 9 commits into
mainfrom
queues/3-transaction
Open

torreypayne wants to merge 9 commits into
mainfrom
queues/3-transaction

Conversation

@torreypayne

@torreypayne torreypayne commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Adds Transaction#send_message and Transaction#ack_message, so queue writes commit atomically with table writes. Both delegate to the transaction's Commit and take the same deliver_time: and ignore_not_found: keywords. The new Client#transaction test covers a transaction with only queue mutations, where the first one becomes the BeginTransaction mutation key.

Part 3 of 5, split out of #260.

@product-auto-label product-auto-label Bot added the api: spanner Issues related to the Spanner API. label Oct 12, 2026
@torreypayne
torreypayne added this pull request to stack #266 October 12, 2026 19:55
@torreypayne
torreypayne marked this pull request as ready for review October 13, 2026 20:17
@torreypayne
torreypayne requested a review from a team as a code owner October 13, 2026 20:17
…arguments

Replace the SendOptions and AckOptions classes with keyword arguments, as
agreed on #262. Adding an optional keyword later doesn't break callers,
and an unknown keyword still raises ArgumentError.

Also fix the key_list_value doc: it converts one key, not a list of keys.
# Conflicts:
#	google-cloud-spanner/lib/google/cloud/spanner/ack_options.rb
#	google-cloud-spanner/lib/google/cloud/spanner/send_options.rb
Transaction#send_message and #ack_message now take deliver_time: and
ignore_not_found: and pass them to the transaction's Commit, matching the
keyword arguments on Commit.
The examples wrapped text in a StringIO, which is only right for a queue
with a BYTES payload column. On a STRING column the gem would send the
Base64 text. Use a String and say the queue's payload column is
STRING(MAX), and add a separate BYTES example that wraps binary data.
…xample

Match the Commit#send_message examples: pass a String and say the
queue's payload column is STRING(MAX), instead of wrapping text in a
StringIO, which is only right for a BYTES payload column.
Base automatically changed from queues/2-commit to main October 21, 2026 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: spanner Issues related to the Spanner API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant