purview 1.5.0 → 1.6.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.
@@ -1,4 +1,4 @@
1
- safe_require('jdbc-postgres')
1
+ safe_require('jdbc/postgres')
2
2
 
3
3
  if defined?(Jdbc::Postgres)
4
4
  Jdbc::Postgres.load_driver
@@ -0,0 +1,21 @@
1
+ safe_require('jdbc/sqlite3')
2
+
3
+ if defined?(Jdbc::SQLite3)
4
+ Jdbc::SQLite3.load_driver
5
+
6
+ module Purview
7
+ module RawConnections
8
+ module JDBC
9
+ class SQLite3 < Base
10
+ private
11
+
12
+ def url
13
+ "jdbc:sqlite://#{database}"
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+
20
+ Purview::RawConnections::SQLite = Purview::RawConnections::JDBC::SQLite3
21
+ end
@@ -0,0 +1,34 @@
1
+ safe_require('sqlite3')
2
+
3
+ if defined?(SQLite3)
4
+ module Purview
5
+ module RawConnections
6
+ class SQLite3 < Base
7
+ private
8
+
9
+ def execute_sql(sql, opts={})
10
+ raw_connection.execute(sql)
11
+ end
12
+
13
+ def extract_rows(result)
14
+ result && result.map do |rows|
15
+ rows.reduce({}) do |memo, (key, value)|
16
+ memo[key.to_sym] = value unless key.is_a?(Integer)
17
+ memo
18
+ end
19
+ end
20
+ end
21
+
22
+ def extract_rows_affected(result)
23
+ raw_connection.changes
24
+ end
25
+
26
+ def new_connection
27
+ ::SQLite3::Database.new(database.to_s, {:results_as_hash => true})
28
+ end
29
+ end
30
+ end
31
+ end
32
+
33
+ Purview::RawConnections::SQLite = Purview::RawConnections::SQLite3
34
+ end
@@ -12,7 +12,8 @@ module Purview
12
12
  end
13
13
 
14
14
  def method_missing(method, *args, &block)
15
- raise NoMethodError if args.empty?
15
+ method = method.to_sym unless method.is_a?(Symbol)
16
+ raise NoMethodError if args.empty? && !respond_to?(method)
16
17
  super
17
18
  end
18
19
  end
@@ -1,3 +1,3 @@
1
1
  module Purview
2
- VERSION = '1.5.0'
2
+ VERSION = '1.6.0'
3
3
  end
data/purview.gemspec CHANGED
@@ -21,10 +21,11 @@ Gem::Specification.new do |gem|
21
21
 
22
22
  gem.requirements << '`mysql2` or `jdbc-mysql` gem'
23
23
  gem.requirements << '`pg` or `jdbc-postgres` gem'
24
+ gem.requirements << '`sqlite3` or `jdbc-sqlite3` gem'
24
25
  gem.requirements << '`tiny_tds` or `jdbc-jtds` gem'
25
26
 
26
27
  gem.add_development_dependency 'bundler', '~> 1.0'
27
28
  gem.add_development_dependency 'pry', '~> 0.10'
28
- gem.add_development_dependency 'rake', '~> 10.4'
29
- gem.add_development_dependency 'rspec', '~> 3.2'
29
+ gem.add_development_dependency 'rake', '~> 12.0'
30
+ gem.add_development_dependency 'rspec', '~> 3.0'
30
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: purview
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan W. Zaleski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-12 00:00:00.000000000 Z
11
+ date: 2017-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -44,28 +44,28 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '10.4'
47
+ version: '12.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '10.4'
54
+ version: '12.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '3.2'
61
+ version: '3.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '3.2'
68
+ version: '3.0'
69
69
  description: An easy to use configuration-driven framework created to simplify data-warehousing
70
70
  email:
71
71
  - JonathanZaleski@gmail.com
@@ -102,15 +102,19 @@ files:
102
102
  - lib/purview/connections/mssql.rb
103
103
  - lib/purview/connections/mysql.rb
104
104
  - lib/purview/connections/postgresql.rb
105
+ - lib/purview/connections/sqlite.rb
105
106
  - lib/purview/databases.rb
106
107
  - lib/purview/databases/base.rb
108
+ - lib/purview/databases/mssql.rb
107
109
  - lib/purview/databases/mysql.rb
108
110
  - lib/purview/databases/postgresql.rb
111
+ - lib/purview/databases/sqlite.rb
109
112
  - lib/purview/dialects.rb
110
113
  - lib/purview/dialects/base.rb
111
114
  - lib/purview/dialects/mssql.rb
112
115
  - lib/purview/dialects/mysql.rb
113
116
  - lib/purview/dialects/postgresql.rb
117
+ - lib/purview/dialects/sqlite.rb
114
118
  - lib/purview/exceptions.rb
115
119
  - lib/purview/exceptions/base.rb
116
120
  - lib/purview/exceptions/base_table.rb
@@ -136,8 +140,10 @@ files:
136
140
  - lib/purview/indices/simple.rb
137
141
  - lib/purview/loaders.rb
138
142
  - lib/purview/loaders/base.rb
143
+ - lib/purview/loaders/mssql.rb
139
144
  - lib/purview/loaders/mysql.rb
140
145
  - lib/purview/loaders/postgresql.rb
146
+ - lib/purview/loaders/sqlite.rb
141
147
  - lib/purview/loggers.rb
142
148
  - lib/purview/loggers/base.rb
143
149
  - lib/purview/loggers/console.rb
@@ -157,6 +163,7 @@ files:
157
163
  - lib/purview/pullers/mssql.rb
158
164
  - lib/purview/pullers/mysql.rb
159
165
  - lib/purview/pullers/postgresql.rb
166
+ - lib/purview/pullers/sqlite.rb
160
167
  - lib/purview/pullers/uri.rb
161
168
  - lib/purview/raw_connections.rb
162
169
  - lib/purview/raw_connections/base.rb
@@ -165,8 +172,10 @@ files:
165
172
  - lib/purview/raw_connections/jdbc/jtds.rb
166
173
  - lib/purview/raw_connections/jdbc/mysql.rb
167
174
  - lib/purview/raw_connections/jdbc/postgres.rb
175
+ - lib/purview/raw_connections/jdbc/sqlite3.rb
168
176
  - lib/purview/raw_connections/mysql2.rb
169
177
  - lib/purview/raw_connections/pg.rb
178
+ - lib/purview/raw_connections/sqlite3.rb
170
179
  - lib/purview/raw_connections/tiny_tds.rb
171
180
  - lib/purview/refinements.rb
172
181
  - lib/purview/refinements/object.rb
@@ -219,9 +228,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
219
228
  requirements:
220
229
  - "`mysql2` or `jdbc-mysql` gem"
221
230
  - "`pg` or `jdbc-postgres` gem"
231
+ - "`sqlite3` or `jdbc-sqlite3` gem"
222
232
  - "`tiny_tds` or `jdbc-jtds` gem"
223
233
  rubyforge_project:
224
- rubygems_version: 2.4.6
234
+ rubygems_version: 2.6.10
225
235
  signing_key:
226
236
  specification_version: 4
227
237
  summary: A framework created to simplify data-warehousing