dwh 0.1.0 → 0.1.1
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 +4 -4
- data/README.md +5 -4
- data/Rakefile +1 -1
- data/docs/DWH/Adapters/Adapter.html +33 -27
- data/docs/DWH/Adapters/Athena.html +25 -21
- data/docs/DWH/Adapters/Boolean.html +1 -1
- data/docs/DWH/Adapters/Druid.html +18 -12
- data/docs/DWH/Adapters/DuckDb.html +29 -27
- data/docs/DWH/Adapters/MySql.html +25 -19
- data/docs/DWH/Adapters/OpenAuthorizable/ClassMethods.html +3 -6
- data/docs/DWH/Adapters/OpenAuthorizable.html +5 -10
- data/docs/DWH/Adapters/Postgres.html +27 -23
- data/docs/DWH/Adapters/Snowflake.html +39 -24
- data/docs/DWH/Adapters/SqlServer.html +27 -25
- data/docs/DWH/Adapters/Trino.html +30 -30
- data/docs/DWH/Adapters.html +1 -1
- data/docs/DWH/AuthenticationError.html +1 -1
- data/docs/DWH/Behaviors.html +6 -11
- data/docs/DWH/Capabilities.html +10 -26
- data/docs/DWH/Column.html +7 -15
- data/docs/DWH/ConfigError.html +1 -1
- data/docs/DWH/ConnectionError.html +1 -1
- data/docs/DWH/DWHError.html +1 -1
- data/docs/DWH/ExecutionError.html +1 -1
- data/docs/DWH/Factory.html +1 -1
- data/docs/DWH/Functions/Arrays.html +8 -8
- data/docs/DWH/Functions/Dates.html +5 -7
- data/docs/DWH/Functions/ExtractDatePart.html +13 -25
- data/docs/DWH/Functions/Nulls.html +3 -3
- data/docs/DWH/Functions.html +6 -9
- data/docs/DWH/Logger.html +3 -5
- data/docs/DWH/OAuthError.html +1 -1
- data/docs/DWH/Settings.html +6 -9
- data/docs/DWH/StreamingStats.html +2 -3
- data/docs/DWH/Table.html +14 -26
- data/docs/DWH/TableStats.html +1 -1
- data/docs/DWH/TokenExpiredError.html +1 -1
- data/docs/DWH/UnsupportedCapability.html +1 -1
- data/docs/DWH.html +1 -1
- data/docs/_index.html +1 -1
- data/docs/file.README.html +43 -48
- data/docs/file.adapters.html +318 -343
- data/docs/file.creating-adapters.html +347 -357
- data/docs/file.getting-started.html +143 -151
- data/docs/file.usage.html +257 -278
- data/docs/index.html +43 -48
- data/docs/top-level-namespace.html +1 -1
- data/lib/dwh/adapters.rb +2 -2
- data/lib/dwh/version.rb +1 -1
- metadata +2 -2
data/docs/index.html
CHANGED
@@ -57,15 +57,14 @@
|
|
57
57
|
<div class="clear"></div>
|
58
58
|
</div>
|
59
59
|
|
60
|
-
<div id="content"><div id='filecontents'>
|
61
|
-
<p><a href="https://github.com/stratasite/dwh/actions"><img src="https://github.com/stratasite/dwh/workflows/Ruby/badge.svg" alt="Ruby" /></a></p>
|
60
|
+
<div id="content"><div id='filecontents'><p><a href="https://github.com/stratasite/dwh/actions"><img src="https://github.com/stratasite/dwh/workflows/Ruby/badge.svg" alt="Ruby"></a></p>
|
62
61
|
|
63
|
-
<h1 id="dwh
|
62
|
+
<h1 id="dwh-data-warehouse-adapter-library">DWH - Data Warehouse Adapter Library</h1>
|
64
63
|
|
65
64
|
<p>A light weight library to connect, introspect, and query popular databases over a unified interface. This gem is intended for analtyical workloads. The library also provides database specific translations for common functions like <code>date_trunc</code>, <code>date_add</code> etc. The function tranlation is not comprehensive. But, it does provides good coverage for date handling, and some array handling as well.</p>
|
66
65
|
|
67
66
|
<blockquote>
|
68
|
-
|
67
|
+
<p>[!NOTE]
|
69
68
|
<strong>This is not an ORM</strong> nor will it cast types to ruby unless the underlying client does it out of the box. The goal here is to create an Architecture where new databases can be onboarded quickly.</p>
|
70
69
|
</blockquote>
|
71
70
|
|
@@ -78,57 +77,55 @@
|
|
78
77
|
<h2 id="features">Features</h2>
|
79
78
|
|
80
79
|
<ul>
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
80
|
+
<li><strong>Unified Interface</strong>: Connect to multiple database types using the same API</li>
|
81
|
+
<li><strong>SQL Function Translation</strong>: Automatically translates common SQL functions to database-specific syntax</li>
|
82
|
+
<li><strong>Connection Pooling</strong>: Built-in connection pool management for high-performance applications</li>
|
83
|
+
<li><strong>Rich Metadata</strong>: Extract table schemas, column information, and statistics</li>
|
85
84
|
</ul>
|
86
85
|
|
87
86
|
<h2 id="supported-databases">Supported Databases</h2>
|
88
87
|
|
89
88
|
<ul>
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
89
|
+
<li><strong>Snowflake</strong> - High performance cloud warehouse</li>
|
90
|
+
<li><strong>Trino</strong> (formerly Presto) - Distributed SQL query engine</li>
|
91
|
+
<li><strong>AWS Athena</strong> - AWS big data warehouse</li>
|
92
|
+
<li><strong>Apache Druid</strong> - Real-time analytics database</li>
|
93
|
+
<li><strong>DuckDB</strong> - In-process analytical database</li>
|
94
|
+
<li><strong>PostgreSQL</strong> - Full-featured RDBMS with advanced SQL support</li>
|
95
|
+
<li><strong>MySQL</strong> - Popular open-source database</li>
|
96
|
+
<li><strong>SQL Server</strong> - Microsoft's enterprise database</li>
|
98
97
|
</ul>
|
99
98
|
|
100
99
|
<h2 id="integrations-coming-soon">Integrations Coming Soon</h2>
|
101
100
|
|
102
101
|
<ul>
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
102
|
+
<li><strong>Redshift</strong> - AWS data warehouse platform</li>
|
103
|
+
<li><strong>ClickHouse</strong> - High performance analytical db</li>
|
104
|
+
<li><strong>Databricks</strong> - Big data compute engine</li>
|
105
|
+
<li><strong>MotherDuck</strong> - Hosted DuckDB service</li>
|
107
106
|
</ul>
|
108
107
|
|
109
108
|
<h2 id="quick-start">Quick Start</h2>
|
110
109
|
|
111
110
|
<p>Install it yourself as:</p>
|
112
111
|
|
113
|
-
<
|
114
|
-
|
115
|
-
</code></p>
|
112
|
+
<pre class="code bash"><code class="bash">gem install dwh
|
113
|
+
</code></pre>
|
116
114
|
|
117
115
|
<h3 id="connect-and-execute-a-basic-query">Connect and Execute a Basic Query</h3>
|
118
116
|
|
119
|
-
<
|
120
|
-
require ‘dwh’</p>
|
117
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dwh</span><span class='tstring_end'>'</span></span>
|
121
118
|
|
122
|
-
<
|
123
|
-
|
124
|
-
host
|
125
|
-
port
|
126
|
-
protocol
|
127
|
-
})</
|
119
|
+
<span class='comment'># Connect to Druid
|
120
|
+
</span><span class='id identifier rubyid_druid'>druid</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="DWH.html" title="DWH (module)">DWH</a></span></span><span class='period'>.</span><span class='id identifier rubyid_create'><span class='object_link'><a href="DWH/Factory.html#create-instance_method" title="DWH::Factory#create (method)">create</a></span></span><span class='lparen'>(</span><span class='symbol'>:druid</span><span class='comma'>,</span> <span class='lbrace'>{</span>
|
121
|
+
<span class='label'>host:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>localhost</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
122
|
+
<span class='label'>port:</span> <span class='int'>8080</span><span class='comma'>,</span>
|
123
|
+
<span class='label'>protocol:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>http</span><span class='tstring_end'>'</span></span>
|
124
|
+
<span class='rbrace'>}</span><span class='rparen'>)</span>
|
128
125
|
|
129
|
-
<
|
130
|
-
|
131
|
-
|
126
|
+
<span class='comment'># basic query execution
|
127
|
+
</span><span class='id identifier rubyid_results'>results</span> <span class='op'>=</span> <span class='id identifier rubyid_druid'>druid</span><span class='period'>.</span><span class='id identifier rubyid_execute'>execute</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>SELECT * FROM web_sales</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>format:</span> <span class='symbol'>:csv</span><span class='rparen'>)</span>
|
128
|
+
</code></pre>
|
132
129
|
|
133
130
|
<h2 id="core-api">Core API</h2>
|
134
131
|
|
@@ -152,10 +149,11 @@ require ‘dwh’</p>
|
|
152
149
|
<h2 id="tutorials-and-guides">Tutorials and Guides</h2>
|
153
150
|
|
154
151
|
<ul>
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
152
|
+
<li><a href="https://strata.site/dwh/file.getting-started.html">Getting Started</a></li>
|
153
|
+
<li><a href="https://strata.site/dwh/file.adapters.html">Adapter Configuration</a></li>
|
154
|
+
<li><a href="https://strata.site/dwh/file.creating-adapters.html">Creating an Adapter</a></li>
|
155
|
+
<li><a href="https://strata.site/dwh/file.usage.html">Advanced Usage</a></li>
|
156
|
+
<li><a href="https://strata.site/dwh/DWH.html">API</a></li>
|
159
157
|
</ul>
|
160
158
|
|
161
159
|
<h2 id="testing">Testing</h2>
|
@@ -164,21 +162,18 @@ require ‘dwh’</p>
|
|
164
162
|
|
165
163
|
<p>Run Unit Tests:</p>
|
166
164
|
|
167
|
-
<
|
168
|
-
|
169
|
-
</code></p>
|
165
|
+
<pre class="code bash"><code class="bash">bundle exec rake test:unit
|
166
|
+
</code></pre>
|
170
167
|
|
171
168
|
<p>Run tests on RDBMS dbs:</p>
|
172
169
|
|
173
|
-
<
|
174
|
-
|
175
|
-
</code></p>
|
170
|
+
<pre class="code bash"><code class="bash">bundle exec rake test:system:rdbms
|
171
|
+
</code></pre>
|
176
172
|
|
177
173
|
<p>Run tests on druid:</p>
|
178
174
|
|
179
|
-
<
|
180
|
-
|
181
|
-
</code></p>
|
175
|
+
<pre class="code bash"><code class="bash">bundle exec rake test:system:druid
|
176
|
+
</code></pre>
|
182
177
|
|
183
178
|
<h2 id="development">Development</h2>
|
184
179
|
|
@@ -200,7 +195,7 @@ bundle exec rake test:system:druid
|
|
200
195
|
</div></div>
|
201
196
|
|
202
197
|
<div id="footer">
|
203
|
-
Generated on
|
198
|
+
Generated on Mon Aug 25 10:59:27 2025 by
|
204
199
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
205
200
|
0.9.37 (ruby-3.4.4).
|
206
201
|
</div>
|
@@ -100,7 +100,7 @@
|
|
100
100
|
</div>
|
101
101
|
|
102
102
|
<div id="footer">
|
103
|
-
Generated on
|
103
|
+
Generated on Mon Aug 25 10:59:27 2025 by
|
104
104
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
105
105
|
0.9.37 (ruby-3.4.4).
|
106
106
|
</div>
|
data/lib/dwh/adapters.rb
CHANGED
@@ -335,7 +335,7 @@ module DWH
|
|
335
335
|
|
336
336
|
# Check for missing required parameters
|
337
337
|
missing_params = definitions.select do |name, options|
|
338
|
-
options[:required] && !config
|
338
|
+
options[:required] && !config[name] && options[:default].nil?
|
339
339
|
end
|
340
340
|
|
341
341
|
if missing_params.any?
|
@@ -351,7 +351,7 @@ module DWH
|
|
351
351
|
|
352
352
|
raise ConfigError, "Invalid value. Only allowed: #{opts[:allowed]}." if opts[:allowed].any? && !opts[:allowed].include?(config[name])
|
353
353
|
|
354
|
-
config[name] = opts[:default] if opts[:default] && !config
|
354
|
+
config[name] = opts[:default] if opts[:default] && !config[name]
|
355
355
|
|
356
356
|
if opts[:required] && !config[name].is_a?(opts[:type]) && !opts[:type].is_a?(Boolean)
|
357
357
|
raise ConfigError, "#{name} should be a #{opts[:type]}. Got #{opts[name.to_sym].class.name}"
|
data/lib/dwh/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dwh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ajo Abraham
|
@@ -225,7 +225,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
225
225
|
- !ruby/object:Gem::Version
|
226
226
|
version: '0'
|
227
227
|
requirements: []
|
228
|
-
rubygems_version: 3.
|
228
|
+
rubygems_version: 3.7.1
|
229
229
|
specification_version: 4
|
230
230
|
summary: Data warehouse adapters for interacting with popular data warehouses.
|
231
231
|
test_files: []
|