Hi Jen-Shin :-)
Return from holidays I "git pull" and I start to play with the MySQL
Adapater:
require 'rubygems'
require 'dm-mapping'
dm = DataMapper.setup :default, 'mysql://root:[EMAIL PROTECTED]/moodle'
=> #<DataMapper::Adapters::MysqlAdapter:0x7f056d4a77b0
@uri=#<Addressable::URI:0x3f82b6a4de18 URI:mysql://
root:[EMAIL PROTECTED]/moodle>, @name=:default, @transactions={},
@field_naming_convention=DataMapper::NamingConventions::Field::Underscored,
@resource_naming_convention=DataMapper::NamingConventions::Resource::UnderscoredAndPluralized>
When I try to:
dm.storages_and_fields
TypeError: double unsigned not found for
DataMapper::Adapters::MysqlAdapter
Only add the data type at line 48 of mysql_adapater.rb:
when 'DOUBLE', 'DOUBLE UNSIGNED'; BigDecimal
and runs perfect :-)
I'll continue testing :-)
Best regards,
Xavier
On 16 ago, 20:53, Lin Jen-Shin <[EMAIL PROTECTED]> wrote:
> On Aug 16, 2:07 am, Xavier Belanche <[EMAIL PROTECTED]> wrote:
>
> > Thanks again, Lin!
>
> > I'm impatient for the MySQL adapter :-) If I can help you or anything
> > else, no doubt to say me if I can help you
>
> I've just released dm-mapping 0.6.0 a couple hours ago.
> You can find changes
> here:http://ludy.rubyforge.org/dm-mapping/files/CHANGES.html
>
> MySQL adapter was added since 0.5.0, but it seems missing
> many mysql data types to map to Ruby data type, because I
> used TypeMap in dm-core to reverse look up data type from
> database to Ruby type. dm-core wouldn't map Integer to
> TINYINT, MEDIUINT, OOOINT, etc., for sure.
>
> This was found when I tried 0.5.0 to connect to my phpBB database,
> and I fixed this in 0.6.0, introducing a switch case to find a
> suitable
> ruby type, mapping any INT to Integer.
>
> I am not familiar with database,
> and I wonder if this is ok for such mapping.
>
> You could tell me what do you think of this plugin,
> or bugs, or feature requests, or pointing out
> it's wrong somewhere in this plugin, it would be very helpful. :)
>
> You can install it via gem:> sudo gem install dm-mapping
>
> or grab all source code from github:http://github.com/godfat/dm-mapping
>
> and here's the latest rdoc generated:http://ludy.rubyforge.org/dm-mapping/
>
> cheers,
>
> p.s. Lin is my family name
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"DataMapper" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---