[Solar-talk] Re: Solar_Sql function _getTypeSizeScope returns
incorrect type
Paul M Jones
pmjones at ciaweb.net
Wed Jul 11 16:31:27 CDT 2007
On Jul 5, 2007, at 10:28 AM, Pierre Oztel wrote:
> Alright the default problem is solved the Solar_Sql_Table class.
>
> I was wondering also why do we use the Solar_Sql::quote() methods.
They're used internally by Solar in other places, and I want them to
be available for those times when the automated query builder logic
won't do exactly what you need in some unforeseen case.
> Here's a list of suggestion that i'd like Solar to implement:
>
> - 100% of the queries are prepared statement, no quote
*Almost* all queries can work this way, and all the automated query
methods do in fact work like this. However, it's not possible to
force developers to use prepared statements; they can always do scary
stuff if they want to:
$sql->query("SELECT id FROM table_name WHERE id = \'{$_GET['id']}
\'")
Best I can do is to make it really really easy to build prepared
statements:
$sql->query(
"SELECT id FROM table_name WHERE id = :id",
array('id' => (int) $_GET['id'])
);
> - Insert, Update methods in Sql_Table should natively support
> rollback mecanism since this class is already casting, validating
That's a good idea; can you enter it as a feature request so I don't
forget?
<http://solarphp.com/trac/newticket>
> - Solar_Valid should be stored in the registry
Probably not going to happen, mostly because different parts of the
system are going to need their own extended DataFilter methods (see
e.g. the new Solar_Sql_Model class, unfinished but a good show of how
custom DataFilter classes can be mixed with Model classes).
> - Foreign key constraints should be available
That's a tough one; I agree they "should be" but it's difficult to do
in a portable way. Happy to hear thoughts on how to make it happen
though.
--
Paul M. Jones <http://paul-m-jones.com>
Solar: Simple Object Library and Application Repository
for PHP5. <http://solarphp.com>
Join the Solar community wiki! <http://solarphp.org>
Savant: The simple, elegant, and powerful solution for
templates in PHP. <http://phpsavant.com>
More information about the Solar-talk
mailing list