<p></p>
<h3 dir="auto">Description</h3>
<p dir="auto">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.<br>
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:</p>
<p dir="auto">customer_1 -> db_host_1 -> db_name_c1<br>
customer_2 -> db_host_2 -> db_name_c2</p>
<p dir="auto">So instead of:</p>
<pre><code>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");
}
</code></pre>
<p dir="auto">use just a single connection to the Proxy:</p>
<pre><code>sql_query("ca", "$var(db_name)", "SELECT name from demo where id=1", "ra");
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/2950">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZMKWQ4YQWR2U23E4BTUNKG6PANCNFSM5IRXFDJQ">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<img src="https://github.com/notifications/beacon/ABO7UZPKVZ3IKM4C6WXDDSDUNKG6PA5CNFSM5IRXFDJ2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4PZVZQNA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2950",
"url": "https://github.com/kamailio/kamailio/issues/2950",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>