freeswitch
freeswitch copied to clipboard
mod_lua: add Dbh:query_rows
The added method, query_rows, allows the retrieval of rows from a database without the need for a callback function, it fetches the rows and returns 3 arguments as show below.
local success, rows, err = dbh:query_rows(sql)
This function performs better with large number of rows. Test results below 50k rows returned.
dbh:query(sql, callback) - 0.335949 seconds dbh:query_rows(sql) - 0.253178 seconds
Unit-tests failed: https://public-artifacts.signalwire.cloud/drone/signalwire/freeswitch/1671/artifacts.html
Scan-build found bugs: https://public-artifacts.signalwire.cloud/drone/signalwire/freeswitch/1671/index.html