Module: Turboquery
- Defined in:
- lib/turboquery.rb,
lib/turboquery.rb,
lib/turboquery/version.rb
Defined Under Namespace
Classes: Connection, DatabaseUrl, OLAP, OLTP, RemoteQuery, TableMover
Constant Summary collapse
- VERSION =
'1.0.5'
Class Attribute Summary collapse
-
.aws_bucket ⇒ Object
Returns the value of attribute aws_bucket.
-
.aws_key ⇒ Object
Returns the value of attribute aws_key.
-
.aws_region ⇒ Object
Returns the value of attribute aws_region.
-
.aws_secret ⇒ Object
Returns the value of attribute aws_secret.
-
.olap_database_url ⇒ Object
Returns the value of attribute olap_database_url.
-
.oltp_database_url ⇒ Object
Returns the value of attribute oltp_database_url.
-
.tmp_path ⇒ Object
Returns the value of attribute tmp_path.
Class Method Summary collapse
- .after_fork ⇒ Object
- .config {|_self| ... } ⇒ Object
- .olap ⇒ Object
- .oltp ⇒ Object
- .query(sql, opts = {}) ⇒ Object
- .s3_bucket ⇒ Object
- .update_table(table) ⇒ Object
Class Attribute Details
.aws_bucket ⇒ Object
Returns the value of attribute aws_bucket.
24 25 26 |
# File 'lib/turboquery.rb', line 24 def aws_bucket @aws_bucket end |
.aws_key ⇒ Object
Returns the value of attribute aws_key.
22 23 24 |
# File 'lib/turboquery.rb', line 22 def aws_key @aws_key end |
.aws_region ⇒ Object
Returns the value of attribute aws_region.
25 26 27 |
# File 'lib/turboquery.rb', line 25 def aws_region @aws_region end |
.aws_secret ⇒ Object
Returns the value of attribute aws_secret.
23 24 25 |
# File 'lib/turboquery.rb', line 23 def aws_secret @aws_secret end |
.olap_database_url ⇒ Object
Returns the value of attribute olap_database_url.
21 22 23 |
# File 'lib/turboquery.rb', line 21 def olap_database_url @olap_database_url end |
.oltp_database_url ⇒ Object
Returns the value of attribute oltp_database_url.
20 21 22 |
# File 'lib/turboquery.rb', line 20 def oltp_database_url @oltp_database_url end |
.tmp_path ⇒ Object
Returns the value of attribute tmp_path.
26 27 28 |
# File 'lib/turboquery.rb', line 26 def tmp_path @tmp_path end |
Class Method Details
.after_fork ⇒ Object
54 55 56 57 |
# File 'lib/turboquery.rb', line 54 def after_fork olap.after_fork oltp.after_fork end |
.config {|_self| ... } ⇒ Object
91 92 93 94 |
# File 'lib/turboquery.rb', line 91 def self.config yield self after_fork end |
.olap ⇒ Object
40 41 42 |
# File 'lib/turboquery.rb', line 40 def olap @olap ||= Turboquery::OLAP.new end |
.oltp ⇒ Object
36 37 38 |
# File 'lib/turboquery.rb', line 36 def oltp @oltp ||= Turboquery::OLTP.new end |
.query(sql, opts = {}) ⇒ Object
28 29 30 |
# File 'lib/turboquery.rb', line 28 def query(sql, opts = {}) Turboquery::RemoteQuery.new(sql, opts).execute end |
.s3_bucket ⇒ Object
44 45 46 47 48 49 50 51 52 |
# File 'lib/turboquery.rb', line 44 def s3_bucket @s3_bucket ||= begin Aws::S3::Resource.new( region: aws_region, access_key_id: aws_key, secret_access_key: aws_secret ).bucket(aws_bucket) end end |
.update_table(table) ⇒ Object
32 33 34 |
# File 'lib/turboquery.rb', line 32 def update_table(table) Turboquery::TableMover.new(source: oltp, destination: olap, from_table: table, to_table: "turboquery_#{table}") end |