[YLUG] Parsable Rack Diagrams
Robert Hulme
rob at robhulme.com
Tue Aug 7 20:47:33 BST 2007
> $ rackgraph --dump-data --environment-dir /srv/rackgraph/foo > dump.sql
> This would produce an SQL dump file (with SQL commands to load data
> into the rackgraph schema) that the user can do with what they choose.
> $ rackgraph --load-data --environment-dir /srv/rackgraph/foo < dump.sql
That sounds moderately nice actually.
Might I suggest the following improvement?
I'm going to talk in terms of Ruby because that's what I know. I
believe there are similar things with SQLAlchemy and Django, and all
kinds of other heretical Pythonic things...
You could use an ORM like ActiveRecord or Nitro/Og in Ruby to act as a
store for all your objects with an 'in memory' sqlite backend. Then
whenever the app finishes what it's doing (I imagine you just call it
from the command line now and then) you dump all the objects to disk
using YAML or JSON or something.
When the app starts it would load all the objects from disk and
recreate them in the in memory sqlite DB.
I'm suggesting doing it that way because I think JSON / YAML is more
'human readable' in a diff than a SQL insert statement.
-Rob
--
http://www.robhulme.com/
http://robhu.livejournal.com/
Many orthodox people speak as though it were the business of sceptics
to disprove received dogmas rather than of dogmatists to prove them.
This is, of course, a mistake. If I were to suggest that between the
Earth and Mars there is a china teapot revolving about the sun in an
elliptical orbit, nobody would be able to disprove my assertion
provided I were careful to add that the teapot is too small to be
revealed even by our most powerful telescopes. But if I were to go on
to say that, since my assertion cannot be disproved, it is intolerable
presumption on the part of human reason to doubt it, I should rightly
be thought to be talking nonsense. If, however, the existence of such
a teapot were affirmed in ancient books, taught as the sacred truth
every Sunday, and instilled into the minds of children at school,
hesitation to believe in its existence would become a mark of
eccentricity and entitle the doubter to the attentions of the
psychiatrist in an enlightened age or of the Inquisitor in an earlier
time.
-- Bertrand Russell,
More information about the York
mailing list