This commit is contained in:
2025-08-19 23:38:52 +03:00
parent 5074629e40
commit cc3b1ef41b
8 changed files with 189 additions and 157 deletions

View File

@@ -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('"', '"'),
};
}
}