|
From: MoonWolf <moo...@mo...> - 2002-09-28 06:40:24
|
patch for ruby-postgres-0.7.0-pre2
* PGconn.escape_bytea(PQescapeBytea) add
PGconn.escape_bytea "\0'\\" # => "\\\\000\\'\\\\\\\\"
* PGconn.quote extend for DBG:Pg
PGconn.quote nil # => "NULL"
PGconn.quote true # => "'t'"
PGconn.quote false # => "'f'"
PGconn.quote 1 # => "1"
PGconn.quote 1.5 # => "1.5"
PGconn.quote ["a", 1, nil, false]
# => "'a', 1, NULL, 'f'"
PGconn.quote(obj) {|value|
case value
when DBI::Date, DBI::Time, DBI::Timestamp, ::Date, ::Time
"'#{value.to_s}'"
else
value.to_s
end
}
--
MoonWolf <moo...@mo...>
|