harmonyos2-em_postgresql使用EventMachine的Postgresql ActiveRecord驱动
harmonyos2-em_postgresql 用于将 Postgresql 与 ActiveRecord 一起使用的 EventMachine 感知驱动程序。要求 Ruby 1.9、EventMachine 0.12.10、postgres-pr 0.6.3、Rails 2.3.5,这些版本已过测试,其他版本可能兼容但不保证稳定。pg gem 无法安装,尽管 ActiveRecord 更倾向于使用 pg gem,但此代码需要加载 postgres-pr gem。不清楚是否有方法让两者兼容。确保代码在活动 Fiber 中运行,需要使用 Fiber_pool.rb 中定义的 FiberPool。如果在 Thin 中运行 Rails,以下代码可作为开始进行尝试:在 config/environment.rb 中列出该 gem: config.gem 'postgres-pr', :lib => false
和 config.gem 'em_postgresql', :lib => false
。并更新 config/database.yml 以使用正确的适配器属性: adapter: em_pos
。
13.92KB
文件大小:
评论区