File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -124,13 +124,13 @@ function bind!(stmt::Stmt, values::Vector)
124
124
end
125
125
function bind! (stmt:: Stmt , values:: Dict{Symbol, V} ) where {V}
126
126
nparams = sqlite3_bind_parameter_count (stmt. handle)
127
- @assert nparams == length (values) " you must provide values for all query placeholders"
128
127
for i in 1 : nparams
129
128
name = unsafe_string (sqlite3_bind_parameter_name (stmt. handle, i))
130
129
@assert ! isempty (name) " nameless parameters should be passed as a Vector"
131
130
# name is returned with the ':', '@' or '$' at the start
132
- name = name[2 : end ]
133
- bind! (stmt, i, values[Symbol (name)])
131
+ sym = Symbol (name[2 : end ])
132
+ haskey (values, sym) || throw (SQLiteException (" `$name ` not found in values Dict to bind to sql statement" ))
133
+ bind! (stmt, i, values[sym])
134
134
end
135
135
end
136
136
# Binding parameters to SQL statements
You can’t perform that action at this time.
0 commit comments