mirror of
https://gitea.invidious.io/iv-org/shard-crystal-db.git
synced 2024-08-15 00:53:32 +00:00
add specs for statement arguments
add support for blobs (i.e. Slice(UInt8) )
This commit is contained in:
parent
8a8b86e31a
commit
e50cc4ec73
4 changed files with 85 additions and 6 deletions
|
@ -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]
|
||||
|
|
|
@ -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|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue