How can I compile Propel Criteria to clear SQL? I've tried $criteria->toString(); but this is not I expected. Also I've tried ModelPeer::doSelectStmt($criteria) but it returned raw sql (required parameters substitution)
First of all, it's important to note that Propel uses PDO with prepared statements, so you're not going to get a fully "built-out" SQL statement in PHP. Using the Criteria->toString() is a good start, but as Peter mentions a lot of the work is indeed done by the BasePeer::createSelectSql() method.
Here's the most complete way (from Propel) to see what the SQL will look like (with placeholders) and the parameters that will be substituted in:
$params = array(); // This will be filled with the parameters
$sql = BasePeer::createSelectSql($criteria, $params);
print "The raw SQL: " . $sql . "\n";
print "The parameters: " . print_r($params, true) . "\n";
Note that you may get better mileage from just logging the queries at the database level. Of course, if PDO is configured (or supports) to use native db prepared statements, then you may still be seeing placeholders in the db too.