`Sequel.sqlite` should use `jdbc-sqlite3` for JRuby #558

Closed
mlen opened this Issue Sep 27, 2012 · 2 comments

Comments

Projects
None yet
2 participants

mlen commented Sep 27, 2012

I'd like my code to be portable both on JRuby and MRI without the need to do the platform checks.
Here's the current output:

$ rbenv shell jruby-1.7.0-rc1
$ bundle exec ruby -e 'require "sequel"; Sequel.sqlite'
Sequel::AdapterNotFound: LoadError: no such file to load -- sqlite3
   adapter_class at /Users/m/sequel_secure_password/vendor/bundler/gems/sequel-3.40.0/lib/sequel/database/connecting.rb:27
         connect at /Users/m/sequel_secure_password/vendor/bundler/gems/sequel-3.40.0/lib/sequel/database/connecting.rb:67
         connect at /Users/m/sequel_secure_password/vendor/bundler/gems/sequel-3.40.0/lib/sequel/core.rb:147
  adapter_method at /Users/m/sequel_secure_password/vendor/bundler/gems/sequel-3.40.0/lib/sequel/core.rb:412
          sqlite at /Users/m/sequel_secure_password/vendor/bundler/gems/sequel-3.40.0/lib/sequel/core.rb:419
          (root) at -e:1
Owner

jeremyevans commented Sep 27, 2012

The adapter methods (e.g. Sequel.sqlite, Sequel.postgres) are for accessing specific adapters, not specific databases. Sequel.sqlite specifies using the sqlite adapter, which requires the sqlite3 gem. The jdbc/sqlite adapter operates differently from the sqlite adapter in some respects and I don't think that one should automatically be substituted for the other. Don't fear the conditional (i.e. use an if statement).

mlen commented Sep 27, 2012

Ok, got your point. Thanks for fast reply :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment