Merge pull request #732 from franzliedke/patch-4
Add a last_query() function to Database connection class.
This commit is contained in:
commit
f608157ffc
|
@ -133,6 +133,18 @@ public static function profile()
|
|||
{
|
||||
return Database\Connection::$queries;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the last query that was executed.
|
||||
*
|
||||
* Returns false if no queries have been executed yet.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function last_query()
|
||||
{
|
||||
return Database\Connection::last_query();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a database connector and grammars.
|
||||
|
|
|
@ -332,5 +332,17 @@ public function __call($method, $parameters)
|
|||
{
|
||||
return $this->table($method);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the last query that was executed.
|
||||
*
|
||||
* Returns false if no queries have been executed yet.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function last_query()
|
||||
{
|
||||
return end(static::$queries);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue