github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

arthasgo / tdmodel

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 2
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

access large scaled legacy database by dynamic ORM — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

add gem dependencies 
arthasgo (author)
Mon Oct 26 05:59:24 -0700 2009
commit  0e15079eb1e35388c3970723ffbb8132615d6c52
tree    9d0fa1a7304cb6949988c5e1ca74d950158e3943
parent  22529fca33d9a2ef579696246939d638e05a161e
tdmodel /
name age
history
message
file MIT-LICENSE Loading commit data...
file README Mon Oct 26 05:59:24 -0700 2009 add gem dependencies [arthasgo]
file Rakefile Mon Oct 26 04:58:08 -0700 2009 ceate tdmodel [arthasgo]
directory doc/ Mon Oct 26 04:58:08 -0700 2009 ceate tdmodel [arthasgo]
directory example/ Mon Oct 26 04:58:08 -0700 2009 ceate tdmodel [arthasgo]
file init.rb
file install.rb Mon Oct 26 04:58:08 -0700 2009 ceate tdmodel [arthasgo]
directory lib/
directory patches/
directory tasks/
directory test/
file uninstall.rb
README
Tdmodel
=======
Create ORM(Object-Relation Mapping) dynamic for legacy database defined in data model(a *.yml file);
Create default ORM which is not defined in data model;
Support concurrent multiple databases access by using magic_multi_connections gem;
Support charset auto-transforming between rails utf8 and database local charset, such as GBK;

Example
=======
refer to tdmodel_example which is located in example

1. define data model
<tdmodel_example>\config\legacy_db\dm.yml

2. config legacy database
<tdmodel_example>\config\legacy_db\db.yml

3. Access legacy database defined in data model
book = Book.find :first
book = BOOK_DB1::Book.find :first
book = BOOK_DB2::Book.find :first

4. Access data table which is not defined in data model
If there is a data table 'shops' in book_db1, but not defined in data model.
Tdmodel will create a default ORM for it:

model = DBLayer.orm("shops") # Shop will be created 
shop = Shop.find :first

5. gem dependencies
magic_multi_connections

Copyright (c) 2009 taobao, released under the MIT license
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server