activerecord-jdbcvertica-adapter 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -4
- data/lib/activerecord-jdbcvertica-adapter/version.rb +1 -1
- data/lib/arjdbc/vertica/adapter.rb +17 -5
- data/spec/full_object_spec.rb +1 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef8c99593c309ea5022843f5e859fb227ac8cad0
|
4
|
+
data.tar.gz: fafac54837575e44c2942da0870a2b2b055defc4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c991d5d66846f4281e6c2c3edac37bb2acd3504f6937eb51989ab4c67cd24d95ad943c6b0e90fb742d3f4d2c68495f0764aa08863f0db3ffa5daf1675d3049b2
|
7
|
+
data.tar.gz: 36b62487759985b87e310f947eb29f5dc7c60f32346af1cf94278756045ce96b38377c4c571752f779f75df029a5d1ad76ed7a9f54df12e9668c923f0baf1ac2
|
data/README.md
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# Activerecord::Jdbcvertica::Adapter
|
2
|
-
|
3
|
-
TODO: Write a gem description
|
2
|
+
ActiveRecord adapter for Vertica databases (version 5,6,7) that works on Jruby with Vertica JDBC adapter
|
4
3
|
|
5
4
|
## Installation
|
6
5
|
|
@@ -18,8 +17,6 @@ Or install it yourself as:
|
|
18
17
|
|
19
18
|
## Usage
|
20
19
|
|
21
|
-
TODO: Write usage instructions here
|
22
|
-
|
23
20
|
## Contributing
|
24
21
|
|
25
22
|
1. Fork it
|
@@ -6,7 +6,7 @@ module ::ArJdbc
|
|
6
6
|
ADAPTER_NAME = 'Vertica'.freeze
|
7
7
|
|
8
8
|
NATIVE_DATABASE_TYPES = {
|
9
|
-
:primary_key => "auto_increment",
|
9
|
+
:primary_key => "auto_increment primary key",
|
10
10
|
:string => { :name => "varchar", :limit => 255 },
|
11
11
|
:text => { :name => "varchar", :limit => 15000 },
|
12
12
|
:integer => { :name => "integer" },
|
@@ -40,6 +40,18 @@ module ::ArJdbc
|
|
40
40
|
NATIVE_DATABASE_TYPES
|
41
41
|
end
|
42
42
|
|
43
|
+
##
|
44
|
+
# Vertica should "auto-discover" the primary key if marked on the table
|
45
|
+
#
|
46
|
+
def primary_keys(table)
|
47
|
+
@primary_keys ||= {}
|
48
|
+
return @primary_keys[table] if @primary_keys[table]
|
49
|
+
|
50
|
+
keys = self.execute("SELECT column_name FROM v_catalog.primary_keys WHERE table_name = '#{table}';")
|
51
|
+
@primary_keys[table] = [ keys.first['column_name'] ]
|
52
|
+
@primary_keys[table]
|
53
|
+
end
|
54
|
+
|
43
55
|
##
|
44
56
|
# Vertica does not allow the table name to prefix the columns when
|
45
57
|
# setting a value, this is not a pleasant work-around, but it works
|
@@ -48,15 +60,15 @@ module ::ArJdbc
|
|
48
60
|
quote_column_name(attr)
|
49
61
|
end
|
50
62
|
|
63
|
+
def rename_index(*args)
|
64
|
+
raise ArgumentError, "rename_index does not work on Vertica"
|
65
|
+
end
|
66
|
+
|
51
67
|
end
|
52
68
|
end
|
53
69
|
|
54
70
|
module ActiveRecord::ConnectionAdapters
|
55
71
|
class VerticaAdapter < JdbcAdapter
|
56
72
|
include ::ArJdbc::Vertica
|
57
|
-
|
58
|
-
def rename_index(*args)
|
59
|
-
raise ArgumentError, "rename_index does not work on Vertica"
|
60
|
-
end
|
61
73
|
end
|
62
74
|
end
|
data/spec/full_object_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-jdbcvertica-adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Dewitt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|