make Nil a proper column type

This commit is contained in:
Brian J. Cardiff 2016-04-10 21:21:10 +03:00
parent f834b0f8a6
commit d69555b372
3 changed files with 12 additions and 3 deletions

View file

@ -55,7 +55,7 @@ class DummyDriver < DB::Driver
private def set_params(args)
@params.clear
args.each_with_index do |arg, index|
@params[index] = arg
@params[index] = arg.as(DB::Any)
end
end
@ -114,12 +114,16 @@ class DummyDriver < DB::Driver
return nil if n == "NULL"
if n == "?"
return @statement.params[0]
return (@statement.as(DummyStatement)).params[0]
end
return n
end
def read?(t : Nil.class)
read?.as(Nil)
end
def read?(t : String.class)
read?.try &.to_s
end