* [story#59810,1h] add sql format.
This commit is contained in:
@@ -235,6 +235,6 @@ class Condition extends Component
|
||||
return implode(' ', $component);
|
||||
}
|
||||
|
||||
return $component->expr;
|
||||
return $component->expr . PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -488,6 +488,6 @@ class Expression extends Component
|
||||
$ret .= ' AS ' . Context::escape($component->alias);
|
||||
}
|
||||
|
||||
return $ret;
|
||||
return $ret . PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ class JoinKeyword extends Component
|
||||
{
|
||||
$ret = [];
|
||||
foreach ($component as $c) {
|
||||
$ret[] = array_search($c->type, static::$JOINS) . ' ' . $c->expr
|
||||
$ret[] = PHP_EOL . array_search($c->type, static::$JOINS) . ' ' . trim((string)$c->expr, PHP_EOL)
|
||||
. (! empty($c->on)
|
||||
? ' ON ' . Condition::build($c->on) : '')
|
||||
. (! empty($c->using)
|
||||
|
||||
@@ -190,7 +190,7 @@ abstract class Statement implements Stringable
|
||||
|
||||
// Checking if the name of the clause should be added.
|
||||
if ($type & 2) {
|
||||
$query = trim($query) . ' ' . $name;
|
||||
$query = trim($query) . ' ' . PHP_EOL . $name;
|
||||
}
|
||||
|
||||
// Checking if the result of the builder should be added.
|
||||
|
||||
Reference in New Issue
Block a user