Ruby to SQL Type Conversion

Ruby Type                                    SQL Type

NilClass (nil)                               NULL

TrueClass, FalseClass (true, false)          CHAR(1), BOOL

String                                       VARCHAR, CHAR, TEXT

Integer (Fixnum or Bignum)                   INT, BIGINT

Float                                        FLOAT, DOUBLE, REAL

DBI::Binary                                  BLOB, CLOB, LONG, LONG RAW

DBI::Time (or String)                        TIME

DBI::Date (or String)                        DATE

DBI::Timestamp (or String)                   TIMESTAMP

Post Author: admin

发表评论

电子邮件地址不会被公开。 必填项已用*标注