Sha256: a1d3ceb92497e5eddc8e7a5ca3d0f3c2c4e8a626d8d1b05b6508408c80d2ed5f

Contents?: true

Size: 543 Bytes

Versions: 2

Compression:

Stored size: 543 Bytes

Contents

module Timescaledb

  # Provides metadata around the extension in the database
  module Extension
    module_function
    # @return String version of the timescaledb extension
    def version
      @version ||= Timescaledb.connection.query_first(<<~SQL)&.version
        SELECT extversion as version
        FROM pg_extension
        WHERE extname = 'timescaledb'
      SQL
    end

    def installed?
      version.present?
    end

    def update!
      Timescaledb.connection.execute('ALTER EXTENSION timescaledb UPDATE')
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
timescaledb-0.3.0 lib/timescaledb/extension.rb
timescaledb-0.2.9 lib/timescaledb/extension.rb