h1. sqld4r
h1. → 'sqld4r'
h2. What is this?
The sqld4r is model generator for SQLDesigner(http://ondras.zarovi.cz/sql/demo/).
If you have a xml file of the SQLDesigner, you will be able to generate migration files and model files on a minute.
I recommend that you use it with a rocketstarter gem.
h2. Features
* generate migration files and model files from SQLDesigner xml file.
* generate migration file for your model's PKs and FKs.
* execute command list before finish.
(exp., execute 'rake db:create:all' for migrate to your database).
* save the DBDesigner xml file.
h2. Installing
gem install sqld4rh2. The basics This gem needs activesupport ver 2.1.0 or higher. (because I checked this version only. I don't know about another version.) h2. Demonstration of usage
Usage: sqld4r SQLDesigner_xml_path [options] Usage: sqld4r --init [options] Usage: sqld4r --check [options] and more... Usage: sqld4r --helph2. How to use 1. Set environment valiable if you want to change a config file path.
$ export SQLD4R_CONF=~/.sqld4r- Default is $HOME/.sqld4r 2. Create config file.
$ sqld4r --init3. Modify default values and command list.
$ vi ~/.sqld4r $ vi ~/sqld4r_execute_commands4. Test for setting
$ sqld4r --check5. Generate migration files and model files from SQLDesigner xml file.
$ cd your-rails-root $ sqld4r /path/to/SQLDesigner.xmlh2. Forum "http://groups.google.com/group/sqld4r (English)":http://groups.google.com/group/sqld4r "http://groups.google.co.jp/group/sqld4r (Japanese)":http://groups.google.co.jp/group/sqld4r h2. How to submit patches Read the "8 steps for fixing other people's code":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/ and for section "8b: Submit patch to Google Groups":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups, use the Google Group above. You can fetch the source from either: <% if rubyforge_project_id %> * rubyforge: "http://rubyforge.org/scm/?group_id=<%= rubyforge_project_id %>":http://rubyforge.org/scm/?group_id=<%= rubyforge_project_id %>
git clone git://rubyforge.org/sqld4r.git<% else %> * rubyforge: MISSING IN ACTION TODO - You can not created a RubyForge project, OR have not run
rubyforge config
yet to refresh your local rubyforge data with this projects' id information.
When you do this, this message will magically disappear!
Or you can hack website/index.txt and make it all go away!!
<% end %>
h3. Build and test instructions
cd sqld4r rake test rake install_gemh2. License This code is free to use under the terms of the MIT license. h2. Contact Comments are welcome. Send an email to "Yusuke Ohmichi(maimuzo)":mailto:maimuzo@gmail.com via the "forum":http://groups.google.com/group/sqld4r