Improve SQL interfacing
Reported by Alex Suraci | September 1st, 2008 @ 12:14 AM | in 2.0 rc2
The current method is verbose, redundant, and fairly limiting:
Post::find(array("where" => "foo = :foo",
"params" => array(":foo" => "This is reundant.")));
I propose removing the need for the params option
entirely, by having it simply assumed by a new, more concise
"where" format:
Post::find(array("where" => array("foo" => "This is awesome.")));
Other potential uses:
Post::find(array("where" => array("foo" => array("one", "of", "these")))); // foo IN ('one', 'of', 'these')
Post::find(array("where" => array("foo" => null))); // foo IS NULL
Post::find(array("where" => array("foo" => true))); // foo = 1
Comments and changes to this ticket
-
Repository September 1st, 2008 @ 11:39 AM
- → State changed from new to resolved
(from [a7f35ec512c10340723dacfb6f141c0f42a42749]) * Vastly improved SQL interfacing. [#200 state:resolved] * Moved
escapefunction from Query class to SQL class. Also, it now auto-quotes the value like PDO does. http://github.com/vito/chyrp/com...
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
