|
|
the first solution that comes to mind is to add a mode to LodableFixture
objects so they can load data as either "insert" or "refresh"
currently data is inserted from DataSet objects. This is great until you
want to mix and match sets that were extracted from real data. Some of
those sets will point to the same rows in a database. It seems useful to
have an option where you can "update or save" a row from a DataSet.
The downsides:
- you would have to define a primary key for each row. for every row?
- old data might get overwritten by new data and in an unpredicatable
order. This would be hard to debug if you didn't know you were doing it.
The idea here is not to accomodate data already existing in a database
(although that might be a use case) but to make the combination of DataSet
objects with duplicate rows possible.
Maybe a better solution is to change the internal registry to be keyed by
storable object instead of DataSet class object? I.E. in today's fixture,
two DataSet objects could be named the same but since they could be two
different class objects from separate modules, they would be treated as
unique DataSets. No, that wouldn't work because the second DataSet may
have additional rows and it would be ignored.
|