Skip to content

Commit 91671e0

Browse files
committed
update files for 0.2.0 release
1 parent ed4841e commit 91671e0

File tree

4 files changed

+44
-8
lines changed

4 files changed

+44
-8
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## 0.2.0 (August 16th, 2010)
4+
* switch back to letting libmysql manage all allocation/thread-state/freeing for the connection
5+
* cache various numeric type conversions in hot-spots of the code for a little speed boost
6+
* ActiveRecord adapter moved into Rails 3 core
7+
** Don't worry 2.3.x users! We'll either release the adapter as a separate gem, or try to get it into 2.3.9
8+
* Fix for the "closed MySQL connection" error (GH #34)
9+
* Fix for the "can't modify frozen object" error in 1.9.2 (GH #37)
10+
* Introduce cascading query and result options (more info in README)
11+
* Sequel adapter pulled into core (will be in the next release - 3.15.0 at the time of writing)
12+
* add a safety check when attempting to send a query before a result has been fetched
13+
314
## 0.1.9 (July 17th, 2010)
415
* Support async ActiveRecord access with fibers and EventMachine (mperham)
516
* string encoding support for 1.9, respecting Encoding.default_internal

README.rdoc

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,22 @@ If you'd like to see either of these (or others), open an issue and start buggin
102102

103103
== Timezones
104104

105-
You can set the :timezone option to :local or :utc to tell Mysql2 which timezone you'd like to have Time objects in
105+
Mysql2 now supports two timezone options:
106+
107+
:database_timezone - this is the timezone Mysql2 will assume fields are already stored as, and will use this when creating the initial Time objects in ruby
108+
:application_timezone - this is the timezone Mysql2 will convert to before finally handing back to the caller
109+
110+
In other words, if :database_timezone is set to :utc - Mysql2 will create the Time objects using Time.utc(...) from the raw value libmysql hands over initially.
111+
Then, if :application_timezone is set to say - :local - Mysql2 will then convert the just-created UTC Time object to local time.
112+
113+
Both options only allow two values - :local or :utc - with the exception that :application_timezone can be [and defaults to] nil
114+
115+
== Casting "boolean" columns
116+
117+
You can now tell Mysql2 to cast tinyint(1) fields to boolean values in Ruby with the :cast_booleans option.
118+
119+
client = Mysql2::Client.new
120+
result = client.query("SELECT * FROM table_with_boolean_field", :cast_booleans => true)
106121

107122
== Async
108123

@@ -123,14 +138,17 @@ If you need multiple query concurrency take a look at using a connection pool.
123138

124139
== ActiveRecord
125140

126-
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".
127-
That was easy right? :)
141+
The ActiveRecord adapter has been removed from the mysql2 gem and is now part of Rails 3 core. We'll be releasing a separate gem or trying to get it into 2.3.9 for 2.3.x users.
128142

129143
== Asynchronous ActiveRecord
130144

131145
You can also use Mysql2 with asynchronous Rails (first introduced at http://www.mikeperham.com/2010/04/03/introducing-phat-an-asynchronous-rails-app/) by
132146
setting the adapter in your database.yml to "em_mysql2". You must be running Ruby 1.9, thin and the rack-fiber_pool middleware for it to work.
133147

148+
== Sequel
149+
150+
The Sequel adapter was pulled out into Sequel core (will be part of the next release) and can be used by specifying the "mysql2://" prefix to your connection specification.
151+
134152
== EventMachine
135153

136154
The mysql2 EventMachine deferrable api allows you to make async queries using EventMachine,

lib/mysql2.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
#
1212
# A modern, simple and very fast Mysql library for Ruby - binding to libmysql
1313
module Mysql2
14-
VERSION = "0.1.9"
14+
VERSION = "0.2.0"
1515
end

mysql2.gemspec

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
Gem::Specification.new do |s|
77
s.name = %q{mysql2}
8-
s.version = "0.1.9"
8+
s.version = "0.2.0"
99

1010
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
1111
s.authors = ["Brian Lopez"]
12-
s.date = %q{2010-08-01}
12+
s.date = %q{2010-08-16}
1313
s.email = %q{[email protected]}
1414
s.extensions = ["ext/mysql2/extconf.rb"]
1515
s.extra_rdoc_files = [
@@ -23,12 +23,15 @@ Gem::Specification.new do |s|
2323
"Rakefile",
2424
"VERSION",
2525
"benchmark/active_record.rb",
26+
"benchmark/allocations.rb",
2627
"benchmark/escape.rb",
2728
"benchmark/query_with_mysql_casting.rb",
2829
"benchmark/query_without_mysql_casting.rb",
2930
"benchmark/sequel.rb",
3031
"benchmark/setup_db.rb",
32+
"benchmark/thread_alone.rb",
3133
"examples/eventmachine.rb",
34+
"examples/threaded.rb",
3235
"ext/mysql2/client.c",
3336
"ext/mysql2/client.h",
3437
"ext/mysql2/extconf.rb",
@@ -51,7 +54,10 @@ Gem::Specification.new do |s|
5154
"spec/mysql2/result_spec.rb",
5255
"spec/rcov.opts",
5356
"spec/spec.opts",
54-
"spec/spec_helper.rb"
57+
"spec/spec_helper.rb",
58+
"tasks/benchmarks.rake",
59+
"tasks/compile.rake",
60+
"tasks/vendor_mysql.rake"
5561
]
5662
s.homepage = %q{http://github.com/brianmario/mysql2}
5763
s.rdoc_options = ["--charset=UTF-8"]
@@ -64,7 +70,8 @@ Gem::Specification.new do |s|
6470
"spec/mysql2/error_spec.rb",
6571
"spec/mysql2/result_spec.rb",
6672
"spec/spec_helper.rb",
67-
"examples/eventmachine.rb"
73+
"examples/eventmachine.rb",
74+
"examples/threaded.rb"
6875
]
6976

7077
if s.respond_to? :specification_version then

0 commit comments

Comments
 (0)