Sha256: fdf1e1e722a5cdf7d7cfcbc841ae359caaabcf71689a19b305a0404a6a6f2190
Contents?: true
Size: 1.05 KB
Versions: 8
Compression:
Stored size: 1.05 KB
Contents
class ThinkingSphinx::ActiveRecord::DatabaseAdapters::PostgreSQLAdapter < ThinkingSphinx::ActiveRecord::DatabaseAdapters::AbstractAdapter def boolean_value(value) value ? 'TRUE' : 'FALSE' end def cast_to_bigint(clause) "#{clause}::bigint" end def cast_to_string(clause) "#{clause}::varchar" end def cast_to_timestamp(clause) if ThinkingSphinx::Configuration.instance.settings['64bit_timestamps'] "extract(epoch from #{clause})::bigint" else "extract(epoch from #{clause})::int" end end def concatenate(clause, separator = ' ') clause.split(', ').collect { |part| convert_nulls(part, "''") }.join(" || '#{separator}' || ") end def convert_nulls(clause, default = '') "COALESCE(#{clause}, #{default})" end def convert_blank(clause, default = '') "COALESCE(NULLIF(#{clause}, ''), #{default})" end def group_concatenate(clause, separator = ' ') "array_to_string(array_agg(DISTINCT #{clause}), '#{separator}')" end def time_zone_query_pre ['SET TIME ZONE UTC'] end end
Version data entries
8 entries across 8 versions & 1 rubygems