em_postgresql
em_postgresql copied to clipboard
Rails 3?
Any chance of this getting rails 3 support any time soon? Thanks!
What doesn't work?
Hi, I've tried to get it working with Rails 3 too. The issue doesn't seem to be Rails, but more like a missing dependency for this gem. And yes we couldn't get it too work with Rails. We declared the following in our Gemfile:
gem 'postgres-pr' gem 'em_postgresql, '0.4.0', :git => 'git://github.com/mperham/em_postgresql.git'
When running our test suite we got several errors regarding the missing constant PGConn. First here and after commenting out those lines somewhere in ActiveRecord. We haven't declared the pg gem in our Gemfile. And we added the Rack::Fiberpool in our middleware.
Any ideas how we can solve the missing constant issue?
I was able to avoid this error by adding , :require => 'postgres' to gem 'postgres-pr', :require => 'postgres' in Gemfile. I was able to run rails dbconsole by patching railties/lib/rails/commands/dbconsole.rb, but rake db:create and rake db:migrate commands do not work.
rake db:create creates no db and do not show any errors then rake db:migrate responds with "rake aborted! FATAL C3D000 Mdatabase "widgets_development" does not exist Fpostinit.c L708 RInitPostgres"
Then I tried to point em_postgresql to previously existing database. rake db:migrate terminates with error: "RuntimeError: ERROR C22023 Minvalid value for parameter "client_min_messages": "" HAvailable values: debug5, debug4, debug3, debug2, debug1, log, notice, warning, error. Fguc.c L5231 Rset_config_option: SET client_min_messages TO ''. Adding min_messages: error to config/database.yml makes no difference
I am also trying to get the async_rails project https://github.com/igrigorik/async-rails (originally setup to demo em_mysqlplus) to work with postgres, and I'm running into these same issues.
I either run into the 'PGConn' issue, or the 'Minvalid value for parameter "client_min_messages":' error. I'll take another look at this, and will get all the db create and migrate stuff taken care of with the pg driver first, and just focus on the regular db access.
As a side note, related to this 'Phat' project I noticed a significant difference between the pg driver and postgres-pr.
I turned off the memcache caching, commented out em_postgresql and em-resolve-replace, and tested out the 2 drivers against the same db.
a few runs of postgres-pr loading 10,000 simple rows from the db Site Load (1427.8ms) SELECT * FROM "sites" Site Load (1047.5ms) SELECT * FROM "sites"
compared to the pg driver Site Load (41.1ms) SELECT * FROM "sites" Site Load (51.6ms) SELECT * FROM "sites"
I know its off topic, but if we had to pick one driver to get working, I think we'd be wise to focus on the pg driver over the postgres-pr driver