CockroachDB is a very interesting distributed SQL db, which exposes PostgreSQL wire protocol. So I tried to connect a new Rails project to CockroachDB using the classic pg gem. Unfortunately, a simple rails db:create
gave:
/home/fengye87/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb:671: warning: Failed to set the default_internal encoding to UTF8: 'ERROR: unknown variable: "CLIENT_ENCODING"
'
invalid encoding name: unicode
So I guess it indicates that CockroachDB doesn't support CLIENT_ENCODING
variable. The question is: is it possible to bypass setting these variables in pg? Does anyone managed to connect Rails to CockroachDB ever? Thanks!