]> git.ipfire.org Git - thirdparty/freeswitch.git/commit
mod_lua: add Dbh:query_rows
authorAron Podrigal <aronp@guaranteedplus.com>
Tue, 30 Jan 2024 12:21:47 +0000 (06:21 -0600)
committerAron Podrigal <aronp@guaranteedplus.com>
Tue, 14 Jan 2025 22:51:29 +0000 (16:51 -0600)
commita5426b36ca9ba4ef9bb9792d9cfbd4d2ab35e4e8
treec94482cd4db38ff23a6b8cde8db322c90e15ecca
parent7ed261b27b84ebcd42d7635a1c27e9c72c180e01
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.

```lua
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
src/mod/languages/mod_lua/freeswitch.i
src/mod/languages/mod_lua/freeswitch_lua.cpp
src/mod/languages/mod_lua/freeswitch_lua.h
src/mod/languages/mod_lua/mod_lua_wrap.cpp