module Turboquery

Constants

VERSION

Attributes

aws_bucket[RW]
aws_key[RW]
aws_region[RW]
aws_secret[RW]
olap_database_url[RW]
oltp_database_url[RW]
tmp_path[RW]

Public Class Methods

after_fork() click to toggle source
# File lib/turboquery.rb, line 54
def after_fork
  olap.after_fork
  oltp.after_fork
end
config() { |self| ... } click to toggle source
# File lib/turboquery.rb, line 91
def self.config
  yield self
  after_fork
end
olap() click to toggle source
# File lib/turboquery.rb, line 40
def olap
  @olap ||= Turboquery::OLAP.new
end
oltp() click to toggle source
# File lib/turboquery.rb, line 36
def oltp
  @oltp ||= Turboquery::OLTP.new
end
query(sql, opts = {}) click to toggle source
# File lib/turboquery.rb, line 28
def query(sql, opts = {})
  Turboquery::RemoteQuery.new(sql, opts).execute
end
s3_bucket() click to toggle source
# 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) click to toggle source
# 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