File: pg_timestamptz.rb

package info (click to toggle)
ruby-sequel 5.63.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,408 kB
  • sloc: ruby: 113,747; makefile: 3
file content (28 lines) | stat: -rw-r--r-- 747 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# frozen-string-literal: true
#
# The pg_timestamptz extension changes the default timestamp
# type for the database to be +timestamptz+ (+timestamp with time zone+)
# instead of +timestamp+ (+timestamp without time zone+).  This is
# recommended if you are dealing with multiple timezones in your application.
# 
# To load the extension into the database:
#
#   DB.extension :pg_timestamptz
#
# Related module: Sequel::Postgres::Timestamptz

#
module Sequel
  module Postgres
    module Timestamptz
      private

      # Use timestamptz by default for generic timestamp value.
      def type_literal_generic_datetime(column)
        :timestamptz
      end
    end
  end

  Database.register_extension(:pg_timestamptz, Postgres::Timestamptz)
end