Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support bit-reversed sequences #276

Merged
merged 11 commits into from
Dec 20, 2023

Conversation

olavloite
Copy link
Collaborator

@olavloite olavloite commented Nov 28, 2023

Support bit-reversed sequences and THEN RETURN clauses to generate primary key values.

The current example uses FARM_FINGERPRINT(GENERATE_UUID()) instead of GET_NEXT_SEQUENCE_VALUE(SEQUENCE singer_sequence) for the time being, as bit-reversed sequences are not yet supported on the emulator. All other parts of this feature will remain unchanged once this is supported.

@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/ruby-spanner-activerecord API. label Nov 28, 2023
@olavloite olavloite changed the base branch from main to interleaved-tables-7-1 December 10, 2023 18:04
@olavloite olavloite marked this pull request as ready for review December 18, 2023 14:17
@olavloite olavloite requested a review from a team as a code owner December 18, 2023 14:17
@olavloite olavloite requested a review from hengfengli December 18, 2023 14:17
Copy link
Collaborator

@hengfengli hengfengli left a comment

Choose a reason for hiding this comment

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

LGTM

@olavloite olavloite merged commit eb16d73 into interleaved-tables-7-1 Dec 20, 2023
32 checks passed
@olavloite olavloite deleted the bit-reversed-sequences branch December 20, 2023 08:33
olavloite added a commit that referenced this pull request Dec 20, 2023
* feat: support Rails 7.1

* chore: make stuff compatible with 7.1

* test: add 7.1 to test matrix

* fix: replace constant with literal

* chore: fix rubocop issues

* chore: cleanup

* chore: assign shorter class names

* feat: interleaved tables with built-in composite pk

Adds support for interleaved tables using the built-in support for
composite primary keys in Rails 7.1. The original support for
interleaved tables using the third-party composite-primary-key gem
still works for Rails vresions < 7.1. Anyone updgrading from Rails 7.0
to 7.1 and using interleaved tables must update their code to use the
new built-in feature for composite primary keys, and must remove the
third-party composite primary keys gem. The latter will automatically
show up as a problem, as there is no version of that gem that supports
Rails 7.1.

Fixes #281

* docs: add sample for interleaved tables

* docs: make interleaved tables before/after 7.1 work

* chore: fix rubocop issues

* feat: support bit-reversed sequences (#276)

* feat: support bit-reversed sequences

* chore: cleanup

* fix: add pk to returning statement for Rails 7.1 and higher

* chore: fix rubocop issues

* test: add mock server + acceptance tests

* test: fix expected sql for prod

* fix: only check positive ID for prod

* docs: add example for using bit-reversed sequence

* chore: address review comments
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 googleapis/ruby-spanner-activerecord API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants