Sha256: 2e9b7be81e42bf1fcd548b0905780c91054e94bf112d3f4eaa33f6b6004959a5

Contents?: true

Size: 497 Bytes

Versions: 3

Compression:

Stored size: 497 Bytes

Contents

module Timescaledb
  class Database
    module Types
      # @param [String, Integer] interval The interval value
      # @return [String]
      def interval_to_sql(interval)
        return 'NULL' if interval.nil?
        return interval if interval.kind_of?(Integer)

        "INTERVAL #{quote(interval)}"
      end

      # @param [String] boolean The boolean value
      # @return [String]
      def boolean_to_sql(boolean)
        quote(boolean ? 'TRUE' : 'FALSE')
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
timescaledb-0.3.0 lib/timescaledb/database/types.rb
timescaledb-0.2.9 lib/timescaledb/database/types.rb
timescaledb-0.2.8 lib/timescaledb/database/types.rb