Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#18 Multiple DB support for avpops module

trunk
closed-fixed
modules (179)
5
2008-12-30
2008-09-08
Kobi Eshun
No

Hi.

Attached is a patch implementing extended DB support for the avpops module. The patch adds a new module parameter, 'dbx_url', and a new script function, 'avp_dbx_query(index, query [,dest]).

The patch includes updates to the module docs to describe the new functionality.

Cheers,
--
kobi

Discussion

  • Kobi Eshun
    Kobi Eshun
    2008-09-09

    • milestone: 869101 --> trunk
     
  • Hi Kobi,

    Thanks for the patch - could you detail a bit what means the "extended" DB support ?

    Regards,
    Bogdan

     
  • Kobi Eshun
    Kobi Eshun
    2008-09-09

    The "extended DB support" permits queries against multiple databases. The existing code restricts all avp_db_query() calls to be against the same DB URL. This is inconvenient when you want to migrate your database tables to different servers for performance tuning reasons, for example. This patch removes the restriction.

    If this concept is generally useful, I'd be open to refactoring the code to fit in more smoothly with the existing. For example, I maintain a vector of DB URLs separately from the existing DB URL. There is no conceptual reason to keep it this way. It might also be possible to eliminate the new script function altogether, and overload the existing signature to handle an optional DB index.

    --
    kobi

     
    • assigned_to: nobody --> bogdan_iancu
    • status: open --> open-accepted
     
  • Hi Kobi,

    yes, access to multiple DBs make sense - I will review the patch and come back to you.

    Thanks and regards,
    Bogdan

     
  • Kobi Eshun
    Kobi Eshun
    2008-09-23

    Fixes error constructing extended DB query

     
    Attachments
  • Kobi Eshun
    Kobi Eshun
    2008-09-23

    File Added: avpdbx.patch

     
  • Hi Kobi,

    I had to rework a bit your patch before uploading it on SVN, mainly to make its integration more transparent (no extra functions or params) and also to fix some issues with binding to multiple DB backends.

    Main changes:
    -all DB URLS are specified via db_url param which accepts the old format and the index format
    -index is now internally just a label and not an array index
    -all avp_db_** functions accept an extra optional param to indicate a specific DB support.

    I would appreciate if you could test the new version.

    Thanks and regards,
    Bogdan

     
    • status: open-accepted --> closed-fixed