mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-01 14:38:50 +00:00
fix(lib): ensure safeArgs when using __call method
This asserts types and checks stored queries when sending a number.
This commit is contained in:
1 parent
fc06cab6eb
commit
e86bf26221
1 file changed
+3
-1
+3
-1
@@ -69,7 +69,9 @@ setmetatable(MySQL, {
|
||||
local state = GetResourceState('oxmysql')
|
||||
if state == 'started' or state == 'starting' then
|
||||
self[method] = setmetatable({}, {
|
||||
__call = oxmysql[method],
|
||||
__call = function(_, query, parameters, cb)
|
||||
return oxmysql[method](nil, safeArgs(query, parameters, cb))
|
||||
end,
|
||||
__index = function(_, await)
|
||||
assert(await == 'await', ('unable to index MySQL.%s.%s, expected .await'):format(method, await))
|
||||
self[method].await = function(query, parameters)
|
||||
|
||||
Reference in new issue
Block a user