jruby / activerecord-jdbc-adapter

JRuby's ActiveRecord adapter using JDBC.
BSD 2-Clause "Simplified" License
461 stars 385 forks source link

How to use mysql streams? #1029

Open ajinkyapisal opened 5 years ago

ajinkyapisal commented 5 years ago

Does this library provide a method for accessing MySQL stream similar to mysql2 adapter?

Sources: Mysql2 Adapter - https://github.com/brianmario/mysql2#streaming Mysql documentation - https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-implementation-notes.html

kares commented 5 years ago

you can access the jdbc connection from your AR connection: connection.jdbc_connection from there you could create a statement and set stmt.setFetchSize(Integer.MIN_VALUE)

not sure whether where we should add that since we do not emulate the mysql2 API that much client.query("SELECT * FROM really_big_Table", :stream => true) we simply do not have that as AR-JDBC implements AR API: connection.exec_query not sure it makes sense to make that streamable?