stmichael / data-import

sequel based dsl to migrate data from a legacy database to a new home.
MIT License
42 stars 9 forks source link

Import without a source table #20

Closed stmichael closed 12 years ago

stmichael commented 12 years ago

It should be possible to import without a source table to insert for example static data.

import 'Static objects' do
  to 'objects'

  after do
    target_database.db[:objects].insert(:name => 'a box')
    target_database.db[:objects].insert(:name => 'my cat')
  end
end
senny commented 12 years ago

This relates to #1 but I think it makes sense to support the NullReader on the SimpleDefinition for this specific use-case. The Sequel Definition from #1 won't have all the goodies the SimpleDefinition has and It would make this particular scenario harder to implement.

Since the commit adds nearly no complexity I'm fine with adding this.