Module: Timescaledb

Defined in:
lib/timescaledb/toolkit/helpers.rb,
lib/timescaledb.rb,
lib/timescaledb/job.rb,
lib/timescaledb/chunk.rb,
lib/timescaledb/stats.rb,
lib/timescaledb/version.rb,
lib/timescaledb/database.rb,
lib/timescaledb/extension.rb,
lib/timescaledb/job_stats.rb,
lib/timescaledb/connection.rb,
lib/timescaledb/dimensions.rb,
lib/timescaledb/hypertable.rb,
lib/timescaledb/stats/chunks.rb,
lib/timescaledb/stats_report.rb,
lib/timescaledb/schema_dumper.rb,
lib/timescaledb/database/types.rb,
lib/timescaledb/scenic/adapter.rb,
lib/timescaledb/stats/job_stats.rb,
lib/timescaledb/database/quoting.rb,
lib/timescaledb/scenic/extension.rb,
lib/timescaledb/migration_helpers.rb,
lib/timescaledb/stats/hypertables.rb,
lib/timescaledb/acts_as_hypertable.rb,
lib/timescaledb/application_record.rb,
lib/timescaledb/acts_as_time_vector.rb,
lib/timescaledb/connection_handling.rb,
lib/timescaledb/toolkit/time_vector.rb,
lib/timescaledb/compression_settings.rb,
lib/timescaledb/continuous_aggregates.rb,
lib/timescaledb/acts_as_hypertable/core.rb,
lib/timescaledb/database/chunk_statements.rb,
lib/timescaledb/database/schema_statements.rb,
lib/timescaledb/stats/continuous_aggregates.rb,
lib/timescaledb/database/hypertable_statements.rb

Overview

Useful methods to run TimescaleDB in you Ruby app.

Defined Under Namespace

Modules: ActsAsHypertable, ActsAsTimeVector, Extension, MigrationHelpers, Scenic, SchemaDumper, StatsReport, Toolkit Classes: ApplicationRecord, Chunk, CompressionSetting, Connection, ConnectionNotEstablishedError, ContinuousAggregate, Database, Dimension, Hypertable, Job, JobStat, Stats

Constant Summary collapse

VERSION =
'0.3.0'
JobStats =
JobStat
Dimensions =

attribute :time_interval, :interval

Dimension
CompressionSettings =
CompressionSetting
ContinuousAggregates =
ContinuousAggregate

Class Method Summary collapse

Class Method Details

.chunksObject



34
35
36
# File 'lib/timescaledb.rb', line 34

def chunks
  Chunk.all
end

.compression_settingsObject



46
47
48
# File 'lib/timescaledb.rb', line 46

def compression_settings
  CompressionSettings.all
end

.connectionObject



26
27
28
# File 'lib/timescaledb.rb', line 26

def connection
  Connection.instance
end

.continuous_aggregatesObject



42
43
44
# File 'lib/timescaledb.rb', line 42

def continuous_aggregates
  ContinuousAggregates.all
end

.default_hypertable_optionsObject



62
63
64
# File 'lib/timescaledb.rb', line 62

def default_hypertable_options
  Timescaledb::ActsAsHypertable::DEFAULT_OPTIONS
end

.establish_connection(config) ⇒ Object

Parameters:

  • config (String)

    with the postgres connection string.



7
8
9
# File 'lib/timescaledb/connection_handling.rb', line 7

def establish_connection(config)
  Connection.instance.config = config
end

.extensionObject



30
31
32
# File 'lib/timescaledb.rb', line 30

def extension
  Extension
end

.hypertablesObject



38
39
40
# File 'lib/timescaledb.rb', line 38

def hypertables
  Hypertable.all
end

.job_statsObject



54
55
56
# File 'lib/timescaledb.rb', line 54

def job_stats
  JobStats.all
end

.jobsObject



50
51
52
# File 'lib/timescaledb.rb', line 50

def jobs
  Job.all
end

.stats(scope = Hypertable.all) ⇒ Object



58
59
60
# File 'lib/timescaledb.rb', line 58

def stats(scope=Hypertable.all)
  StatsReport.resume(scope)
end

.use_connection(conn) ⇒ Object

Parameters:

  • to (PG::Connection)

    use it directly from a raw connection



12
13
14
# File 'lib/timescaledb/connection_handling.rb', line 12

def use_connection conn
  Connection.instance.use_connection conn
end