Feature Requests item #3378944, was opened at 2011-07-26 20:13
Message generated for change (Tracker Item Submitted) made by nobody
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086413&aid=3378944&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: None
Status: Open
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Prepared Statement support in avpops

Initial Comment:
It would be nice if avpops exposed an easy way to use prepared statements with 
a database.
Prepared statements offer an extra layer of security and increased performance.

You should be able to create prepare statements as part of the configuration:
#Connect to db with id 1
modparam("avpops","db_url","1 mysql://user:passwd@host/database")

#create prepared statement id 0 on database id 1 with one place holder
modparam("avpops","db_prepare","0 1 select password, ha1 from subscriber where 
username=?");

#Exec prepared statement id 0
#A prepared statement is associated with a database connection so we do not 
need to specify the database
avp_db_exec("0", $var(username), $avp(password), $avp(ha1));

Of course on database reconnects they statements should be prepared again 
automatically.

I think this would be a great feature to have, especially for those who have to 
make repeated queries to a database. 

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086413&aid=3378944&group_id=232389

_______________________________________________
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel

Reply via email to