mirror of
https://github.com/dg/dibi.git
synced 2025-08-17 19:37:13 +02:00
- DibiFluent - added support for nested selects
- DibiFluent::__toString() returns NOT highlighted SQL
This commit is contained in:
@@ -239,6 +239,26 @@ class DibiConnection extends DibiObject
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Generates and returns SQL query.
|
||||
* @param array|mixed one or more arguments
|
||||
* @return string
|
||||
* @throws DibiException
|
||||
*/
|
||||
final public function sql($args)
|
||||
{
|
||||
$args = func_get_args();
|
||||
$this->connect();
|
||||
$trans = new DibiTranslator($this->driver);
|
||||
if ($trans->translate($args)) {
|
||||
return $trans->sql;
|
||||
} else {
|
||||
throw new DibiException('SQL translate error: ' . $trans->sql);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Generates and prints SQL query.
|
||||
* @param array|mixed one or more arguments
|
||||
|
Reference in New Issue
Block a user