How to use H2 as an embedded database in Postgres-compat mode, from jruby / rails

I want to run the jruby / rails application to use Postgres. But I would like to use H2 in Postgres compatibility mode when working in development and testing.

It has no problems casting the application in H2 or in postgresql, but how do I configure it to run the postgresql adapter using the built-in H2 database?

For example: something like this:

database.yml

development: # adapter: jdbch2 # database: db/development/database adapter: postgresql encoding: unicode database: database # driver: org.h2.Driver url: jdbc:h2:~/db/development;MODE=PostgreSQL test: ... 

Gemfile:

 ... gem 'activerecord-jdbch2-adapter' #gem 'jdbc-h2' gem 'activerecord-jdbcpostgresql-adapter' ... 
+2
ruby ruby-on-rails jruby h2
Mar 18 '13 at 22:03
source share

No one has answered this question yet.

See similar questions:

13
Postgresql H2 mode doesn't seem to work for me

or similar:

1339
How can I rename a database column in a Ruby on Rails migration?
1023
How to get current absolute url in Ruby on Rails?
four
How to use Ruby on Rails 3.1 with DataMapper in JRuby with a DB2 / 400 database?
2
JRuby database.yml file configuration for using IBM DB2
2
JRuby JDBC without username or password in database.yml
2
Ruby: Rails: MRI and JRuby
0
Error in db: migration using JRuby on Rails with remote Amazon MySQL via SSL connection
0
How to use ActiveRecord in a JRuby script outside of Rails?
0
What is Rails ActiveRecord on JRuby?
0
Cannot start JRuby rails 3.0.10 application on Torquebox with mysqljdbc driver



All Articles