Menu

#78 Prepared Statement support in avpops

trunk
closed-accepted
nobody
modules (91)
3
2015-04-06
2011-07-26
Anonymous
No

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.

Discussion

  • Vladut-Stefan Paiu

    • priority: 5 --> 3
     
  • Liviu Chircu

    Liviu Chircu - 2015-04-06

    Moved to 2.2 feature list.

     
  • Liviu Chircu

    Liviu Chircu - 2015-04-06
    • status: open --> closed-accepted
    • Group: --> trunk
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.