Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
DataObjects Schema Construction and Reflection API
Ruby
branch: master

This branch is 1 commit ahead, 4 commits behind snusnu:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
config
lib
spec
tasks
.document
.gitignore
API_DRAFT.rb
Gemfile
Gemfile.lock
LICENSE
README.rdoc
Rakefile
TODO
VERSION
do-schema.gemspec

README.rdoc

do-schema

The goal of this project is to provide a Ruby API that allows the construction of, and reflection on, all databases that are supported by the DataObjects project.

Status

This project is in a very early development phase and not yet usable for anything practical.

Currently Implemented

Currently, the following API is mostly implemented. Parts that are still lacking are marked with a TODO comment.

uri = Addressable::URI.parse('mysql://localhost/dm_core_test')

database = DataObjects::Schema.load(uri) # TODO Not yet implemented

database.name                  # => "dm_core_test"
database.uri                   # => uri
database.tables                # => Tables.new([ Table1, Table2, ... ])

database.tables.each do |table|

  # Table API
  table                        # => Table.new('customers', [ Column1, Column2, ... ])
  table.name                   # => "customers"

  # Column API
  table.columns                # => Columns.new([ Column1, Column2, ... ])

  table.each do |column|
    column                     # => Column::String.new('name', :length => 0..10)
    column.name                # => "name"
    column.required?           # => true
    column.default             # => "a"
  end

  # TODO Not yet implemented
  # ------------------------
  # Column subclasses will be able to add extra accessors for type
  # specific data. For example Column::String may define #length,
  # and Column::Decimal may define #precision and #scale

end

TODO

See the TODO list

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don't break it in a future version unintentionally.

  • The submitted patch must not lower any current metric thresholds.

  • To get at the current thresholds, run “bundle exec rake ci”

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.

Copyright

Copyright © 2010 Dirkjan Bussink. See LICENSE for details.

Something went wrong with that request. Please try again.