freeswitch icon indicating copy to clipboard operation
freeswitch copied to clipboard

mod_lua: add Dbh:query_rows

Open ar45 opened this issue 1 year ago • 2 comments

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

ar45 avatar Jan 30 '24 12:01 ar45

Unit-tests failed: https://public-artifacts.signalwire.cloud/drone/signalwire/freeswitch/1671/artifacts.html

signalwire-ci[bot] avatar Jan 30 '24 12:01 signalwire-ci[bot]

Scan-build found bugs: https://public-artifacts.signalwire.cloud/drone/signalwire/freeswitch/1671/index.html

signalwire-ci[bot] avatar Jan 30 '24 12:01 signalwire-ci[bot]