add specs for statement arguments

add support for blobs (i.e. Slice(UInt8) )
This commit is contained in:
Brian J. Cardiff 2016-01-29 19:21:48 -03:00
parent 8a8b86e31a
commit e50cc4ec73
4 changed files with 85 additions and 6 deletions

View file

@ -1,5 +1,6 @@
module DB
TYPES = [String, Int32, Int64, Float32, Float64]
TYPES = [String, Int32, Int64, Float32, Float64, Slice(UInt8)]
alias Any = String | Int32 | Int64 | Float32 | Float64 | Slice(UInt8)
def self.driver_class(name) # : Driver.class
@@drivers.not_nil![name]

View file

@ -9,6 +9,12 @@ module DB
exec args
end
def exec(arg : Slice(UInt8))
before_execute
add_parameter 1, arg
execute
end
def exec(args : Enumerable)
before_execute
args.each_with_index(1) do |arg, index|