phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-developers] Database interface extension proposal


From: Kai Hofmann
Subject: [Phpgroupware-developers] Database interface extension proposal
Date: Tue, 21 Oct 2003 15:00:57 +0200

This proposal is motivated by my experiences with porting phpgw to SAP-DB.
The main problem is that SAP-DB 7.4 does not support direct update
statements for blobs.
As it seems only odbc_prepared (precompiled sql with parameters)update
statements will work.

To improve the phpgw database layer and work around this problem I would
like to propose the following
for the class.db_xxx.inc.php classes in the api as well as for all update
statements to blobs within the phpgw:
(For the SQLBuilder/contact DB classes a similar solutions is required)


1) add two/three new methods to the database (pseudo code)
   a) string/resource create_sql_statement(string sqlstr, array params) - to
create the final sql strings.  
      The array values will be placed at %x place holders within the sqlstr.
      Databases that support "prepare" will send the prepare statement here,
      for others only the string will be created.

   b) result query_prepared_statement(string/resource query)
      the query will be executed by the database

   c) free(resource prepared)
      to free prepared statements

2) change every update statement that updates blobs to the above schema
   other often used statment cann follow later to improve database
performance.


The benefit of this is that often used and complicate sql statements can be
executed faster
by databases which support prepared sql statements. For other databases this
is transparent.

Comments?


Greetings

   Kai


-- 
*****    Open Source und Linux im professionellen Einsatz    *****
**  komplexe Mailserver, Groupware, Office: sprechen Sie uns an **
Dipl.-Inform. Kai Hofmann                    Team Softwarelösungen
pro|business AG, EXPO Plaza 1 (Deutscher Pavillon), 30539 Hannover
E-Mail: address@hidden,   Tel.: 0511/60066-332, Fax: -355
WWW: http://www.probusiness.de/
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]