jdbc-vertica 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/.rspec +2 -0
- data/.ruby-version +1 -0
- data/.travis.yml +3 -0
- data/Gemfile +7 -0
- data/LICENSE.txt +22 -0
- data/README.md +31 -0
- data/Rakefile +7 -0
- data/bin/jdbc-vertica +3 -0
- data/example/activerecord.rb +21 -0
- data/example/connect_and_show_tables.rb +18 -0
- data/jdbc-vertica.gemspec +24 -0
- data/lib/jdbc-vertica.rb +1 -0
- data/lib/jdbc/vertica.rb +27 -0
- data/lib/jdbc/vertica/version.rb +6 -0
- data/lib/vertica-jdbc-7.0.1-0.jar +0 -0
- data/spec/jdbc/vertica_spec.rb +11 -0
- data/spec/spec_helper.rb +2 -0
- metadata +108 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 153494fc3a827d8a0cfdd5b323eb7b40b1d8c7ce
|
4
|
+
data.tar.gz: 7e829a3c0e4fb71a61862d4599f498ff57efff59
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e20acf8fecf90336e9313266e6d9720734703cd81299df7f1c4780eea2ed4be33f9d7329923bcefe91c3e97333aec06b691cdc4d1c65655f9d154429e1c6d7fa
|
7
|
+
data.tar.gz: 7543711a06e933995660efc89d2fe78d4c1e3d405b898d0d5cb095d89664593a529c9e2e85b7ff04530b5ad04e4c9aba8820a02954a34519dcda6e0db3de8013
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
jruby-1.7.16
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 takahiro.nakayama
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# Jdbc::Vertica
|
2
|
+
|
3
|
+
Basic library for jdbc vertica.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'jdbc-vertica'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install jdbc-vertica
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
see example files.
|
24
|
+
|
25
|
+
## Contributing
|
26
|
+
|
27
|
+
1. Fork it ( https://github.com/[my-github-username]/jdbc-vertica/fork )
|
28
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
29
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
30
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
31
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/bin/jdbc-vertica
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'activerecord-jdbc-adapter'
|
2
|
+
require 'jdbc-vertica'
|
3
|
+
|
4
|
+
class JdbcTest < ActiveRecord::Base
|
5
|
+
end
|
6
|
+
|
7
|
+
$username = 'dbadmin'
|
8
|
+
$password = '********'
|
9
|
+
$host = 'veritica.jp'
|
10
|
+
|
11
|
+
Jdbc::Vertica.load_driver
|
12
|
+
ActiveRecord::Base.establish_connection adapter: 'jdbc',
|
13
|
+
driver: 'com.vertica.jdbc.Driver',
|
14
|
+
url: "jdbc:vertica://#{$host}:5433/",
|
15
|
+
username: $username,
|
16
|
+
password: $password,
|
17
|
+
database: 'vmain',
|
18
|
+
schema_search_path: 'sandbox'
|
19
|
+
ActiveRecord::Base.connection.execute "SET search_path TO sandbox;"
|
20
|
+
|
21
|
+
p JdbcTest.all
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'dbi'
|
2
|
+
require 'dbd/Jdbc'
|
3
|
+
require 'jdbc-vertica'
|
4
|
+
|
5
|
+
$user = 'dbadmin'
|
6
|
+
$password = '********'
|
7
|
+
$host = 'vertica.jp'
|
8
|
+
|
9
|
+
Jdbc::Vertica.load_driver
|
10
|
+
DBI.connect(
|
11
|
+
"DBI:Jdbc:vertica://#{$host}:5433/",
|
12
|
+
$user,
|
13
|
+
$password,
|
14
|
+
'driver' => 'com.vertica.jdbc.Driver'
|
15
|
+
) do |dbh|
|
16
|
+
puts "Connected"
|
17
|
+
p dbh.select_all('select * from dt;')
|
18
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'jdbc/vertica/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "jdbc-vertica"
|
8
|
+
spec.version = Jdbc::Vertica::VERSION
|
9
|
+
spec.authors = ["takahiro.nakayama"]
|
10
|
+
spec.email = ["civitaspo@gmail.com"]
|
11
|
+
spec.summary = %q{jdbc vertica driver.}
|
12
|
+
spec.description = %q{jdbc vertica driver.}
|
13
|
+
spec.homepage = "https://github.com/civitaspo/jdbc-vertica"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
spec.add_development_dependency "rspec"
|
24
|
+
end
|
data/lib/jdbc-vertica.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'jdbc/vertica'
|
data/lib/jdbc/vertica.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
warn "Jdbc-Vertica is only for use with JRuby" if (JRUBY_VERSION.nil? rescue true)
|
2
|
+
require 'jdbc/vertica/version'
|
3
|
+
|
4
|
+
module Jdbc
|
5
|
+
module Vertica
|
6
|
+
|
7
|
+
def self.driver_jar
|
8
|
+
"vertica-jdbc-#{DRIVER_VERSION}-0.jar"
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.load_driver(method = :load)
|
12
|
+
send method, driver_jar
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.driver_name
|
16
|
+
'com.vertica.jdbc.Driver'
|
17
|
+
end
|
18
|
+
|
19
|
+
if defined?(JRUBY_VERSION) && # enable backwards-compat behavior :
|
20
|
+
( Java::JavaLang::Boolean.get_boolean("jdbc.driver.autoload") ||
|
21
|
+
Java::JavaLang::Boolean.get_boolean("jdbc.vertica.autoload") )
|
22
|
+
warn "autoloading JDBC driver on require 'jdbc/vertica'" if $VERBOSE
|
23
|
+
load_driver :require
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
Binary file
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,108 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jdbc-vertica
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- takahiro.nakayama
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-11-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
15
|
+
requirements:
|
16
|
+
- - ~>
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: '1.7'
|
19
|
+
name: bundler
|
20
|
+
prerelease: false
|
21
|
+
type: :development
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ~>
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '10.0'
|
33
|
+
name: rake
|
34
|
+
prerelease: false
|
35
|
+
type: :development
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
name: rspec
|
48
|
+
prerelease: false
|
49
|
+
type: :development
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: jdbc vertica driver.
|
56
|
+
email:
|
57
|
+
- civitaspo@gmail.com
|
58
|
+
executables:
|
59
|
+
- jdbc-vertica
|
60
|
+
extensions: []
|
61
|
+
extra_rdoc_files: []
|
62
|
+
files:
|
63
|
+
- .bundle/config
|
64
|
+
- .gitignore
|
65
|
+
- .rspec
|
66
|
+
- .ruby-version
|
67
|
+
- .travis.yml
|
68
|
+
- Gemfile
|
69
|
+
- LICENSE.txt
|
70
|
+
- README.md
|
71
|
+
- Rakefile
|
72
|
+
- bin/jdbc-vertica
|
73
|
+
- example/activerecord.rb
|
74
|
+
- example/connect_and_show_tables.rb
|
75
|
+
- jdbc-vertica.gemspec
|
76
|
+
- lib/jdbc-vertica.rb
|
77
|
+
- lib/jdbc/vertica.rb
|
78
|
+
- lib/jdbc/vertica/version.rb
|
79
|
+
- lib/vertica-jdbc-7.0.1-0.jar
|
80
|
+
- spec/jdbc/vertica_spec.rb
|
81
|
+
- spec/spec_helper.rb
|
82
|
+
homepage: https://github.com/civitaspo/jdbc-vertica
|
83
|
+
licenses:
|
84
|
+
- MIT
|
85
|
+
metadata: {}
|
86
|
+
post_install_message:
|
87
|
+
rdoc_options: []
|
88
|
+
require_paths:
|
89
|
+
- lib
|
90
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - '>='
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - '>='
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
requirements: []
|
101
|
+
rubyforge_project:
|
102
|
+
rubygems_version: 2.1.9
|
103
|
+
signing_key:
|
104
|
+
specification_version: 4
|
105
|
+
summary: jdbc vertica driver.
|
106
|
+
test_files:
|
107
|
+
- spec/jdbc/vertica_spec.rb
|
108
|
+
- spec/spec_helper.rb
|