Switch to Adodb for SQL interaction.

  • Nobody/Anonymous

    Instead of providing hardcoded bindings to mysql, would it be possible and relatively easy to adapt to using adodb so that users wouldn't have to be obligated to install mysql alongside whatever sql they currently run?

    For example, by moving to adodb, users with postgre or firebird would no longer have to install mysql solely for openbiblio.

    I would think that this might make the switch from a commercial version to openbiblio easier for larger libraries.

    Although my desire is not for this purpose, I've played with openbiblio just as a catalogue of all the books i've got.

    • Micah Stetson

      Micah Stetson - 2005-08-18

      It probably wouldn't be too hard, you would mainly have to rewrite classes/DbConnection.php and then just make sure the SQL in classes/*Query.php was portable.  You'd also have to make a way to specify the database driver in database_constants.php.  I think if the SQL needed no change, it might take less than an hour.

      I won't be doing it in the near future, but if anybody else wants to, I'd be glad to answer any questions they have.


    • Nobody/Anonymous

      I looked at it.  I picked up a book on php, and I'll see if I can't work on it a bit.  My programming is limited to C and FORTRAN, so this will be an exciting adventure into the lands of object oriented programming, blah blah.  :)

    • Nobody/Anonymous

      What I seem to get so far is that dbconnection.php is itself an abstraction library of sorts to keep database specific calls separate from the code.  And in all the *query.php files, instances of the query object create a conn object, that actually handles the connection.  If I was to adapt the query.php file to use calls to adodb rather than the dbconnection.php "abstraction library", it might prove easier, and certainly more efficient.

      Then, the database manipulation commands (exec, fetchrow, etc) would be in the adodbconnection object (equivalent to execute() and getrow()), allowing that code to be similarly streamlined.  Adodb seems to provide direct 1-1 equivalents of most or maybe all of the databse manipulation calls.

      But then again, so does adodblite, which would probably be much faster and is definitely smaller, which means it could be more acceptable to integrate with the openbiblio download, rather than forcing downloading an additional library.

      Whats your take?

      • Micah Stetson

        Micah Stetson - 2005-08-22

        You're right about DbConnection and the *Query.php files.

          I like the fact that OpenBiblio doesn't require anything that a normal PHP install doesn't provide, so I would probably lean toward replacing DbConnection with ADOdb Lite.

        I can't promise that it will make it into the main distribution, but the direction you're going looks pretty good to me.  I'm concerned about what you may need to do to make all the SQL work with many different database engines.



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks