Sha256: 086336ef7376480c895f59385c0dcadbc9a89976f1b017edb4182b0ae4e5f1cb

Contents?: true

Size: 373 Bytes

Versions: 40

Compression:

Stored size: 373 Bytes

Contents

# frozen_string_literal: true

module Motor
  module Resources
    module CustomSqlColumnsCache
      CACHE_STORE = ActiveSupport::Cache::MemoryStore.new(size: 5.megabytes)

      module_function

      def call(sql)
        CACHE_STORE.fetch(sql.hash) do
          Queries::RunQuery.call(Query.new(sql_body: sql), limit: 0).columns
        end
      end
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
motor-admin-0.2.4 lib/motor/resources/custom_sql_columns_cache.rb
motor-admin-0.2.3 lib/motor/resources/custom_sql_columns_cache.rb
motor-admin-0.2.2 lib/motor/resources/custom_sql_columns_cache.rb
motor-admin-0.2.1 lib/motor/resources/custom_sql_columns_cache.rb
motor-admin-0.2.0 lib/motor/resources/custom_sql_columns_cache.rb
motor-admin-0.1.104 lib/motor/resources/custom_sql_columns_cache.rb
motor-admin-0.1.103 lib/motor/resources/custom_sql_columns_cache.rb
motor-admin-0.1.102 lib/motor/resources/custom_sql_columns_cache.rb
motor-admin-0.1.101 lib/motor/resources/custom_sql_columns_cache.rb
motor-admin-0.1.100 lib/motor/resources/custom_sql_columns_cache.rb
motor-admin-0.1.99 lib/motor/resources/custom_sql_columns_cache.rb
motor-admin-0.1.98 lib/motor/resources/custom_sql_columns_cache.rb
motor-admin-0.1.97 lib/motor/resources/custom_sql_columns_cache.rb
motor-admin-0.1.96 lib/motor/resources/custom_sql_columns_cache.rb
motor-admin-0.1.93 lib/motor/resources/custom_sql_columns_cache.rb
motor-admin-0.1.92 lib/motor/resources/custom_sql_columns_cache.rb
motor-admin-0.1.91 lib/motor/resources/custom_sql_columns_cache.rb
motor-admin-0.1.90 lib/motor/resources/custom_sql_columns_cache.rb
motor-admin-0.1.89 lib/motor/resources/custom_sql_columns_cache.rb
motor-admin-0.1.88 lib/motor/resources/custom_sql_columns_cache.rb