mirror of
https://gitea.invidious.io/iv-org/shard-crystal-db.git
synced 2024-08-15 00:53:32 +00:00
make Nil a proper column type
This commit is contained in:
parent
f834b0f8a6
commit
d69555b372
3 changed files with 12 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue