Lore ORM 是一个高度灵活的对象映射框架,提供可灵活、简单、功能强大的对象 创建、查询、更新和删除等操作接口。
安装方法: gem install lore
代码形如:
require 'lore/connection' logins = { :your_db_name => [ 'user', 'pass' ] } Lore.setup(:logins => logins) Lore::Context.enter :your_db_name # You can load your models now: require 'my_app/models/my_model.rb' # Set up caching, optional: Lore.enable_mmap_cache require 'lore/cache/mmap_entity_cache' Table_Accessor.use_entity_cache Lore::Cache::MMap_Entity_Cache # You can access your data now: MyModel.find(5).with(MyModel.some_attribute.ilike('%foo%').entities