activerecord-jdbc-adapter icon indicating copy to clipboard operation
activerecord-jdbc-adapter copied to clipboard

How to use mysql streams?

Open ajinkyapisal opened this issue 6 years ago • 1 comments

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

ajinkyapisal avatar Aug 28 '19 11:08 ajinkyapisal

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?

kares avatar Sep 30 '19 12:09 kares