sequel-openedge-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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f6feb62ded8b800887cb0b78f8524178d6ffd0fd
4
+ data.tar.gz: 9903b0e7a108546ad9ea8408371607f0eaade216
5
+ SHA512:
6
+ metadata.gz: 13433004ba3986e07e9c40c3d46c770adc99ba37960df808def92ca0db4de4ce55f5ac1116e1f9f53884b90c27a26dc70d330e3029a48bf41ca9550a22ffcd38
7
+ data.tar.gz: dade15c3ce5d0ac3106cc6017df38598e7cb045cd29696bccbf4d50324ec5f90c10a16e51ac669892bb6404934cfdcb07d2b12239166bd3cec10d10a0389e503
@@ -0,0 +1,34 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /test/tmp/
9
+ /test/version_tmp/
10
+ /tmp/
11
+
12
+ ## Specific to RubyMotion:
13
+ .dat*
14
+ .repl_history
15
+ build/
16
+
17
+ ## Documentation cache and generated files:
18
+ /.yardoc/
19
+ /_yardoc/
20
+ /doc/
21
+ /rdoc/
22
+
23
+ ## Environment normalisation:
24
+ /.bundle/
25
+ /lib/bundler/man/
26
+
27
+ # for a library or gem, you might want to ignore these files since the code is
28
+ # intended to run in multiple environments; otherwise, check them in:
29
+ # Gemfile.lock
30
+ # .ruby-version
31
+ # .ruby-gemset
32
+
33
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
34
+ .rvmrc
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 gimoh
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,33 @@
1
+ sequel-openedge-adapter
2
+ =======================
3
+
4
+ Sequel adapter for OpenEdge RDBMS
5
+
6
+ Can use ODBC/JDBC drivers provided by DataDirect, bundled with OpenEdge or
7
+ from client networking installation.
8
+
9
+ ## Installation
10
+
11
+ Note that this currently requires sequel master branch, it relies on a recent
12
+ improvement ( jeremyevans/sequel@673bda5ec6a79c189dc37c03d191211e1701cc47 ) of
13
+ autoloading of external adapters.
14
+
15
+ gem install sequel-openedge-adapter
16
+
17
+ Get the drivers from OpenEdge install dir.
18
+
19
+ JDBC drivers are in `java/` subdirectory and you need `progress.jar` and
20
+ `pool.jar`. ODBC drivers are in `odbc/` subdirectory.
21
+
22
+ ## Usage
23
+
24
+ ### JRuby/JDBC
25
+
26
+ Put the drivers in CLASSPATH:
27
+
28
+ export CLASSPATH=/path/to/progress.jar:/path/to/pool.jar
29
+
30
+ Then:
31
+
32
+ require 'sequel'
33
+ DB = Sequel.connect('jdbc:datadirect:openedge://HOST:PORT;databaseName=DATABASE;user=USER')
@@ -0,0 +1,11 @@
1
+ # Register the driver.
2
+ Sequel.synchronize do
3
+ Sequel::JDBC::DATABASE_SETUP[:datadirect] = proc do |db|
4
+ raise(Error, 'only OpenEdge driver is currently supported') \
5
+ if db.uri.split(':')[2] != 'openedge'
6
+ require 'sequel/adapters/jdbc/openedge'
7
+ db.extend(Sequel::JDBC::OpenEdge::DatabaseMethods)
8
+ db.extend_datasets Sequel::OpenEdge::DatasetMethods
9
+ com.ddtek.jdbc.openedge.OpenEdgeDriver
10
+ end
11
+ end
@@ -0,0 +1,18 @@
1
+ Sequel::JDBC.load_driver('com.ddtek.jdbc.openedge.OpenEdgeDriver')
2
+ require 'sequel/adapters/shared/openedge'
3
+ Sequel.require 'adapters/jdbc/transactions'
4
+
5
+ module Sequel
6
+ module JDBC
7
+ # Database and Dataset instance methods for OpenEdge v10+ specific
8
+ # support via JDBC.
9
+ module OpenEdge
10
+ # Database instance methods for OpenEdge databases accessed via JDBC.
11
+ module DatabaseMethods
12
+ extend Sequel::Database::ResetIdentifierMangling
13
+ include Sequel::OpenEdge::DatabaseMethods
14
+ include Sequel::JDBC::Transactions
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,9 @@
1
+ require 'sequel/adapters/shared/openedge'
2
+
3
+ # Register the driver.
4
+ Sequel.synchronize do
5
+ Sequel::ODBC::DATABASE_SETUP[:openedge] = proc do |db|
6
+ db.extend(Sequel::OpenEdge::DatabaseMethods)
7
+ db.extend_datasets(Sequel::OpenEdge::DatasetMethods)
8
+ end
9
+ end
@@ -0,0 +1,37 @@
1
+ module Sequel
2
+ module OpenEdge
3
+ module DatabaseMethods
4
+ extend Sequel::Database::ResetIdentifierMangling
5
+
6
+ # OpenEdge uses the :openedge database type.
7
+ def database_type
8
+ :openedge
9
+ end
10
+ end
11
+
12
+ module DatasetMethods
13
+ Dataset.def_sql_method(self, :select, %w'select limit distinct columns from join where group order having with compounds')
14
+
15
+ # OpenEdge requires SQL standard datetimes
16
+ def requires_sql_standard_datetimes?
17
+ true
18
+ end
19
+
20
+ # OpenEdge does not support INTERSECT or EXCEPT
21
+ def supports_intersect_except?
22
+ false
23
+ end
24
+
25
+ private
26
+
27
+ # OpenEdge uses TOP for limit.
28
+ def select_limit_sql(sql)
29
+ raise(Error, "OFFSET not supported") if @opts[:offset]
30
+ if l = @opts[:limit]
31
+ sql << " TOP "
32
+ literal_append(sql, l)
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,27 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |gem|
4
+ gem.name = 'sequel-openedge-adapter'
5
+ gem.version = '0.1.0'
6
+
7
+ gem.authors = ['gimoh']
8
+ gem.email = ['gimoh@bitmessage.ch']
9
+ gem.summary = %q{Sequel adapter for OpenEdge RDBMS}
10
+ gem.description = %q{
11
+ == About
12
+ Sequel adapter for OpenEdge RDBMS.
13
+
14
+ Can use ODBC/JDBC drivers provided by DataDirect, bundled with OpenEdge or
15
+ from client networking installation.
16
+
17
+ See project readme for details.
18
+ }
19
+ gem.homepage = 'https://github.com/gimoh/sequel-openedge-adapter'
20
+ gem.license = 'MIT'
21
+
22
+ gem.requirements = 'OpenEdge ODBC/JDBC driver'
23
+
24
+ gem.add_runtime_dependency 'sequel', '~> 4.12'
25
+
26
+ gem.files = `git ls-files`.split("\n")
27
+ end
metadata ADDED
@@ -0,0 +1,75 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sequel-openedge-adapter
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - gimoh
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-07-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: sequel
15
+ version_requirements: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '4.12'
20
+ requirement: !ruby/object:Gem::Requirement
21
+ requirements:
22
+ - - ~>
23
+ - !ruby/object:Gem::Version
24
+ version: '4.12'
25
+ prerelease: false
26
+ type: :runtime
27
+ description: |2
28
+
29
+ == About
30
+ Sequel adapter for OpenEdge RDBMS.
31
+
32
+ Can use ODBC/JDBC drivers provided by DataDirect, bundled with OpenEdge or
33
+ from client networking installation.
34
+
35
+ See project readme for details.
36
+ email:
37
+ - gimoh@bitmessage.ch
38
+ executables: []
39
+ extensions: []
40
+ extra_rdoc_files: []
41
+ files:
42
+ - .gitignore
43
+ - LICENSE
44
+ - README.md
45
+ - lib/sequel/adapters/jdbc/datadirect.rb
46
+ - lib/sequel/adapters/jdbc/openedge.rb
47
+ - lib/sequel/adapters/odbc/openedge.rb
48
+ - lib/sequel/adapters/shared/openedge.rb
49
+ - sequel-openedge-adapter.gemspec
50
+ homepage: https://github.com/gimoh/sequel-openedge-adapter
51
+ licenses:
52
+ - MIT
53
+ metadata: {}
54
+ post_install_message:
55
+ rdoc_options: []
56
+ require_paths:
57
+ - lib
58
+ required_ruby_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ required_rubygems_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - '>='
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ requirements:
69
+ - OpenEdge ODBC/JDBC driver
70
+ rubyforge_project:
71
+ rubygems_version: 2.1.9
72
+ signing_key:
73
+ specification_version: 4
74
+ summary: Sequel adapter for OpenEdge RDBMS
75
+ test_files: []