timescaledb-rails 0.1.3 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +215 -15
- data/lib/timescaledb/rails/extensions/active_record/base.rb +20 -0
- data/lib/timescaledb/rails/extensions/active_record/command_recorder.rb +80 -0
- data/lib/timescaledb/rails/extensions/active_record/postgresql_database_tasks.rb +77 -18
- data/lib/timescaledb/rails/extensions/active_record/schema_dumper.rb +75 -10
- data/lib/timescaledb/rails/extensions/active_record/schema_statements.rb +101 -7
- data/lib/timescaledb/rails/model/aggregate_functions.rb +30 -0
- data/lib/timescaledb/rails/model/finder_methods.rb +44 -0
- data/lib/timescaledb/rails/model/hyperfunctions.rb +30 -0
- data/lib/timescaledb/rails/model/scopes.rb +66 -0
- data/lib/timescaledb/rails/model.rb +83 -0
- data/lib/timescaledb/rails/models/chunk.rb +49 -0
- data/lib/timescaledb/rails/models/concerns/durationable.rb +76 -0
- data/lib/timescaledb/rails/models/continuous_aggregate.rb +57 -0
- data/lib/timescaledb/rails/models/hypertable.rb +48 -3
- data/lib/timescaledb/rails/models/job.rb +6 -0
- data/lib/timescaledb/rails/models.rb +3 -1
- data/lib/timescaledb/rails/railtie.rb +1 -20
- data/lib/timescaledb/rails/version.rb +1 -1
- data/lib/timescaledb/rails.rb +16 -0
- metadata +26 -3
@@ -1,6 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require_relative './models/chunk'
|
3
4
|
require_relative './models/compression_setting'
|
5
|
+
require_relative './models/continuous_aggregate'
|
4
6
|
require_relative './models/dimension'
|
5
|
-
require_relative './models/job'
|
6
7
|
require_relative './models/hypertable'
|
8
|
+
require_relative './models/job'
|
@@ -2,11 +2,6 @@
|
|
2
2
|
|
3
3
|
require 'rails'
|
4
4
|
|
5
|
-
require_relative 'extensions/active_record/command_recorder'
|
6
|
-
require_relative 'extensions/active_record/postgresql_database_tasks'
|
7
|
-
require_relative 'extensions/active_record/schema_dumper'
|
8
|
-
require_relative 'extensions/active_record/schema_statements'
|
9
|
-
|
10
5
|
module Timescaledb
|
11
6
|
module Rails
|
12
7
|
# :nodoc:
|
@@ -19,21 +14,7 @@ module Timescaledb
|
|
19
14
|
|
20
15
|
initializer 'timescaledb-rails.add_timescale_support_to_active_record' do
|
21
16
|
ActiveSupport.on_load(:active_record) do
|
22
|
-
::
|
23
|
-
Timescaledb::Rails::ActiveRecord::CommandRecorder
|
24
|
-
)
|
25
|
-
|
26
|
-
::ActiveRecord::Tasks::PostgreSQLDatabaseTasks.prepend(
|
27
|
-
Timescaledb::Rails::ActiveRecord::PostgreSQLDatabaseTasks
|
28
|
-
)
|
29
|
-
|
30
|
-
::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.prepend(
|
31
|
-
Timescaledb::Rails::ActiveRecord::SchemaStatements
|
32
|
-
)
|
33
|
-
|
34
|
-
::ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaDumper.prepend(
|
35
|
-
Timescaledb::Rails::ActiveRecord::SchemaDumper
|
36
|
-
)
|
17
|
+
Timescaledb::Rails.load
|
37
18
|
end
|
38
19
|
end
|
39
20
|
end
|
data/lib/timescaledb/rails.rb
CHANGED
@@ -1,7 +1,23 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require_relative './rails/model'
|
4
|
+
|
5
|
+
require_relative './rails/extensions/active_record/base'
|
6
|
+
require_relative './rails/extensions/active_record/command_recorder'
|
7
|
+
require_relative './rails/extensions/active_record/postgresql_database_tasks'
|
8
|
+
require_relative './rails/extensions/active_record/schema_dumper'
|
9
|
+
require_relative './rails/extensions/active_record/schema_statements'
|
10
|
+
|
3
11
|
module Timescaledb
|
4
12
|
# :nodoc:
|
5
13
|
module Rails
|
14
|
+
# Adds TimescaleDB support to ActiveRecord.
|
15
|
+
def self.load
|
16
|
+
::ActiveRecord::Migration::CommandRecorder.prepend(ActiveRecord::CommandRecorder)
|
17
|
+
::ActiveRecord::Tasks::PostgreSQLDatabaseTasks.prepend(ActiveRecord::PostgreSQLDatabaseTasks)
|
18
|
+
::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.prepend(ActiveRecord::SchemaStatements)
|
19
|
+
::ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaDumper.prepend(ActiveRecord::SchemaDumper)
|
20
|
+
::ActiveRecord::Base.include(ActiveRecord::Base) # rubocop:disable Rails/ActiveSupportOnLoad
|
21
|
+
end
|
6
22
|
end
|
7
23
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timescaledb-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Iván Etchart
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-01-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -25,6 +25,20 @@ dependencies:
|
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '6.0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: debug
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - "~>"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '1.0'
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - "~>"
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '1.0'
|
28
42
|
- !ruby/object:Gem::Dependency
|
29
43
|
name: pg
|
30
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -119,12 +133,21 @@ files:
|
|
119
133
|
- README.md
|
120
134
|
- lib/timescaledb-rails.rb
|
121
135
|
- lib/timescaledb/rails.rb
|
136
|
+
- lib/timescaledb/rails/extensions/active_record/base.rb
|
122
137
|
- lib/timescaledb/rails/extensions/active_record/command_recorder.rb
|
123
138
|
- lib/timescaledb/rails/extensions/active_record/postgresql_database_tasks.rb
|
124
139
|
- lib/timescaledb/rails/extensions/active_record/schema_dumper.rb
|
125
140
|
- lib/timescaledb/rails/extensions/active_record/schema_statements.rb
|
141
|
+
- lib/timescaledb/rails/model.rb
|
142
|
+
- lib/timescaledb/rails/model/aggregate_functions.rb
|
143
|
+
- lib/timescaledb/rails/model/finder_methods.rb
|
144
|
+
- lib/timescaledb/rails/model/hyperfunctions.rb
|
145
|
+
- lib/timescaledb/rails/model/scopes.rb
|
126
146
|
- lib/timescaledb/rails/models.rb
|
147
|
+
- lib/timescaledb/rails/models/chunk.rb
|
127
148
|
- lib/timescaledb/rails/models/compression_setting.rb
|
149
|
+
- lib/timescaledb/rails/models/concerns/durationable.rb
|
150
|
+
- lib/timescaledb/rails/models/continuous_aggregate.rb
|
128
151
|
- lib/timescaledb/rails/models/dimension.rb
|
129
152
|
- lib/timescaledb/rails/models/hypertable.rb
|
130
153
|
- lib/timescaledb/rails/models/job.rb
|
@@ -151,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
174
|
- !ruby/object:Gem::Version
|
152
175
|
version: '0'
|
153
176
|
requirements: []
|
154
|
-
rubygems_version: 3.3.
|
177
|
+
rubygems_version: 3.0.3.1
|
155
178
|
signing_key:
|
156
179
|
specification_version: 4
|
157
180
|
summary: TimescaleDB Rails integration
|