Articles tagged with 'DataMapper'
Writing DataMapper Adapters - A Tutorial
Mar 31, 2009
The adapter API for DataMapper has been in a bit of flux recently. When I submitted my proposal for a talk at MountainWest, adapters were irritatingly complex to write. You just needed to know too much about DataMapper's internals to be able to write one. A week before the conference began, I started a significant effort to re-write the API to make it easier. I succeeded, a little too well; my 30 minute talk only took 15. Since then, I've written a couple more adapters from scratch, and refined the API further. This post will serve as notes on the changes that I've made, and a tutorial on writing adapters.
DataMapper Echo Adapter
Mar 12, 2009
I just wrote a simple adapter that can be used to investigate the DM Adapter API, and debug your own adapter. Its really simple to use:
A Response to "Database Versioning"
Mar 3, 2009
I was just going to post a comment in reply to Adam Wiggins's Database Versioning post, but it ended up being pretty long, so I'll post a response here instead.
DataMapper 0.9.6 released
Oct 13, 2008
I just pushed 0.9.6 of dm-core, dm-more and data_objects up to rubyforge, as well as 0.9.8 of extlib. There's several bugfixes that were applied in the runup to merbcamp. This is also preparing for the imminent release of merb 1.0RC1.
HOWTO: DataMapper - Setting the default repository for a model
Aug 29, 2008
Had to google for quite a while before I was able to find the solution. Essentially, I have a model that I want to always use a different repository than what I #setup
in :default
. To do that:
Spec'ing Migrations (A Tutorial)
May 23, 2008
I realized I haven't blogged about (IMHO) the neatest feature of DataMapper's migrations yet. One of the more harrowing experiences for me in Rails is upgrading a production server with live data, and hoping your migration handles all the existing data correctly. You can dump the database, and attempt the migration on a clone, and hand-examine the data to make sure it was correct, but that feels very non-ruby-like to me. With the spec groups and matchers available in DataMapper migrations, though, you can spec your migrations and be certain that it will work correctly, and translate all your edge-case data correctly.
DM Migrations (now with 100% more helpers!)
Feb 12, 2008
Added some helpers to the DataMapper Migrations I've been writing. These helpers just build up some SQL, and feed it into #execute.
Idealized Migration DSL
Jan 8, 2008
There's a discussion in the datamapper group about how to do migrations. I've thrown together an idealized DSL for how the migrations themselves should look.