Sha256: 0354c9b20bfc86d64bbc841e83b5d7920e15e160d67c7de67af6696421fbd36c
Contents?: true
Size: 1.52 KB
Versions: 12
Compression:
Stored size: 1.52 KB
Contents
# frozen-string-literal: true # # The pg_timestamptz extension changes the default timestamp # type for the database to be +timestamptz+ (<tt>timestamp with time zone</tt>) # instead of +timestamp+ (<tt>timestamp without time zone</tt>). This is # recommended if you are dealing with multiple timezones in your application. # # If you are using the auto_cast_date_and_time extension, the pg_timestamptz # extension will automatically cast Time and DateTime values to # <tt>TIMESTAMP WITH TIME ZONE</tt> instead of +TIMESTAMP+. # # To load the extension into the database: # # DB.extension :pg_timestamptz # # To load the extension into individual datasets: # # ds = ds.extension(:pg_timestamptz) # # Note that the loading into individual datasets only affects the integration # with the auto_cast_date_and_time extension. # # Related modules: Sequel::Postgres::Timestamptz, Sequel::Postgres::TimestamptzDatasetMethods # module Sequel module Postgres module Timestamptz def self.extended(db) db.extend_datasets(TimestamptzDatasetMethods) end private # Use timestamptz by default for generic timestamp value. def type_literal_generic_datetime(column) :timestamptz end end module TimestamptzDatasetMethods private def literal_datetime_timestamp_cast 'TIMESTAMP WITH TIME ZONE ' end end end Dataset.register_extension(:pg_timestamptz, Postgres::TimestamptzDatasetMethods) Database.register_extension(:pg_timestamptz, Postgres::Timestamptz) end
Version data entries
12 entries across 12 versions & 1 rubygems