1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-09 15:47:23 +02:00

Translator: added %N

This commit is contained in:
David Grudl
2016-07-20 14:49:58 +02:00
parent b7974fe192
commit d405ec369b
2 changed files with 10 additions and 1 deletions

View File

@@ -380,9 +380,12 @@ final class Translator
}
case 'by':
case 'n': // identifier name
case 'n': // composed identifier name
return $this->identifiers->$value;
case 'N': // identifier name
return $this->driver->escapeIdentifier($value);
case 'ex':
case 'sql': // preserve as dibi-SQL (TODO: leave only %ex)
$value = (string) $value;

View File

@@ -542,6 +542,12 @@ Assert::same(
);
Assert::same(
reformat('SELECT [a].[b] AS [c.d]'),
$conn->translate('SELECT %n AS %N', 'a.b', 'c.d')
);
setLocale(LC_ALL, 'czech');
Assert::same(