20250819
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace goodboyalex\php_db_components_pack\enums;
|
||||
|
||||
use goodboyalex\php_components_pack\classes\Tuple;
|
||||
use goodboyalex\php_components_pack\traits\EnumExtensionsTrait;
|
||||
|
||||
/**
|
||||
@@ -42,4 +43,20 @@
|
||||
* SQLite
|
||||
*/
|
||||
case SQLite = 4;
|
||||
|
||||
/**
|
||||
* Получить знаки открытия/закрытия полей для СУБД.
|
||||
*
|
||||
* @param DBDriver $driver Драйвер СУБД.
|
||||
*
|
||||
* @return Tuple Возвращает кортеж [знак открытия, знак закрытия].
|
||||
*/
|
||||
public static function GetSigns (DBDriver $driver): Tuple
|
||||
{
|
||||
return match ($driver) {
|
||||
DBDriver::MySQL, DBDriver::SQLite => new Tuple('`', '`'),
|
||||
DBDriver::MSSQL => new Tuple('[', ']'),
|
||||
DBDriver::PostgreSQL, DBDriver::OracleDB => new Tuple('"', '"'),
|
||||
};
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user