Module: Timescaledb::Rails::Model::ClassMethods
- Defined in:
- lib/timescaledb/rails/model.rb
Overview
:nodoc:
Instance Method Summary collapse
- #hypertable ⇒ Timescaledb::Rails::Hypertable
- #hypertable_chunks ⇒ ActiveRecord::Relation<Timescaledb::Rails::Chunk>
- #hypertable_compression_settings ⇒ ActiveRecord::Relation<Timescaledb::Rails::CompressionSetting>
- #hypertable_dimensions ⇒ ActiveRecord::Relation<Timescaledb::Rails::Dimension>
- #hypertable_jobs ⇒ ActiveRecord::Relation<Timescaledb::Rails::Job>
-
#hypertable_name ⇒ String
Returns only the name of the hypertable, table_name could include the schema path, we need to remove it.
-
#hypertable_schema ⇒ String
Returns the schema where hypertable is stored.
Instance Method Details
#hypertable ⇒ Timescaledb::Rails::Hypertable
39 40 41 |
# File 'lib/timescaledb/rails/model.rb', line 39 def hypertable Timescaledb::Rails::Hypertable.find_by() end |
#hypertable_chunks ⇒ ActiveRecord::Relation<Timescaledb::Rails::Chunk>
44 45 46 |
# File 'lib/timescaledb/rails/model.rb', line 44 def hypertable_chunks Timescaledb::Rails::Chunk.where() end |
#hypertable_compression_settings ⇒ ActiveRecord::Relation<Timescaledb::Rails::CompressionSetting>
59 60 61 |
# File 'lib/timescaledb/rails/model.rb', line 59 def hypertable_compression_settings Timescaledb::Rails::CompressionSetting.where() end |
#hypertable_dimensions ⇒ ActiveRecord::Relation<Timescaledb::Rails::Dimension>
54 55 56 |
# File 'lib/timescaledb/rails/model.rb', line 54 def hypertable_dimensions Timescaledb::Rails::Dimension.where() end |
#hypertable_jobs ⇒ ActiveRecord::Relation<Timescaledb::Rails::Job>
49 50 51 |
# File 'lib/timescaledb/rails/model.rb', line 49 def hypertable_jobs Timescaledb::Rails::Job.where() end |
#hypertable_name ⇒ String
Returns only the name of the hypertable, table_name could include the schema path, we need to remove it.
23 24 25 |
# File 'lib/timescaledb/rails/model.rb', line 23 def hypertable_name table_name.split('.').last end |
#hypertable_schema ⇒ String
Returns the schema where hypertable is stored.
30 31 32 33 34 35 36 |
# File 'lib/timescaledb/rails/model.rb', line 30 def hypertable_schema if table_name.split('.').size > 1 table_name.split('.')[0..-2].join('.') else PUBLIC_SCHEMA_NAME end end |