dwh 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.
Files changed (104) hide show
  1. checksums.yaml +7 -0
  2. data/.rubocop.yml +36 -0
  3. data/CHANGELOG.md +5 -0
  4. data/LICENSE +21 -0
  5. data/README.md +130 -0
  6. data/Rakefile +42 -0
  7. data/docs/DWH/Adapters/Adapter.html +3053 -0
  8. data/docs/DWH/Adapters/Athena.html +1704 -0
  9. data/docs/DWH/Adapters/Boolean.html +121 -0
  10. data/docs/DWH/Adapters/Druid.html +1626 -0
  11. data/docs/DWH/Adapters/DuckDb.html +2012 -0
  12. data/docs/DWH/Adapters/MySql.html +1704 -0
  13. data/docs/DWH/Adapters/OpenAuthorizable/ClassMethods.html +265 -0
  14. data/docs/DWH/Adapters/OpenAuthorizable.html +1102 -0
  15. data/docs/DWH/Adapters/Postgres.html +2000 -0
  16. data/docs/DWH/Adapters/Snowflake.html +1662 -0
  17. data/docs/DWH/Adapters/SqlServer.html +2084 -0
  18. data/docs/DWH/Adapters/Trino.html +1835 -0
  19. data/docs/DWH/Adapters.html +129 -0
  20. data/docs/DWH/AuthenticationError.html +142 -0
  21. data/docs/DWH/Behaviors.html +767 -0
  22. data/docs/DWH/Capabilities.html +748 -0
  23. data/docs/DWH/Column.html +1115 -0
  24. data/docs/DWH/ConfigError.html +143 -0
  25. data/docs/DWH/ConnectionError.html +143 -0
  26. data/docs/DWH/DWHError.html +138 -0
  27. data/docs/DWH/ExecutionError.html +143 -0
  28. data/docs/DWH/Factory.html +1133 -0
  29. data/docs/DWH/Functions/Arrays.html +505 -0
  30. data/docs/DWH/Functions/Dates.html +1644 -0
  31. data/docs/DWH/Functions/ExtractDatePart.html +804 -0
  32. data/docs/DWH/Functions/Nulls.html +377 -0
  33. data/docs/DWH/Functions.html +846 -0
  34. data/docs/DWH/Logger.html +258 -0
  35. data/docs/DWH/OAuthError.html +138 -0
  36. data/docs/DWH/Settings.html +658 -0
  37. data/docs/DWH/StreamingStats.html +804 -0
  38. data/docs/DWH/Table.html +1260 -0
  39. data/docs/DWH/TableStats.html +583 -0
  40. data/docs/DWH/TokenExpiredError.html +142 -0
  41. data/docs/DWH/UnsupportedCapability.html +135 -0
  42. data/docs/DWH.html +220 -0
  43. data/docs/_index.html +471 -0
  44. data/docs/class_list.html +54 -0
  45. data/docs/css/common.css +1 -0
  46. data/docs/css/full_list.css +58 -0
  47. data/docs/css/style.css +503 -0
  48. data/docs/file.README.html +210 -0
  49. data/docs/file.adapters.html +514 -0
  50. data/docs/file.creating-adapters.html +497 -0
  51. data/docs/file.getting-started.html +288 -0
  52. data/docs/file.usage.html +446 -0
  53. data/docs/file_list.html +79 -0
  54. data/docs/frames.html +22 -0
  55. data/docs/guides/adapters.md +445 -0
  56. data/docs/guides/creating-adapters.md +430 -0
  57. data/docs/guides/getting-started.md +225 -0
  58. data/docs/guides/usage.md +378 -0
  59. data/docs/index.html +210 -0
  60. data/docs/js/app.js +344 -0
  61. data/docs/js/full_list.js +242 -0
  62. data/docs/js/jquery.js +4 -0
  63. data/docs/method_list.html +2038 -0
  64. data/docs/top-level-namespace.html +110 -0
  65. data/lib/dwh/adapters/athena.rb +359 -0
  66. data/lib/dwh/adapters/druid.rb +267 -0
  67. data/lib/dwh/adapters/duck_db.rb +235 -0
  68. data/lib/dwh/adapters/my_sql.rb +235 -0
  69. data/lib/dwh/adapters/open_authorizable.rb +215 -0
  70. data/lib/dwh/adapters/postgres.rb +250 -0
  71. data/lib/dwh/adapters/snowflake.rb +489 -0
  72. data/lib/dwh/adapters/sql_server.rb +257 -0
  73. data/lib/dwh/adapters/trino.rb +213 -0
  74. data/lib/dwh/adapters.rb +363 -0
  75. data/lib/dwh/behaviors.rb +67 -0
  76. data/lib/dwh/capabilities.rb +39 -0
  77. data/lib/dwh/column.rb +79 -0
  78. data/lib/dwh/errors.rb +29 -0
  79. data/lib/dwh/factory.rb +125 -0
  80. data/lib/dwh/functions/arrays.rb +42 -0
  81. data/lib/dwh/functions/dates.rb +162 -0
  82. data/lib/dwh/functions/extract_date_part.rb +70 -0
  83. data/lib/dwh/functions/nulls.rb +31 -0
  84. data/lib/dwh/functions.rb +86 -0
  85. data/lib/dwh/logger.rb +50 -0
  86. data/lib/dwh/settings/athena.yml +77 -0
  87. data/lib/dwh/settings/base.yml +81 -0
  88. data/lib/dwh/settings/databricks.yml +51 -0
  89. data/lib/dwh/settings/druid.yml +59 -0
  90. data/lib/dwh/settings/duckdb.yml +44 -0
  91. data/lib/dwh/settings/mysql.yml +67 -0
  92. data/lib/dwh/settings/postgres.yml +30 -0
  93. data/lib/dwh/settings/redshift.yml +52 -0
  94. data/lib/dwh/settings/snowflake.yml +45 -0
  95. data/lib/dwh/settings/sqlserver.yml +80 -0
  96. data/lib/dwh/settings/trino.yml +77 -0
  97. data/lib/dwh/settings.rb +79 -0
  98. data/lib/dwh/streaming_stats.rb +69 -0
  99. data/lib/dwh/table.rb +105 -0
  100. data/lib/dwh/table_stats.rb +51 -0
  101. data/lib/dwh/version.rb +5 -0
  102. data/lib/dwh.rb +54 -0
  103. data/sig/dwh.rbs +4 -0
  104. metadata +231 -0
@@ -0,0 +1,514 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ File: Adapter Configuration
8
+
9
+ &mdash; Documentation by YARD 0.9.37
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "adapters";
19
+ relpath = '';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="file_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="_index.html">Index</a> &raquo;
40
+ <span class="title">File: Adapter Configuration</span>
41
+
42
+ </div>
43
+
44
+ <div id="search">
45
+
46
+ <a class="full_list_link" id="class_list_link"
47
+ href="class_list.html">
48
+
49
+ <svg width="24" height="24">
50
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
51
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
52
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
53
+ </svg>
54
+ </a>
55
+
56
+ </div>
57
+ <div class="clear"></div>
58
+ </div>
59
+
60
+ <div id="content"><div id='filecontents'><h1 id="adapter-configuration">Adapter Configuration</h1>
61
+
62
+ <p>This guide covers all the database adapters supported by DWH and their specific configuration options. Each adapter is designed to work with specific database clients and provides database-specific optimizations.</p>
63
+
64
+ <h2 id="postgresql-adapter">PostgreSQL Adapter</h2>
65
+
66
+ <p>The PostgreSQL adapter uses the <code>pg</code> gem and provides full-featured RDBMS support.</p>
67
+
68
+ <h3 id="basic-configuration">Basic Configuration</h3>
69
+
70
+ <p><code>ruby
71
+ postgres = DWH.create(:postgres, {
72
+ host: 'localhost',
73
+ port: 5432, # Default: 5432
74
+ database: 'mydb',
75
+ schema: 'public', # Default: 'public'
76
+ username: 'user',
77
+ password: 'password',
78
+ client_name: 'My Application' # Default: 'DWH Ruby Gem'
79
+ })
80
+ </code></p>
81
+
82
+ <h3 id="ssl-configuration">SSL Configuration</h3>
83
+
84
+ <p>```ruby
85
+ # Basic SSL
86
+ postgres = DWH.create(:postgres, {
87
+ host: ‘localhost’,
88
+ database: ‘mydb’,
89
+ username: ‘user’,
90
+ password: ‘password’,
91
+ ssl: true,
92
+ extra_connection_params: {
93
+ sslmode: ‘require’ # disable, prefer, require, verify-ca, verify-full
94
+ }
95
+ })</p>
96
+
97
+ <h1 id="certificate-based-ssl">Certificate-based SSL</h1>
98
+ <p>postgres = DWH.create(:postgres, {
99
+ host: ‘localhost’,
100
+ database: ‘mydb’,
101
+ username: ‘user’,
102
+ ssl: true,
103
+ extra_connection_params: {
104
+ sslmode: ‘verify-full’,
105
+ sslrootcert: ‘/path/to/ca-cert.pem’,
106
+ sslcert: ‘/path/to/client-cert.pem’,
107
+ sslkey: ‘/path/to/client-key.pem’
108
+ }
109
+ })
110
+ ```</p>
111
+
112
+ <h3 id="advanced-configuration">Advanced Configuration</h3>
113
+
114
+ <p><code>ruby
115
+ postgres = DWH.create(:postgres, {
116
+ host: 'localhost',
117
+ database: 'mydb',
118
+ username: 'user',
119
+ password: 'password',
120
+ query_timeout: 3600, # seconds, default: 3600
121
+ extra_connection_params: {
122
+ application_name: 'Data Analysis Tool',
123
+ connect_timeout: 10,
124
+ options: '-c maintenance_work_mem=256MB'
125
+ }
126
+ })
127
+ </code></p>
128
+
129
+ <h2 id="snowflake">Snowflake</h2>
130
+
131
+ <p>Snowflake adapter use the REST apis (https) to connect and query. This adapter also supports Multi-Database
132
+ authentication methods: Personal Access Token, Key Pair, and OAuth.</p>
133
+
134
+ <h3 id="basic-connection-with-personal-access-token">Basic connection with Personal Access Token</h3>
135
+
136
+ <p>```ruby
137
+ DWH.create(:snowflake, {
138
+ auth_mode: ‘pat’,
139
+ account_identifier: ‘myorg-myaccount’,
140
+ personal_access_token: ‘your-token-here’,
141
+ warehouse: ‘COMPUTE_WH’,
142
+ database: ‘ANALYTICS’,
143
+ schema: ‘PUBLIC’
144
+ })</p>
145
+
146
+ <p>```</p>
147
+
148
+ <h3 id="connection-with-key-pair-authentication">Connection with Key Pair Authentication</h3>
149
+
150
+ <p>```ruby
151
+ DWH.create(:snowflake, {
152
+ auth_mode: ‘kp’,
153
+ account_identifier: ‘myorg-myaccount.us-east-1’,
154
+ username: ‘john_doe’,
155
+ private_key: ‘/path/to/private_key.pem’,
156
+ warehouse: ‘COMPUTE_WH’,
157
+ database: ‘ANALYTICS’
158
+ })</p>
159
+
160
+ <p>```</p>
161
+
162
+ <h3 id="connecting-with-oauth">Connecting with OAuth</h3>
163
+
164
+ <p>This is the Snowflake OAuth mechanism. Not the External one. You must first create an OAuth security integration and apply to the releveant roles.
165
+ Follow this <a href="https://docs.snowflake.com/en/user-guide/oauth-custom">document</a> for more.</p>
166
+
167
+ <p><code>ruby
168
+ adapter = DWH.create(:snowflake, {
169
+ auth_mode: 'oauth',
170
+ account_identifier: 'myorg-myaccount.us-east-1',
171
+ oauth_client_id: '&lt;YOUR_CLIENT_ID&gt;',
172
+ oauth_client_secret: '&lt;YOUR_CLIENT_SECRET&gt;',
173
+ oauth_redirect_url: 'https://localhost:3030/some/path',
174
+ database: 'ANALYTICS',
175
+ client_name: 'myapp' # sent as user agent header value
176
+ })
177
+ </code></p>
178
+
179
+ <p>To successfully use OAuth you have to pass the adapter valid access and refresh tokens. Or, it can generate them from a valid authorization code.</p>
180
+
181
+ <p>The typical flow is like so:</p>
182
+
183
+ <ol>
184
+ <li>Generate an authorization code by visiting the url generated by <code>adapter.authorization_url.</code> This will redirect to the configured <code>oauth_redirect_url.</code> You must be able to retrieve the <code>code</code> from there.</li>
185
+ <li>Take the code from above and generate new access tokens: <code>adapter.generate_oauth_tokens(code)</code>. This will return Hash with access_token and refresh_token. You can cache and reuse this until the refresh_token gets expired. This method will also apply the token to the current adapter instance.</li>
186
+ <li>You can apply an existing set of tokens like so:<code>adapter.apply_oauth_tokens(access_token: token, refresh_token: token, expires_at: Time.now)</code></li>
187
+ </ol>
188
+
189
+ <h2 id="mysql-adapter">MySQL Adapter</h2>
190
+
191
+ <p>The MySQL adapter uses the <code>mysql2</code> gem. Note that MySQL’s concept of “database” maps to “schema” in DWH.</p>
192
+
193
+ <h3 id="basic-configuration-1">Basic Configuration</h3>
194
+
195
+ <p><code>ruby
196
+ mysql = DWH.create(:mysql, {
197
+ host: '127.0.0.1', # Use 127.0.0.1 for local Docker instances
198
+ port: 3306, # Default: 3306
199
+ database: 'mydb',
200
+ username: 'user',
201
+ password: 'password',
202
+ client_name: 'My Application' # Default: 'DWH Ruby Gem'
203
+ })
204
+ </code></p>
205
+
206
+ <h3 id="ssl-configuration-1">SSL Configuration</h3>
207
+
208
+ <p><code>ruby
209
+ # Basic SSL
210
+ mysql = DWH.create(:mysql, {
211
+ host: '127.0.0.1',
212
+ database: 'mydb',
213
+ username: 'user',
214
+ password: 'password',
215
+ ssl: true, # Defaults ssl_mode to 'required'
216
+ extra_connection_params: {
217
+ ssl_mode: 'verify_identity', # disabled, preferred, required, verify_ca, verify_identity
218
+ sslca: '/path/to/ca-cert.pem',
219
+ sslcert: '/path/to/client-cert.pem',
220
+ sslkey: '/path/to/client-key.pem'
221
+ }
222
+ })
223
+ </code></p>
224
+
225
+ <h3 id="advanced-configuration-1">Advanced Configuration</h3>
226
+
227
+ <p><code>ruby
228
+ mysql = DWH.create(:mysql, {
229
+ host: 'mysql.example.com',
230
+ database: 'analytics',
231
+ username: 'analyst',
232
+ password: 'password',
233
+ client_name: "My App", # defaults to 'DWH Ruby Gem'
234
+ query_timeout: 1800, # seconds, default: 3600
235
+ extra_connection_params: {
236
+ encoding: 'utf8mb4',
237
+ read_timeout: 60,
238
+ write_timeout: 60,
239
+ connect_timeout: 10
240
+ }
241
+ })
242
+ </code></p>
243
+
244
+ <h2 id="sql-server-adapter">SQL Server Adapter</h2>
245
+
246
+ <p>The SQL Server adapter uses the <code>tiny_tds</code> gem and supports both on-premises and Azure SQL Server.</p>
247
+
248
+ <h3 id="basic-configuration-2">Basic Configuration</h3>
249
+
250
+ <p><code>ruby
251
+ sqlserver = DWH.create(:sqlserver, {
252
+ host: 'localhost',
253
+ port: 1433, # Default: 1433
254
+ database: 'mydb',
255
+ username: 'sa',
256
+ password: 'password',
257
+ client_name: 'My Application' # Default: 'DWH Ruby Gem'
258
+ })
259
+ </code></p>
260
+
261
+ <h3 id="azure-sql-server">Azure SQL Server</h3>
262
+
263
+ <p><code>ruby
264
+ azure_sql = DWH.create(:sqlserver, {
265
+ host: 'myserver.database.windows.net',
266
+ database: 'mydb',
267
+ username: 'myuser@myserver',
268
+ password: 'password',
269
+ azure: true,
270
+ client_name: 'My Application'
271
+ })
272
+ </code></p>
273
+
274
+ <h3 id="advanced-configuration-2">Advanced Configuration</h3>
275
+
276
+ <p><code>ruby
277
+ sqlserver = DWH.create(:sqlserver, {
278
+ host: 'sql.example.com',
279
+ database: 'analytics',
280
+ username: 'analyst',
281
+ password: 'password',
282
+ query_timeout: 1800, # seconds, default: 3600
283
+ extra_connection_params: {
284
+ container: true, # For SQL Server running in containers
285
+ use_utf16: false, # Character encoding options
286
+ timeout: 60, # Connection timeout
287
+ login_timeout: 60 # Login timeout
288
+ }
289
+ })
290
+ </code></p>
291
+
292
+ <h3 id="multi-database-operations">Multi-Database Operations</h3>
293
+
294
+ <p>```ruby
295
+ # List tables in another database
296
+ tables = sqlserver.tables(catalog: ‘other_database’)</p>
297
+
298
+ <h1 id="get-metadata-for-table-in-another-database">Get metadata for table in another database</h1>
299
+ <p>metadata = sqlserver.metadata(‘other_database.dbo.my_table’)
300
+ # OR
301
+ metadata = sqlserver.metadata(‘my_table’, catalog: ‘other_database’)
302
+ ```</p>
303
+
304
+ <h2 id="duckdb-adapter">DuckDB Adapter</h2>
305
+
306
+ <p>The DuckDB adapter uses the <code>ruby-duckdb</code> gem for in-process analytical queries. This requires DuckDB header files and library to already be installed.</p>
307
+
308
+ <h3 id="basic-configuration-3">Basic Configuration</h3>
309
+
310
+ <p>```ruby
311
+ # File-based database
312
+ duckdb = DWH.create(:duckdb, {
313
+ file: ‘/path/to/my/database.duckdb’,
314
+ schema: ‘main’ # Default: ‘main’
315
+ })</p>
316
+
317
+ <h1 id="in-memory-database">In-memory database</h1>
318
+ <p>duckdb = DWH.create(:duckdb, {
319
+ file: ‘:memory:’
320
+ })
321
+ ```</p>
322
+
323
+ <h3 id="read-only-mode">Read-Only Mode</h3>
324
+
325
+ <p><code>ruby
326
+ duckdb = DWH.create(:duckdb, {
327
+ file: '/path/to/readonly/database.duckdb',
328
+ duck_config: {
329
+ access_mode: 'READ_ONLY'
330
+ }
331
+ })
332
+ </code></p>
333
+
334
+ <h3 id="advanced-configuration-3">Advanced Configuration</h3>
335
+
336
+ <p><code>ruby
337
+ duckdb = DWH.create(:duckdb, {
338
+ file: '/path/to/my/database.duckdb',
339
+ duck_config: {
340
+ access_mode: 'READ_WRITE',
341
+ max_memory: '2GB',
342
+ threads: 4,
343
+ temp_directory: '/tmp/duckdb'
344
+ }
345
+ })
346
+ </code></p>
347
+
348
+ <h2 id="trino-adapter">Trino Adapter</h2>
349
+
350
+ <p>The Trino adapter requires the <code>trino-client-ruby</code> gem and works with both Trino and Presto.</p>
351
+
352
+ <h3 id="basic-configuration-4">Basic Configuration</h3>
353
+
354
+ <p><code>ruby
355
+ trino = DWH.create(:trino, {
356
+ host: 'localhost',
357
+ port: 8080, # Default: 8080
358
+ catalog: 'hive', # Required
359
+ schema: 'default', # Optional
360
+ username: 'analyst',
361
+ password: 'password', # Optional
362
+ client_name: 'My Application' # Default: 'DWH Ruby Gem'
363
+ })
364
+ </code></p>
365
+
366
+ <h3 id="ssl-configuration-2">SSL Configuration</h3>
367
+
368
+ <p><code>ruby
369
+ trino = DWH.create(:trino, {
370
+ host: 'trino.example.com',
371
+ port: 443,
372
+ ssl: true, # will set {ssl: {verify: false}}
373
+ catalog: 'hive',
374
+ username: 'analyst',
375
+ password: 'password',
376
+ client_name: "My App"
377
+ })
378
+ </code></p>
379
+
380
+ <h3 id="advanced-configuration-with-headers">Advanced Configuration with Headers</h3>
381
+
382
+ <p><code>ruby
383
+ trino = DWH.create(:trino, {
384
+ host: 'trino.example.com',
385
+ port: 8080,
386
+ catalog: 'delta_lake',
387
+ schema: 'analytics',
388
+ username: 'analyst',
389
+ query_timeout: 1800, # seconds, default: 3600
390
+ extra_connection_params: {
391
+ http_headers: {
392
+ 'X-Trino-User' =&gt; 'Real User Name',
393
+ 'X-Trino-Source' =&gt; 'Analytics Dashboard',
394
+ 'X-Forwarded-Request' =&gt; 'client-request-id'
395
+ },
396
+ ssl: {
397
+ verify: true,
398
+ }
399
+ }
400
+ })
401
+ </code></p>
402
+
403
+ <h2 id="apache-druid-adapter">Apache Druid Adapter</h2>
404
+
405
+ <p>The Druid adapter uses HTTP API calls via the <code>faraday</code> gem for real-time analytics.</p>
406
+
407
+ <h3 id="basic-configuration-5">Basic Configuration</h3>
408
+
409
+ <p><code>ruby
410
+ druid = DWH.create(:druid, {
411
+ protocol: 'http', # 'http' or 'https'
412
+ host: 'localhost',
413
+ port: 8080, # Default: 8081
414
+ client_name: 'My Application' # Default: 'DWH Ruby Gem'
415
+ })
416
+ </code></p>
417
+
418
+ <h3 id="https-with-basic-authentication">HTTPS with Basic Authentication</h3>
419
+
420
+ <p><code>ruby
421
+ druid = DWH.create(:druid, {
422
+ protocol: 'https',
423
+ host: 'druid.example.com',
424
+ port: 443,
425
+ basic_auth: 'base64_encoded_credentials', # Base64 encoded username:password
426
+ query_timeout: 600, # seconds, default: 600
427
+ open_timeout: 30 # connection timeout, default: nil
428
+ })
429
+ </code></p>
430
+
431
+ <h3 id="advanced-configuration-with-context">Advanced Configuration with Context</h3>
432
+
433
+ <p><code>ruby
434
+ druid = DWH.create(:druid, {
435
+ protocol: 'https',
436
+ host: 'druid.example.com',
437
+ port: 8080,
438
+ basic_auth: 'dXNlcjpwYXNz', # base64 for 'user:pass'
439
+ extra_connection_params: {
440
+ context: {
441
+ user: 'analyst_name',
442
+ team: 'data_engineering',
443
+ priority: 10,
444
+ useCache: true
445
+ }
446
+ }
447
+ })
448
+ </code></p>
449
+
450
+ <h2 id="aws-athena-adapter">AWS Athena Adapter</h2>
451
+
452
+ <p>The Athean adapter requires the <code>aws-athena-sdk</code> gem and works with both Trino and Presto.</p>
453
+
454
+ <h3 id="basic-configuration-6">Basic Configuration</h3>
455
+
456
+ <p><code>ruby
457
+ athena = DWH.create(:athena, {
458
+ region: 'us-east-1',
459
+ database: 'default',
460
+ s3_output_location: 's3://my-athena-results-bucket/queries/',
461
+ access_key_id: 'AKIAIOSFODNN7EXAMPLE',
462
+ secret_access_key: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY',
463
+ catalog: 'hive', # optional will default to awsdatacatalog
464
+ database: 'default', # Optional. Db or schema
465
+ workgroup: 'my-dept-strata' # optional workgroup
466
+ })
467
+ </code></p>
468
+
469
+ <h3 id="ssl-configuration-3">SSL Configuration</h3>
470
+
471
+ <p><code>ruby
472
+ athena = DWH.create(:athena, {
473
+ region: 'us-east-1',
474
+ database: 'default',
475
+ s3_output_location: 's3://my-athena-results-bucket/queries/',
476
+ access_key_id: 'AKIAIOSFODNN7EXAMPLE',
477
+ secret_access_key: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY',
478
+ catalog: 'hive', # optional will default to awsdatacatalog
479
+ database: 'default', # Optional. Db or schema
480
+ workgroup: 'my-dept-strata', # optional workgroup
481
+ extra_connection_params: {
482
+ ssl_ca_directory: 'path/to/certs/'
483
+ }
484
+ })
485
+ </code></p>
486
+
487
+ <h3 id="advanced-configuration-with-headers-1">Advanced Configuration with Headers</h3>
488
+
489
+ <p>See full list of config options here: <a href="https://docs.aws.amazon.com/sdk-for-ruby/v2/api/Aws/Athena/Client.html#initialize-instance_method">athena-api</a></p>
490
+
491
+ <h2 id="configuration-validation">Configuration Validation</h2>
492
+
493
+ <p>DWH validates configuration parameters at creation time:</p>
494
+
495
+ <p><code>ruby
496
+ begin
497
+ adapter = DWH.create(:postgres, { host: 'localhost' }) # Missing required database
498
+ rescue DWH::ConfigError =&gt; e
499
+ puts "Configuration error: #{e.message}"
500
+ end
501
+ </code></p>
502
+
503
+ <p>Each adapter defines required and optional parameters with validation rules. Check the adapter-specific sections above for the complete list of supported parameters.</p>
504
+ </div></div>
505
+
506
+ <div id="footer">
507
+ Generated on Fri Aug 22 08:31:21 2025 by
508
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
509
+ 0.9.37 (ruby-3.4.4).
510
+ </div>
511
+
512
+ </div>
513
+ </body>
514
+ </html>