File: integer64.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 (32 lines) | stat: -rw-r--r-- 1,034 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
29
30
31
32
# frozen-string-literal: true
#
# The integer64 extension changes the default type used for Integer
# to be the same type as used for :Bignum.  In general, this means that
# instead of Integer resulting in a 32-bit database integer type, it will
# result in a 64-bit database integer type.  This affects the default
# type used for primary_key and foreign_key when using the schema
# modification methods.
#
# Note that it doesn't make sense to use this extension on SQLite, since
# the integer type will automatically handle 64-bit integers, and it treats
# the integer type specially when the column is also the primary key.
# 
# To load the extension into the database:
#
#   DB.extension :integer64
#
# Related module: Sequel::Integer64

#
module Sequel
  module Integer64
    private

    # Use same type as used for :Bignum by default for generic integer value.
    def type_literal_generic_integer(column)
      type_literal_generic_bignum_symbol(column)
    end
  end

  Database.register_extension(:integer64, Integer64)
end