On Tuesday, May 26, 2020 at 4:23:32 PM UTC-7, Tiago Cardoso wrote:
>
> Hi Jeremy,
>
> I'm working on adding support for jruby in rodauth-rails. I'm starting 
> with postgres first. I tried naively to reuse the existing extensions, so 
> that one would just call #execute on the activerecord connection (
> https://github.com/janko/sequel-activerecord_connection/blob/master/lib/sequel/extensions/activerecord_connection/postgres.rb#L5)
>  
> . It should just work, but it doesn't. Maybe you can help me find out. So, 
> this is how I initiate things:
>
> # activerecord first
> ActiveRecord::Base.establish_connection(
>         adapter:  "postgresql",
>         database: "sequel_activerecord_connection",
>         username: "sequel_activerecord_connection",
>         password: "sequel_activerecord_connection",
>       )
> # sequel then
> db = Sequel.connect(adapter: "jdbc", test: false)
> db.extension :activerecord_connection
>
> # and then, I create a table
> db.create_table! :records do
>       primary_key :id
>       String :col
>       Time :time
>     end
>
> Once I do that, I get an error:
>
> D, [2020-05-26T14:18:37.927562 #68278] DEBUG -- :    (1.0ms)  BEGIN 
> TRANSACTION
> D, [2020-05-26T14:18:37.955206 #68278] DEBUG -- :    (18.0ms)  SELECT NULL 
> AS "NIL" FROM "RECORDS" LIMIT 1
> D, [2020-05-26T14:18:37.964119 #68278] DEBUG -- :    (3.4ms)  ROLLBACK 
> TRANSACTION
> E
>
> Fabulous run in 18.546650s, 0.0539 runs/s, 0.0000 assertions/s.
>
>   1) Error:
> postgres connection#test_0001_supports Dataset#insert:
> ActiveRecord::JDBCError: org.postgresql.util.PSQLException: ERROR: 
> relation "RECORDS" does not exist
>

Sequel should not attempt to rescue ActiveRecord::JDBCError, because it 
does not depend on ActiveRecord.  This is probably something that needs to 
be handled by sequel-activerecord_connection.

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/ad9baa58-1b4a-472f-a8bc-de23b15ced65%40googlegroups.com.

Reply via email to