]> 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)
committerAndrey Volk <andywolk@gmail.com>
Wed, 15 Jan 2025 13:30:59 +0000 (16:30 +0300)
commit4e2e8151b02b2f8b79bb8a126175abbdc1b4e86d
treea8e76a5fa68719731711812835cf682a09cbc429
parentad5fe8bcffe89f6e0e68298cd08e9140beffa09c
[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