The Sync methods fails if you try to use the 2nd way of execution transactions, because params = null instead of the callback function.
To Reproduce
local queries = {
{
query = 'INSERT INTO aTable (col1, col2) VALUES (@col1, @col2)',
parameters = {
col1='string',
col2= 1
}
}
}
MySQL.Sync.transaction(queries) => error SCRIPT ERROR in call ref: TypeError: Found non-callable @@iterator
MySQL.Async.transaction(queries, function(result) end) => @col1 can not be a null value (if col1 was made as NOT NULL)
Expected behavior
No errors.
Software:
OS: Windows 10 with WSL 2 running the DB
Version of the resource: 3.3.2
Database Version MariaDB 10.5.8
Additional context
Problem 1 seems to be a documentation error, if you use "values" instead of parameters it works as expected.
Problem 2 requires a check to see if the params are nil or not, and require a different call then.
Describe the bug
To Reproduce local queries = { { query = 'INSERT INTO aTable (col1, col2) VALUES (@col1, @col2)', parameters = { col1='string', col2= 1 } } }
Expected behavior No errors.
Software:
Additional context
Problem 1 seems to be a documentation error, if you use "values" instead of parameters it works as expected. Problem 2 requires a check to see if the params are nil or not, and require a different call then.