SequelRuby对象映射框架
Sequel 是一个 Ruby 语言的对象映射框架(ORM),提供了线程安全、连接池以及 DSL 语言用来构造查询和表模型。
示例代码:
require "rubygems"
require "sequel"
# connect to an in-memory database
DB = Sequel.sqlite
# create an items table
DB.create_table :items do
primary_key :id
String :name
Float :price
end
# create a dataset from the items table
items = DB[:items]
# populate the table
items.insert(:name => 'abc', :price => rand * 100)
items.insert(:name => 'def', :price => rand * 100)
items.insert(:name => 'ghi', :price => rand * 100)
# print out the number of records
puts "Item count: #{items.count}"
# print out the average price
puts "The average price is: #{items.avg(:price)}"
评论
DoctrinePHP对象映射框架
Doctrine是一个PHP的ORM(对象关联映射框架),基于强大的DBAL(数据库抽象层)。其中一个最主要的功能就是使用面向对象的方式执行数据库查询,受HibernateHQL的影响,Doctrin
DoctrinePHP对象映射框架
0
MorphiaMongoDB 对象映射框架
Morphia是一个轻量级的类型安全的Java类库,用来将在MongoDB和Java对象之间进行映射。@Entity("employees")classEmployee{ @IdObjectIdid;
MorphiaMongoDB 对象映射框架
0
ActiveRecord.jsJavaScript 对象映射框架
ActiveRecord.js 是一个开源的JavaScript 对象映射框架,包括:Google
ActiveRecord.jsJavaScript 对象映射框架
0
ActiveRecord.jsJavaScript 对象映射框架
ActiveRecord.js是一个开源的JavaScript对象映射框架,包括:GoogleGears(client-sidepersistence)InMemory(ifnoSQLserveris
ActiveRecord.jsJavaScript 对象映射框架
0