Module: Timescaledb::Extension
- Defined in:
- lib/timescaledb/extension.rb
Overview
Provides metadata around the extension in the database
Class Method Summary collapse
- .installed? ⇒ Boolean
- .update! ⇒ Object
-
.version ⇒ Object
String version of the timescaledb extension.
Class Method Details
.installed? ⇒ Boolean
15 16 17 |
# File 'lib/timescaledb/extension.rb', line 15 def installed? version.present? end |
.update! ⇒ Object
19 20 21 |
# File 'lib/timescaledb/extension.rb', line 19 def update! Timescaledb.connection.execute('ALTER EXTENSION timescaledb UPDATE') end |
.version ⇒ Object
Returns String version of the timescaledb extension.
7 8 9 10 11 12 13 |
# File 'lib/timescaledb/extension.rb', line 7 def version @version ||= Timescaledb.connection.query_first(<<~SQL)&.version SELECT extversion as version FROM pg_extension WHERE extname = 'timescaledb' SQL end |