Ted, My lib was just an initial spike to print ruby code from a DataMapper::Model, iirc all it provided was essentially a #to_ruby method. Nowadays the canonical repo is: https://github.com/yogo/dm-reflection but I'm unsure about the state of completeness or if it is compatible with 1.1. In any case, this is/will-be a really interesting gem and once more work on do-schema is complete, we will definitely get it to a point where it will be able to spit out DM models in ruby for a lot of db schemas you throw it at.
cheers snusnu On Thu, Apr 14, 2011 at 00:27, Ted Han <[email protected]> wrote: > There's an old lib that snusnu created called dm-reflection which inspects > a DB and can generate models from it (i think). I've not used it though > http://github.com/snusnu/dm-reflection > > > On Wed, Apr 13, 2011 at 6:25 PM, RipTheJacker <[email protected]> wrote: > >> There isn't really a schema:dump equivalent. You can see the schema of >> a model by looking at the property list in the model file, as Yi Wen >> suggested. Here is a quick way to see all of them in IRB or a Rake >> task, if you have all of your models loaded: >> >> DataMapper::Model.descendants.each do |model| >> puts model.name >> model.properties.each{|p| puts "#{p.name} => #{p.primitive}" } >> puts >> end >> >> As for schema:load, using db:automigrate (DataMapper.auto_migrate!) is >> the same. >> >> On Apr 12, 10:01 pm, Yi Wen <[email protected]> wrote: >> > Interesting question. I myself am also new to DM. But it seems if you >> need >> > to know the schema of a table, just open the model file, all the >> information >> > is available there. >> > >> > about schema load, is rake db:automigrate the same? >> >> -- >> 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. >> >> > -- > 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. > -- 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.
