From: Michael Neumann Date: 2004-11-19T05:31:20+09:00 Subject: Re: [ANN] postgres-pr (pure Ruby PostgreSQL) --------------030708020500080209070409 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Scott Barron wrote: > On Fri, 19 Nov 2004 03:04:35 +0900, Michael Neumann wrote: > >>Michael Neumann wrote: >> >>it's now available as postgres-pr version 0.1.0. If you've installed >>this and ActiveRecord, it should work out-of-the-box. >> >>Regards, >> >> Michael > > > Michael, > > Very sweet! I'm playing with it and I've hit a few points of > incompatibility so far. > > First up, AR will allow you to leave out the host for the postgresql adapter, > which effectively tells the postgres module to use the unix socket. Your > library seems to require it to be set to /dir for the directory the socket file > resides in. I rather prefer your method, but any existing Rails apps would > have to change. fixed! > Next, AR is expecting that PGResult have []. Mapping this to > @rows.res seems to fix the problem. fixed! > Next, your library doesn't seem to like integers that are quoted (eg > UPDATE foo set bar='' where id='1') and this makes a number of AR's > unit tests fail. fixed! > Finally, I haven't tracked down this problem just yet, but the AR unit > tests give a good deal of errors very similar to this one: > > test_create(BasicsTest): > NoMethodError: undefined method `title=' for # @attributes={}, @new_record=true> > ./test/../lib/active_record/base.rb:817:in `method_missing' > ./test/base_test.rb:108:in `test_create' > > Where it is always failing on a method foo= for an AR class. I've run the test cases. of the 717 assertions, I get only 10 errors, but they seem to be not postgres-pr specific. I've appended the output of the test-cases at this email. Maybe someone can take a look at it. I've released 0.1.1 which fixes all those bugs (except the remaining 10). Update the gem and run the test-cases. Regards, Michael --------------030708020500080209070409 Content-Type: text/plain; name="postgres-pr-tests" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="postgres-pr-tests" Using native PostgreSQL Loaded suite -e Started ........................................................................................................................................................................................................................EEEEEEEEEE................. Finished in 9.688505 seconds. 1) Error: test_string_key(PrimaryKeysTest): RuntimeError: # /home/mneumann/Programs/usr/lib/ruby/gems/1.8/gems/postgres-pr-0.1.0/lib/postgres-pr/connection.rb:81:in `query' /home/mneumann/Programs/usr/lib/ruby/gems/1.8/gems/postgres-pr-0.1.0/lib/postgres-pr/connection.rb:66:in `loop' /home/mneumann/Programs/usr/lib/ruby/gems/1.8/gems/postgres-pr-0.1.0/lib/postgres-pr/connection.rb:66:in `query' /home/mneumann/Programs/usr/lib/ruby/gems/1.8/gems/postgres-pr-0.1.0/lib/postgres-pr/connection.rb:61:in `synchronize' /home/mneumann/Programs/usr/lib/ruby/gems/1.8/gems/postgres-pr-0.1.0/lib/postgres-pr/connection.rb:61:in `query' /home/mneumann/Programs/usr/lib/ruby/gems/1.8/gems/postgres-pr-0.1.0/lib/postgres.rb:30:in `exec' ./../lib/active_record/connection_adapters/postgresql_adapter.rb:81:in `last_insert_id' ./../lib/active_record/connection_adapters/postgresql_adapter.rb:60:in `insert' ./../lib/active_record/base.rb:776:in `create_without_callbacks' ./../lib/active_record/callbacks.rb:235:in `create' ./../lib/active_record/base.rb:761:in `create_or_update_without_callbacks' ./../lib/active_record/callbacks.rb:224:in `create_or_update' ./../lib/active_record/base.rb:647:in `save_without_validation' ./../lib/active_record/validations.rb:55:in `save_without_transactions' ./../lib/active_record/transactions.rb:115:in `save' ./../lib/active_record/transactions.rb:115:in `transaction' ./../lib/active_record/transactions.rb:86:in `transaction' ./../lib/active_record/transactions.rb:100:in `transaction' ./../lib/active_record/transactions.rb:115:in `save' ./pk_test.rb:37:in `test_string_key' 2) Error: test_aggregation_reflection(ReflectionTest): ActiveRecord::RecordNotFound: Couldn't find Topic with ID = 1 ./../lib/active_record/base.rb:242:in `find' ./reflection_test.rb:13:in `setup_without_fixtures' ./../lib/active_record/fixtures.rb:242:in `setup' ./../lib/active_record/fixtures.rb:240:in `setup' 3) Error: test_association_reflection(ReflectionTest): ActiveRecord::RecordNotFound: Couldn't find Topic with ID = 1 ./../lib/active_record/base.rb:242:in `find' ./reflection_test.rb:13:in `setup_without_fixtures' ./../lib/active_record/fixtures.rb:242:in `setup' ./../lib/active_record/fixtures.rb:240:in `setup' 4) Error: test_association_reflection_in_modules(ReflectionTest): ActiveRecord::RecordNotFound: Couldn't find Topic with ID = 1 ./../lib/active_record/base.rb:242:in `find' ./reflection_test.rb:13:in `setup_without_fixtures' ./../lib/active_record/fixtures.rb:242:in `setup' ./../lib/active_record/fixtures.rb:240:in `setup' 5) Error: test_column_string_type_and_limit(ReflectionTest): ActiveRecord::RecordNotFound: Couldn't find Topic with ID = 1 ./../lib/active_record/base.rb:242:in `find' ./reflection_test.rb:13:in `setup_without_fixtures' ./../lib/active_record/fixtures.rb:242:in `setup' ./../lib/active_record/fixtures.rb:240:in `setup' 6) Error: test_columns(ReflectionTest): ActiveRecord::RecordNotFound: Couldn't find Topic with ID = 1 ./../lib/active_record/base.rb:242:in `find' ./reflection_test.rb:13:in `setup_without_fixtures' ./../lib/active_record/fixtures.rb:242:in `setup' ./../lib/active_record/fixtures.rb:240:in `setup' 7) Error: test_content_columns(ReflectionTest): ActiveRecord::RecordNotFound: Couldn't find Topic with ID = 1 ./../lib/active_record/base.rb:242:in `find' ./reflection_test.rb:13:in `setup_without_fixtures' ./../lib/active_record/fixtures.rb:242:in `setup' ./../lib/active_record/fixtures.rb:240:in `setup' 8) Error: test_human_name_for_column(ReflectionTest): ActiveRecord::RecordNotFound: Couldn't find Topic with ID = 1 ./../lib/active_record/base.rb:242:in `find' ./reflection_test.rb:13:in `setup_without_fixtures' ./../lib/active_record/fixtures.rb:242:in `setup' ./../lib/active_record/fixtures.rb:240:in `setup' 9) Error: test_integer_columns(ReflectionTest): ActiveRecord::RecordNotFound: Couldn't find Topic with ID = 1 ./../lib/active_record/base.rb:242:in `find' ./reflection_test.rb:13:in `setup_without_fixtures' ./../lib/active_record/fixtures.rb:242:in `setup' ./../lib/active_record/fixtures.rb:240:in `setup' 10) Error: test_read_attribute_names(ReflectionTest): ActiveRecord::RecordNotFound: Couldn't find Topic with ID = 1 ./../lib/active_record/base.rb:242:in `find' ./reflection_test.rb:13:in `setup_without_fixtures' ./../lib/active_record/fixtures.rb:242:in `setup' ./../lib/active_record/fixtures.rb:240:in `setup' 243 tests, 717 assertions, 0 failures, 10 errors --------------030708020500080209070409--