{"id":1000687,"date":"2007-06-14T05:03:29","date_gmt":"2007-06-14T10:03:29","guid":{"rendered":"http:\/\/www.elharo.com\/blog\/software-development\/2007\/06\/14\/seeking-an-agile-database-definition-language\/"},"modified":"2007-06-14T05:55:41","modified_gmt":"2007-06-14T10:55:41","slug":"seeking-an-agile-database-definition-language","status":"publish","type":"post","link":"https:\/\/www.elharo.com\/blog\/software-development\/databases\/2007\/06\/14\/seeking-an-agile-database-definition-language\/","title":{"rendered":"Seeking an Agile Database Definition Language"},"content":{"rendered":"<p>The database schemas for my current project are getting hashed out, mostly in Visio. This is pretty but not very automatable. I&#8217;d like to see if we can follow a more agile, iterative approach to database development. In particular, I&#8217;d like to be able to check the database definition into source code control and build the whole thing, including database tables and sample databases for testing out of Ant. Requirements include:<\/p>\n<ol>\n<li>Supports (at a minimum) MySQL and Derby<\/li>\n<li>Can be read by Java and Python<\/li>\n<li>Allows for inserting of data for unit testing; i.e. not just table definitions<\/li>\n<\/ol>\n<p>It also wouldn&#8217;t hurt if it could reverse engineer existing SQL databases.<\/p>\n<p>I&#8217;m tempted to write my own, probably using XML, but surely someone has already done this? I haven&#8217;t found a lot though. What I&#8217;ve got so far are these, none of which really meet the requirements:<br \/>\n<!--more--><\/p>\n<h2>Andromeda<\/h2>\n<p><a href=\"http:\/\/www.andromeda-project.com\/\">Andromeda<\/a> uses YAML for the database definition language. The downside is that only a PHP parser is currently available. I&#8217;d have to write one for Java and\/or Python. <\/p>\n<h2>Python<\/h2>\n<p>We have some database generation code written in Python. Maybe I should just use Jython to call this from Java? It still feels like a hack though. <\/p>\n<h2>Raw SQL<\/h2>\n<p>We could just write a big SQL script to set up the tables and load in the data. However JDBC can&#8217;t execute SQL scripts, only individual statements. (Perhaps this is fixed somewhere in some project?)<\/p>\n<p>Surely this is an obvious enough idea that someone has already done it? Probably in XML? Any ideas? <\/p>\n","protected":false},"excerpt":{"rendered":"<p>The database schemas for my current project are getting hashed out, mostly in Visio. This is pretty but not very automatable. I&#8217;d like to see if we can follow a more agile, iterative approach to database development. In particular, I&#8217;d like to be able to check the database definition into source code control and build [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[410],"class_list":["post-1000687","post","type-post","status-publish","format-standard","hentry","category-databases","tag-flash"],"_links":{"self":[{"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/posts\/1000687","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/comments?post=1000687"}],"version-history":[{"count":0,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/posts\/1000687\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/media?parent=1000687"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/categories?post=1000687"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/tags?post=1000687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}