updating files for 0.1.3 release
This commit is contained in:
parent
7caf1b6b6a
commit
d7c146e322
@ -1,5 +1,10 @@
|
||||
# Changelog
|
||||
|
||||
## 0.1.3 (April 15th, 2010)
|
||||
* added an EventMachine Deferrable API
|
||||
* added an ActiveRecord connection adapter
|
||||
** should be compatible with 2.3.5 and 3.0 (including Arel)
|
||||
|
||||
## 0.1.2 (April 9th, 2010)
|
||||
* fix a bug (copy/paste fail) around checking for empty TIME values and returning nil (thanks @marius)
|
||||
|
||||
|
28
README.rdoc
28
README.rdoc
@ -75,6 +75,32 @@ NOTE: Because of the way MySQL's query API works, this method will block until t
|
||||
So if you really need things to stay async, it's best to just monitor the socket with something like EventMachine.
|
||||
If you need multiple query concurrency take a look at using a connection pool.
|
||||
|
||||
== ActiveRecord
|
||||
|
||||
To use the ActiveRecord driver, all you should need to do is have this gem installed and set the adapter in your database.yml to "mysql2".
|
||||
That was easy right? :)
|
||||
|
||||
== EventMachine
|
||||
|
||||
The mysql2 EventMachine deferrable api allows you to make async queries using EventMachine,
|
||||
while specifying callbacks for success for failure. Here's a simple example:
|
||||
|
||||
require 'mysql2/em'
|
||||
|
||||
EM.run do
|
||||
client1 = Mysql2::EM::Client.new
|
||||
defer1 = client1.query "SELECT sleep(3) as first_query"
|
||||
defer1.callback do |result|
|
||||
puts "Result: #{result.to_a.inspect}"
|
||||
end
|
||||
|
||||
client2 = Mysql2::EM::Client.new
|
||||
defer2 = client2.query "SELECT sleep(1) second_query"
|
||||
defer2.callback do |result|
|
||||
puts "Result: #{result.to_a.inspect}"
|
||||
end
|
||||
end
|
||||
|
||||
== Compatibility
|
||||
|
||||
The specs pass on my system (SL 10.6.3, x86_64) in these rubies:
|
||||
@ -85,6 +111,8 @@ The specs pass on my system (SL 10.6.3, x86_64) in these rubies:
|
||||
* ruby-trunk
|
||||
* rbx-head
|
||||
|
||||
The ActiveRecord driver should work on 2.3.5 and 3.0
|
||||
|
||||
== Yeah... but why?
|
||||
|
||||
Someone: Dude, the Mysql gem works fiiiiiine.
|
||||
|
@ -5,5 +5,5 @@ require 'mysql2_ext'
|
||||
#
|
||||
# A modern, simple and very fast Mysql library for Ruby - binding to libmysql
|
||||
module Mysql2
|
||||
VERSION = "0.1.2"
|
||||
VERSION = "0.1.3"
|
||||
end
|
@ -5,11 +5,11 @@
|
||||
|
||||
Gem::Specification.new do |s|
|
||||
s.name = %q{mysql2}
|
||||
s.version = "0.1.2"
|
||||
s.version = "0.1.3"
|
||||
|
||||
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
||||
s.authors = ["Brian Lopez"]
|
||||
s.date = %q{2010-04-09}
|
||||
s.date = %q{2010-04-15}
|
||||
s.email = %q{seniorlopez@gmail.com}
|
||||
s.extensions = ["ext/extconf.rb"]
|
||||
s.extra_rdoc_files = [
|
||||
@ -22,14 +22,21 @@ Gem::Specification.new do |s|
|
||||
"README.rdoc",
|
||||
"Rakefile",
|
||||
"VERSION",
|
||||
"benchmark/active_record.rb",
|
||||
"benchmark/escape.rb",
|
||||
"benchmark/query.rb",
|
||||
"benchmark/setup_db.rb",
|
||||
"examples/eventmachine.rb",
|
||||
"ext/extconf.rb",
|
||||
"ext/mysql2_ext.c",
|
||||
"ext/mysql2_ext.h",
|
||||
"lib/active_record/connection_adapters/mysql2_adapter.rb",
|
||||
"lib/arel/engines/sql/compilers/mysql2_compiler.rb",
|
||||
"lib/mysql2.rb",
|
||||
"lib/mysql2/em.rb",
|
||||
"mysql2.gemspec",
|
||||
"spec/active_record/active_record_spec.rb",
|
||||
"spec/em/em_spec.rb",
|
||||
"spec/mysql2/client_spec.rb",
|
||||
"spec/mysql2/result_spec.rb",
|
||||
"spec/rcov.opts",
|
||||
@ -42,9 +49,12 @@ Gem::Specification.new do |s|
|
||||
s.rubygems_version = %q{1.3.6}
|
||||
s.summary = %q{A simple, fast Mysql library for Ruby, binding to libmysql}
|
||||
s.test_files = [
|
||||
"spec/mysql2/client_spec.rb",
|
||||
"spec/active_record/active_record_spec.rb",
|
||||
"spec/em/em_spec.rb",
|
||||
"spec/mysql2/client_spec.rb",
|
||||
"spec/mysql2/result_spec.rb",
|
||||
"spec/spec_helper.rb"
|
||||
"spec/spec_helper.rb",
|
||||
"examples/eventmachine.rb"
|
||||
]
|
||||
|
||||
if s.respond_to? :specification_version then
|
||||
|
Loading…
Reference in New Issue
Block a user