Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
mysql_blob_streaming GEM
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
ext/mysql_blob_streaming
lib
test
.gitignore
.travis.yml
Gemfile
MIT-LICENSE
README.markdown
Rakefile
mysql_blob_streaming.gemspec

README.markdown

MysqlBlobStreaming

Build Status

A blob streaming extension for the native Ruby-MySQL2 adaptor. It provides the class MysqlBlobStreaming, which gives the mysql2 adaptor the ability of streaming blobs right out of the MySQL database.

(c) 2008-2012 Infopark AG. See MIT-LICENSE for licensing details.

Usage

require 'mysql_blob_streaming'
require 'mysql2'

client = Mysql2::Client.new(...)
query = "SELECT data FROM table_name WHERE id = '23'"
buffer_size = 1024000 # number of bytes per chunk

MysqlBlobStreaming.stream(client, query, buffer_size) do |chunk|
  # do something with the chunk e.g. write it to file.
end

Dependencies

Building

gem build mysql_blob_streaming.gemspec

Installation

Install it like any other Gem:

gem install mysql_blob_streaming-X.X.X.gem

Run it with root privileges if needed.

Something went wrong with that request. Please try again.