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

undefined method `size' for an instance of Trilogy::Result #206

Open
pasl opened this issue Nov 2, 2024 · 0 comments
Open

undefined method `size' for an instance of Trilogy::Result #206

pasl opened this issue Nov 2, 2024 · 0 comments

Comments

@pasl
Copy link

pasl commented Nov 2, 2024

Hi,

I'm unsure if Trilogy is designed as a direct replacement for Mysql2 without compatibility issues, but I've encountered one.

undefined method `size' for an instance of Trilogy::Result

With MySQL2

> results = ActiveRecord::Base.connection.execute("select sn from products")
   (12.8ms)  select sn from products
 => 
#<Mysql2::Result:0x00000001623d13d8
... 
> results.size
 => 27706 
> results.count
 => 27706 

With Trilogy

> results = ActiveRecord::Base.connection.execute("select sn from products")
   (38.7ms)  select sn from products
 => 
#<Trilogy::Result:0x0000000127554f60
... 
> results.size
...gems/irb-1.14.0/lib/irb.rb:1285:in `full_message': undefined method `size' for an instance of Trilogy::Result (NoMethodError)

results.size
       ^^^^^
3.3.4 :003 > results.count
 => 27706 

I am using : trilogy (2.9.0) and mysql2 (0.5.6)

Thank you

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

No branches or pull requests

1 participant