activerecord-jdbcsplice-adapter 0.1.2 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8bd4c9f47550f6ded46b192947daca2a0f9ff9ba
4
- data.tar.gz: 2ec9eaf99924671975b3d9395aa23b22149162f2
3
+ metadata.gz: f576ad90fdef4ed1f6bcc3c3b46a640f478b6878
4
+ data.tar.gz: f57e8ef17dd58b52402039515b926a7f78a96dcf
5
5
  SHA512:
6
- metadata.gz: b0f906e87dff9b8593c4b4d23ae2ffe1a0ef0abba5708a7c707fd2cb53e5533af36b2ce07c682ad8c5e6b2ddf598f72d4a5171886370f253563a6401ee014a54
7
- data.tar.gz: c275f40f2f61d7f289e6c45eae46f8e63c837fdacc97a8ee60e3a75f63076be758c20543c3e7fee5803a6a319a4666ef125bb50974ba2c62f623bb0906840e83
6
+ metadata.gz: 6309894c05dd8b3b78033a3b474842e735d1ea4919ccf5ac7170cfb6d6f54dfbaa1c9c244bca7ebd238b1ac60b1df73e0ca72228ec4c25a3b4d3e6f6a6385266
7
+ data.tar.gz: 672adccffbbdf715af0d6530582b14c314121aacb106539a5647f7ed8fab04434e02e083be05739d596f57bc856283a33375da90d311c1f0b29d3ea44286811e
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # Activerecord::Jdbcsplice::Adapter
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/activerecord/jdbcsplice/adapter`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ Splice Engine JDBC adapter for JRuby on Rails.
6
4
 
7
5
  ## Installation
8
6
 
@@ -14,7 +12,7 @@ gem 'activerecord-jdbcsplice-adapter'
14
12
 
15
13
  And then execute:
16
14
 
17
- $ bundle
15
+ $ bundle install
18
16
 
19
17
  Or install it yourself as:
20
18
 
@@ -22,20 +20,29 @@ Or install it yourself as:
22
20
 
23
21
  ## Usage
24
22
 
25
- TODO: Write usage instructions here
26
-
27
- ## Development
28
-
29
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
23
+ To use Splice JDBC adapter, install the gem, and update your `database.yml` like:
30
24
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
-
33
- ## Contributing
25
+ ```ruby
26
+ default: &default
27
+ adapter: jdbcsplice
28
+ username: splice
29
+ password: admin
30
+ prepared_statements: true
31
+ pool: 1000
32
+ host: localhost
33
+ port: 1527
34
34
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/activerecord-jdbcsplice-adapter.
35
+ development:
36
+ <<: *default
37
+ database: splicedb
36
38
 
39
+ test:
40
+ <<: *default
41
+ database: splicedb_test
37
42
 
38
- ## License
39
43
 
40
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
44
+ production:
45
+ <<: *default
46
+ database: splicedb_production
41
47
 
48
+ ```
@@ -18,5 +18,5 @@ Gem::Specification.new do |spec|
18
18
  spec.require_paths = ["lib"]
19
19
 
20
20
  spec.add_dependency 'activerecord-jdbc-adapter', "~> 1.3.21"
21
- spec.add_dependency 'jdbc-splice', '~> 0.1'
21
+ spec.add_dependency 'jdbc-splice', '~> 0.1.1'
22
22
  end
@@ -1,7 +1,7 @@
1
1
  module Activerecord
2
2
  module Jdbcsplice
3
3
  module Adapter
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
6
6
  end
7
7
  end
@@ -10,8 +10,9 @@ ArJdbc::ConnectionMethods.module_eval do
10
10
  rescue LoadError # assuming driver.jar is on the class-path
11
11
  end
12
12
 
13
- throw "Please specify Splice Cluster URL by defining 'server_url:' in database.yml" if config[:server_url].blank?
14
- config[:url] ||= "jdbc:splice://#{config[:server_url]}/#{config[:database]};create=true"
13
+ throw "Please specify Splice Cluster URL by defining 'host' and 'port' in database.yml" if config[:host].blank? || config[:port].blank?
14
+
15
+ config[:url] ||= "jdbc:splice://#{config[:host]}:#{config[:port]}/#{config[:database]};create=true"
15
16
  config[:driver] ||= defined?(::Jdbc::Splice.driver_name) ?
16
17
  ::Jdbc::Splice.driver_name : 'com.splicemachine.db.jdbc.ClientDriver'
17
18
 
@@ -1 +1,2 @@
1
- require 'arjdbc/tasks/database_tasks'
1
+ require 'arjdbc/tasks/database_tasks'
2
+ require 'arjdbc/tasks/rake_tasks'
@@ -0,0 +1,32 @@
1
+ namespace :db do
2
+ namespace :splice do
3
+
4
+ task :destroy_all => :environment do
5
+ ['development', 'test'].each do |environment|
6
+ db_config = Rails.configuration.database_configuration[environment].dup
7
+ schema_name = db_config['schema']
8
+
9
+ ActiveRecord::Base.establish_connection.with_connection do |connection|
10
+ schemas = connection.execute("SELECT ssc.schemaname FROM SYS.SYSSCHEMAS ssc where ssc.schemaname not in (SELECT sc.schemaname FROM SYS.SYSSCHEMAS sc where sc.schemaname like 'SYS%' OR sc.schemaname like 'SQL%')
11
+ ").map {|t| t['schemaname']}
12
+
13
+ schemas.each do |schema|
14
+ puts "Schema: #{schema}"
15
+ tables = connection.execute("select ts.tablename from sys.systables ts where ts.tablename not in (select t.tablename from sys.systables t where t.tablename like 'SYS%')").map {|t| t['tablename']}
16
+
17
+ tables.each do |table|
18
+ begin
19
+ connection.execute("DROP TABLE #{schema}.#{table}")
20
+ puts "#{table} dropped."
21
+ rescue => e
22
+ puts "#{table} skipped."
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+
30
+
31
+ end
32
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-jdbcsplice-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kolosek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-16 00:00:00.000000000 Z
11
+ date: 2016-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord-jdbc-adapter
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.1'
33
+ version: 0.1.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.1'
40
+ version: 0.1.1
41
41
  description: Splice Engine JDBC adapter for JRuby on Rails.
42
42
  email:
43
43
  - office@kolosek.com
@@ -65,6 +65,7 @@ files:
65
65
  - lib/arjdbc/tasks.rb
66
66
  - lib/arjdbc/tasks/database_tasks.rb
67
67
  - lib/arjdbc/tasks/databases.rake
68
+ - lib/arjdbc/tasks/rake_tasks.rb
68
69
  homepage: http://splicemachine.com
69
70
  licenses:
70
71
  - MIT