[sr-dev] [kamailio/kamailio] SQLOPS Module (Issue #2950)

iliesh notifications at github.com
Mon Nov 22 19:56:39 CET 2021


### Description

By using module 'sqlops' would be nice to pass also the database name as an argument to the function "sql_query" along with the connection name and SQL statement. 
This would be very useful when you have few database hosts and an SQL Proxy which is routing all queries based on the database name, for example:

customer_1 -> db_host_1 -> db_name_c1
customer_2 -> db_host_2 -> db_name_c2

So instead of: 

```
if($var(customer) == "customer_1") {
    sql_query("ca", "SELECT name from demo where id=1", "ra");
} else {
    sql_query("cb","SELECT name from demo where id=1", "ra");
}
```
use just a single connection to the Proxy:

```
sql_query("ca", "$var(db_name)", "SELECT name from demo where id=1", "ra");
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2950
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20211122/11097c94/attachment.htm>


More information about the sr-dev mailing list