activerecord-jdbcsplice-adapter 0.1.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 +7 -0
- data/.gitignore +9 -0
- data/Gemfile +4 -0
- data/README.md +41 -0
- data/Rakefile +2 -0
- data/activerecord-jdbcsplice-adapter.gemspec +22 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/active_record/connection_adapters/jdbcsplice_adapter.rb +5 -0
- data/lib/active_record/jdbcsplice/adapter.rb +12 -0
- data/lib/active_record/jdbcsplice/adapter/version.rb +7 -0
- data/lib/arjdbc/splice.rb +7 -0
- data/lib/arjdbc/splice/connection_jdbc_column.rb +10 -0
- data/lib/arjdbc/splice/connection_methods.rb +20 -0
- data/lib/arjdbc/splice/connection_schema_statements.rb +9 -0
- data/lib/arjdbc/splice/derby_adapter_overrides.rb +9 -0
- data/lib/arjdbc/splice/schema_creation.rb +19 -0
- metadata +88 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c3f9e871cdb527698fbec03fde007091dfb44e25
|
4
|
+
data.tar.gz: 50ca0ee40c1682d5686df2d06b60ece014b5a773
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 737d40404678f1f919260877f7662ee996b67b03395f6e49d14af7789c53cfc0010d6de960ba48f570a7dadacc4ebc0411f53f8cf8b1d02ae33eadfa3f0d65a4
|
7
|
+
data.tar.gz: 2665ff2fd00aac56bdf56012fe46741f37812b3c9e6a8c471dabb4d1c119314f11d7025bfe091b84aabe63d5200c446c60fde7a359cd9c1fef00c1d214a9c5eb
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# Activerecord::Jdbcsplice::Adapter
|
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
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'activerecord-jdbcsplice-adapter'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install activerecord-jdbcsplice-adapter
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
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.
|
30
|
+
|
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
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/activerecord-jdbcsplice-adapter.
|
36
|
+
|
37
|
+
|
38
|
+
## License
|
39
|
+
|
40
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'active_record/jdbcsplice/adapter/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "activerecord-jdbcsplice-adapter"
|
8
|
+
spec.version = Activerecord::Jdbcsplice::Adapter::VERSION
|
9
|
+
spec.authors = ["Kolosek"]
|
10
|
+
spec.email = ["office@kolosek.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Splice JDBC adapter for JRuby on Rails.}
|
13
|
+
spec.description = %q{Splice Engine JDBC adapter for JRuby on Rails.}
|
14
|
+
spec.homepage = "http://splicemachine.com"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.add_dependency 'activerecord-jdbc-adapter', "~> 1.3.21"
|
21
|
+
spec.add_dependency 'jdbc-splice', '~> 0.1'
|
22
|
+
end
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "activerecord/jdbcsplice/adapter"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,5 @@
|
|
1
|
+
# NOTE: required by AR resolver with 'jdbcderby' adapter configuration :
|
2
|
+
# we should make sure a jdbcderby_connection is setup on ActiveRecord::Base
|
3
|
+
require 'arjdbc/splice'
|
4
|
+
# all setup should be performed in arjdbc/derby to avoid circular requires
|
5
|
+
# this should not be required from any loads perormed by arjdbc/derby code
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require "active_record/jdbcsplice/adapter/version"
|
2
|
+
|
3
|
+
# NOTE: here for Bundler to auto-load the gem unless :require => false
|
4
|
+
# require 'arjdbc/derby'
|
5
|
+
# require 'activerecord/connection_adapters/jdbcsplice_adapter'
|
6
|
+
|
7
|
+
module Activerecord
|
8
|
+
module Jdbcsplice
|
9
|
+
module Adapter
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
ActiveRecord::ConnectionAdapters::JdbcColumn.class_eval do
|
2
|
+
|
3
|
+
def default_value(value)
|
4
|
+
# JDBC returns column default strings with actual single quotes around the value.
|
5
|
+
return $1 if value =~ /^'(.*)'$/
|
6
|
+
return nil if value == "GENERATED_BY_DEFAULT"
|
7
|
+
value
|
8
|
+
end
|
9
|
+
|
10
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
ArJdbc::ConnectionMethods.module_eval do
|
2
|
+
def splice_connection(config)
|
3
|
+
config[:adapter_spec] ||= ::ArJdbc::Derby
|
4
|
+
|
5
|
+
return jndi_connection(config) if jndi_config?(config)
|
6
|
+
|
7
|
+
begin
|
8
|
+
require 'jdbc/splice'
|
9
|
+
::Jdbc::Splice.load_driver(:require) if defined?(::Jdbc::Splice.load_driver)
|
10
|
+
rescue LoadError # assuming driver.jar is on the class-path
|
11
|
+
end
|
12
|
+
|
13
|
+
config[:url] ||= "jdbc:splice:#{config[:database]};create=true"
|
14
|
+
config[:driver] ||= defined?(::Jdbc::Splice.driver_name) ?
|
15
|
+
::Jdbc::Splice.driver_name : 'com.splicemachine.db.jdbc.ClientDriver'
|
16
|
+
|
17
|
+
embedded_driver(config)
|
18
|
+
end
|
19
|
+
alias_method :jdbcsplice_connection, :splice_connection
|
20
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module ArJdbc
|
2
|
+
module Derby
|
3
|
+
# @private
|
4
|
+
class SchemaCreation < ::ActiveRecord::ConnectionAdapters::AbstractAdapter::SchemaCreation
|
5
|
+
|
6
|
+
# @override
|
7
|
+
def visit_AddForeignKey(o)
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def schema_creation
|
16
|
+
SchemaCreation.new self
|
17
|
+
end
|
18
|
+
|
19
|
+
end if ::ActiveRecord::ConnectionAdapters::AbstractAdapter.const_defined? :SchemaCreation
|
metadata
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: activerecord-jdbcsplice-adapter
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kolosek
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-11-16 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activerecord-jdbc-adapter
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.3.21
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.3.21
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: jdbc-splice
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.1'
|
41
|
+
description: Splice Engine JDBC adapter for JRuby on Rails.
|
42
|
+
email:
|
43
|
+
- office@kolosek.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- ".gitignore"
|
49
|
+
- Gemfile
|
50
|
+
- README.md
|
51
|
+
- Rakefile
|
52
|
+
- activerecord-jdbcsplice-adapter.gemspec
|
53
|
+
- bin/console
|
54
|
+
- bin/setup
|
55
|
+
- lib/active_record/connection_adapters/jdbcsplice_adapter.rb
|
56
|
+
- lib/active_record/jdbcsplice/adapter.rb
|
57
|
+
- lib/active_record/jdbcsplice/adapter/version.rb
|
58
|
+
- lib/arjdbc/splice.rb
|
59
|
+
- lib/arjdbc/splice/connection_jdbc_column.rb
|
60
|
+
- lib/arjdbc/splice/connection_methods.rb
|
61
|
+
- lib/arjdbc/splice/connection_schema_statements.rb
|
62
|
+
- lib/arjdbc/splice/derby_adapter_overrides.rb
|
63
|
+
- lib/arjdbc/splice/schema_creation.rb
|
64
|
+
homepage: http://splicemachine.com
|
65
|
+
licenses:
|
66
|
+
- MIT
|
67
|
+
metadata: {}
|
68
|
+
post_install_message:
|
69
|
+
rdoc_options: []
|
70
|
+
require_paths:
|
71
|
+
- lib
|
72
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
requirements: []
|
83
|
+
rubyforge_project:
|
84
|
+
rubygems_version: 2.5.1
|
85
|
+
signing_key:
|
86
|
+
specification_version: 4
|
87
|
+
summary: Splice JDBC adapter for JRuby on Rails.
|
88
|
+
test_files: []
|