Module | Sequel::SQLite
In: | lib/sequel/adapters/shared/sqlite.rb lib/sequel/adapters/sqlite.rb

Top level module for holding all SQLite-related modules and classes for Sequel.

### Methods

blob boolean date float integer numeric time

### Classes and Modules

Module Sequel::SQLite::DatabaseMethods
Module Sequel::SQLite::DatasetMethods

### Constants

TYPE_TRANSLATOR | = | tt = Class.new do FALSE_VALUES = (%w'0 false f no n' + [0]).freeze

### Public Instance methods

blob(s)

[Source]

        # File lib/sequel/adapters/sqlite.rb, line 11
    11:       def blob(s)
    12:         Sequel::SQL::Blob.new(s.to_s)
    13:       end

boolean(s)

[Source]

        # File lib/sequel/adapters/sqlite.rb, line 15
    15:       def boolean(s)
    16:         s = s.downcase if s.is_a?(String)
    17:         !FALSE_VALUES.include?(s)
    18:       end

date(s)

[Source]

        # File lib/sequel/adapters/sqlite.rb, line 20
    20:       def date(s)
    21:         case s
    22:         when String
    23:           Sequel.string_to_date(s)
    24:         when Integer
    25:           Date.jd(s)
    26:         when Float
    27:           Date.jd(s.to_i)
    28:         else
    29:           raise Sequel::Error, "unhandled type when converting to date: #{s.inspect} (#{s.class.inspect})"
    30:         end
    31:       end

float(s)

[Source]

        # File lib/sequel/adapters/sqlite.rb, line 37
    37:       def float(s)
    38:         s.to_f
    39:       end

integer(s)

[Source]

        # File lib/sequel/adapters/sqlite.rb, line 33
    33:       def integer(s)
    34:         s.to_i
    35:       end

numeric(s)

[Source]

        # File lib/sequel/adapters/sqlite.rb, line 41
    41:       def numeric(s)
    42:         s = s.to_s unless s.is_a?(String)
    43:         ::BigDecimal.new(s) rescue s
    44:       end

time(s)

[Source]

        # File lib/sequel/adapters/sqlite.rb, line 46
    46:       def time(s)
    47:         case s
    48:         when String
    49:           Sequel.string_to_time(s)
    50:         when Integer
    51:           Sequel::SQLTime.create(s/3600, (s % 3600)/60, s % 60)
    52:         when Float
    53:           s, f = s.divmod(1)
    54:           Sequel::SQLTime.create(s/3600, (s % 3600)/60, s % 60, (f*1000000).round)
    55:         else
    56:           raise Sequel::Error, "unhandled type when converting to date: #{s.inspect} (#{s.class.inspect})"
    57:         end
    58:       end

[Validate]