It is currently Sat Jun 24, 2017 10:37 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: PDO Database wrapper
PostPosted: Thu Nov 20, 2008 2:50 pm 
Offline

Joined: Thu Nov 20, 2008 2:43 pm
Posts: 3
Hello,

I wonder if someone can help to build a PDO Database Wrapper for Clonefish.
I'm using PDO with prepared statements in my local PHP Project and I want to use clonefish also. Can somebody help me out?

Thanks in advance,

Magic


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 24, 2008 6:51 am 
Offline

Joined: Thu Nov 20, 2008 2:43 pm
Posts: 3
Hmm,

no one? Is it maybe not possible?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 24, 2008 11:10 am 
Offline
Site Admin

Joined: Thu Jan 19, 2006 2:38 pm
Posts: 105
Hi Magic,

Apologies for the delay! As PDO is very similar to the database abstractions layers already supported by Clonefish, it's possible to build a wrapper for this one too. It's not only possible, it's just happened: I've emailed the wrapper in question to you.

There are two things to know when using this wrapper:

- I've read that you're using prepared statements in your application. While it's a good practice in general and provides performance benefits for repeated queries, according to our experiences it's highly unlikely that prepared statements could be reused while rendering a form instance. This way the prepare-bind process would not provide better performance compared to queries built on-the-fly, that's the main reason why wrappers - including the PDO wrapper - were built without support for prepared statements. Anyways, it's still possible to do ;), we just don't feel that it's adequate for a form generator (meanwhile this also helps maintaining a consistent and universal selection of wrappers).

- you may have already seen the <code>minrows</code> and <code>maxrows</code> options for database validation. These options rely on the <code>RecordCount()</code> method of the database wrapper result object. Unfortunately counting rows for a SELECT statement is not supported by several RDBMSes. While some database abstraction layers (like AdoDB) provide rowcount emulation in such cases, there's no such feature in PDO, so the PDO wrapper runs another query in these cases as it's suggested in the PDO manual. To maintain portability, you may have to modify this method to support your RDBMS of choice.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 24, 2008 3:11 pm 
Offline

Joined: Thu Nov 20, 2008 2:43 pm
Posts: 3
Wow,

what a support. Thank you for your detailed answer and the packet that you sent. Great!

Regards.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group