Skip to content

Conversation

Maimer
Copy link
Contributor

@Maimer Maimer commented Jul 3, 2025

When updating rails to 8.0.2 (or 8.0.0 or 8.0.1) and udpating activerecord-cockroachdb-adapter to the corresponding version of either 8.0.0 or 8.0.1 in my application it failed to be able to create a database from scratch.

Running the command:

bundle exec db:drop db:create db:migrate

Results in the following error:

NoMethodError: undefined method 'execute_and_clear' for an instance of ActiveRecord::ConnectionAdapters::CockroachDBAdapter (NoMethodError)

            result = execute_and_clear(query, "SCHEMA", [], allow_retry: true, materialize_transactions: false)
                     ^^^^^^^^^^^^^^^^^

When looking at the activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb I see that it had been removed in the following commit: rails/rails@fd24e5b and replaced with usage of the internal_execute command instead, which is part of a larger PR: rails/rails#52428 that is looking to standardize the interface of the various database adapters.

@rafiss rafiss requested a review from BuonOmo July 3, 2025 18:48
@rafiss
Copy link
Contributor

rafiss commented Jul 3, 2025

Thanks for submitting this! Could you add more information in the PR description that describes what functionality was broken? i.e., provide an example code snippet that was having issues or provide the error that you encountered before making this patch? This will help us with documenting the bugfix in release notes.

@Maimer
Copy link
Contributor Author

Maimer commented Jul 3, 2025

Thanks for submitting this! Could you add more information in the PR description that describes what functionality was broken? i.e., provide an example code snippet that was having issues or provide the error that you encountered before making this patch? This will help us with documenting the bugfix in release notes.

I have updated the PR description, let me know if you need more details.

@Maimer
Copy link
Contributor Author

Maimer commented Jul 7, 2025

@rafiss I think the tests failed due to some flakiness. Any chance you can rerun it and let me know if there is anything else that needs to be done here?

@BuonOmo
Copy link
Collaborator

BuonOmo commented Jul 9, 2025

I've rerun the tests. But by looking at them, the fairness_by_group test has already failed in other branches so I would merge this PR confidentely. Could you add a one-liner for the CHANGELOG.md? Besides that, LGTM

@rafiss
Copy link
Contributor

rafiss commented Jul 9, 2025

Thanks for your contribution! We should make an 8.0.2 release for this adapter.

@rafiss rafiss merged commit f01c835 into cockroachdb:master Jul 9, 2025
8 of 10 checks passed
@Maimer
Copy link
Contributor Author

Maimer commented Jul 9, 2025

I've rerun the tests. But by looking at them, the fairness_by_group test has already failed in other branches so I would merge this PR confidentely. Could you add a one-liner for the CHANGELOG.md? Besides that, LGTM

Looks like it got merged before I could update the CHANGELOG.md on this PR. Do you want me to make a PR for that or do you want to handle that with the release? @rafiss @BuonOmo

@BuonOmo
Copy link
Collaborator

BuonOmo commented Jul 10, 2025

We'll fix that later no big deal, thank you @Maimer!

@Maimer
Copy link
Contributor Author

Maimer commented Jul 10, 2025

We'll fix that later no big deal, thank you @Maimer!

Are you or @rafiss able to handle the release? This is blocking for me currently, so it would great if we could get that new version released. 🙏

@BuonOmo
Copy link
Collaborator

BuonOmo commented Jul 10, 2025

I do not have sufficient permissions. In the meantime you could refer to the commit in your gemfile (gem "activerecord-cockroachdb-adapter", git: "[email protected]:cockroachdb/activerecord-cockroachdb-adapter", ref: "f01c835")

@Maimer
Copy link
Contributor Author

Maimer commented Jul 10, 2025

I do not have sufficient permissions. In the meantime you could refer to the commit in your gemfile (gem "activerecord-cockroachdb-adapter", git: "[email protected]:cockroachdb/activerecord-cockroachdb-adapter", ref: "f01c835")

Thanks, I'll have to wait for @rafiss to publish. Using a git referenced gem doesn't allow me to verify the checksum of the gem itself, so while it's useful for testing / development, it's not the best practice for production.

@dikshant
Copy link
Contributor

@rafiss could you help cut out a release?

@rafiss
Copy link
Contributor

rafiss commented Jul 14, 2025

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.

4 participants