activerecord-cockroachdb-adapter 0.1.5 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -6
- data/activerecord-cockroachdb-adapter.gemspec +2 -3
- data/lib/active_record/connection_adapters/cockroachdb_adapter.rb +4 -29
- metadata +10 -18
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2950a2695b83c0a3bd4bcebe4f5264a6254e67de
|
|
4
|
+
data.tar.gz: a28c9f714105f375e0bb3775ba4a425899655189
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c7727300dc620bb69673a7df6e9c178c035371fda98eb6ff09ac8d647f74a0ba1322035fefee30aff2847e11bcccd834c82f73868f2c4b319d89c1d5f5c1d1ef
|
|
7
|
+
data.tar.gz: 33c65c50ff8a76ba5a6c322c53550ce8764cad2b94fc5f4661d1cfd043666da25ccac8e9229149adbbef24c1bf73a257b6b7ea36e94d00b779668c1c9c018205
|
data/README.md
CHANGED
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
# ActiveRecord CockroachDB Adapter
|
|
2
2
|
|
|
3
|
-
CockroachDB adapter for ActiveRecord
|
|
3
|
+
CockroachDB adapter for ActiveRecord 5. This is a lightweight extension of the PostgreSQL adapter that establishes compatibility with [CockroachDB](https://github.com/cockroachdb/cockroach).
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
Add this line to your project's Gemfile:
|
|
8
8
|
|
|
9
9
|
```ruby
|
|
10
|
-
gem 'activerecord-cockroachdb-adapter', '~> 0.
|
|
10
|
+
gem 'activerecord-cockroachdb-adapter', '~> 0.1.0'
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
If you're using Rails 4.x, use the `0.1.x` versions of this gem.
|
|
14
|
-
|
|
15
13
|
In `database.yml`, use the following adapter setting:
|
|
16
14
|
|
|
17
15
|
```
|
|
18
16
|
development:
|
|
19
17
|
adapter: cockroachdb
|
|
20
18
|
port: 26257
|
|
21
|
-
host: <hostname>
|
|
22
|
-
user: <username>
|
|
23
19
|
```
|
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
|
4
4
|
|
|
5
5
|
Gem::Specification.new do |spec|
|
|
6
6
|
spec.name = "activerecord-cockroachdb-adapter"
|
|
7
|
-
spec.version = "0.
|
|
7
|
+
spec.version = "0.2.0"
|
|
8
8
|
spec.licenses = ["Apache-2.0"]
|
|
9
9
|
spec.authors = ["Cockroach Labs"]
|
|
10
10
|
spec.email = ["cockroach-db@googlegroups.com"]
|
|
@@ -13,8 +13,7 @@ Gem::Specification.new do |spec|
|
|
|
13
13
|
spec.description = "Allows the use of CockroachDB as a backend for ActiveRecord and Rails apps."
|
|
14
14
|
spec.homepage = "https://github.com/cockroachdb/activerecord-cockroachdb-adapter"
|
|
15
15
|
|
|
16
|
-
spec.add_dependency "activerecord", "~>
|
|
17
|
-
spec.add_dependency "pg", "0.20"
|
|
16
|
+
spec.add_dependency "activerecord", "~> 5.1", ">= 5.1.1"
|
|
18
17
|
|
|
19
18
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
|
20
19
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
|
@@ -12,13 +12,12 @@ module ActiveRecord
|
|
|
12
12
|
conn_params[:user] = conn_params.delete(:username) if conn_params[:username]
|
|
13
13
|
conn_params[:dbname] = conn_params.delete(:database) if conn_params[:database]
|
|
14
14
|
|
|
15
|
-
# Forward only valid config params to
|
|
16
|
-
valid_conn_param_keys =
|
|
15
|
+
# Forward only valid config params to PGconn.connect.
|
|
16
|
+
valid_conn_param_keys = PGconn.conndefaults_hash.keys + [:requiressl]
|
|
17
17
|
conn_params.slice!(*valid_conn_param_keys)
|
|
18
18
|
|
|
19
|
-
# The postgres drivers don't allow the creation of an unconnected
|
|
20
|
-
#
|
|
21
|
-
# time being.
|
|
19
|
+
# The postgres drivers don't allow the creation of an unconnected PGconn object,
|
|
20
|
+
# so just pass a nil connection object for the time being.
|
|
22
21
|
ConnectionAdapters::CockroachDBAdapter.new(nil, logger, conn_params, config)
|
|
23
22
|
end
|
|
24
23
|
end
|
|
@@ -33,30 +32,6 @@ class ActiveRecord::ConnectionAdapters::CockroachDBAdapter < ActiveRecord::Conne
|
|
|
33
32
|
# to use the same original `Utils` module.
|
|
34
33
|
Utils = ActiveRecord::ConnectionAdapters::PostgreSQL::Utils
|
|
35
34
|
|
|
36
|
-
def supports_json?
|
|
37
|
-
false
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
def supports_ddl_transactions?
|
|
41
|
-
false
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
def supports_extensions?
|
|
45
|
-
false
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
def supports_ranges?
|
|
49
|
-
false
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
def supports_materialized_views?
|
|
53
|
-
false
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
def supports_pg_crypto_uuid?
|
|
57
|
-
false
|
|
58
|
-
end
|
|
59
|
-
|
|
60
35
|
def indexes(table_name, name = nil) # :nodoc:
|
|
61
36
|
# The PostgreSQL adapter uses a correlated subquery in the following query,
|
|
62
37
|
# which CockroachDB does not yet support. That portion of the query fetches
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activerecord-cockroachdb-adapter
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Cockroach Labs
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-06-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|
|
@@ -16,28 +16,20 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
19
|
+
version: '5.1'
|
|
20
|
+
- - ">="
|
|
21
|
+
- !ruby/object:Gem::Version
|
|
22
|
+
version: 5.1.1
|
|
20
23
|
type: :runtime
|
|
21
24
|
prerelease: false
|
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
26
|
requirements:
|
|
24
27
|
- - "~>"
|
|
25
28
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '
|
|
27
|
-
-
|
|
28
|
-
name: pg
|
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
|
30
|
-
requirements:
|
|
31
|
-
- - '='
|
|
32
|
-
- !ruby/object:Gem::Version
|
|
33
|
-
version: '0.20'
|
|
34
|
-
type: :runtime
|
|
35
|
-
prerelease: false
|
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
-
requirements:
|
|
38
|
-
- - '='
|
|
29
|
+
version: '5.1'
|
|
30
|
+
- - ">="
|
|
39
31
|
- !ruby/object:Gem::Version
|
|
40
|
-
version:
|
|
32
|
+
version: 5.1.1
|
|
41
33
|
- !ruby/object:Gem::Dependency
|
|
42
34
|
name: bundler
|
|
43
35
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -121,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
121
113
|
version: '0'
|
|
122
114
|
requirements: []
|
|
123
115
|
rubyforge_project:
|
|
124
|
-
rubygems_version: 2.6.
|
|
116
|
+
rubygems_version: 2.6.11
|
|
125
117
|
signing_key:
|
|
126
118
|
specification_version: 4
|
|
127
119
|
summary: CockroachDB adapter for ActiveRecord.
|