refactor(db): Detect DB type using PDO driver name

This commit is contained in:
kj
2025-10-17 13:12:02 -03:00
parent a0b544eae5
commit 892b3614ec

View File

@@ -925,7 +925,7 @@ class Model
$search = static::bind($search);
$where = [];
if (DB_TYPE == 'sqlite') {
if (static::db()->getAttribute(PDO::ATTR_DRIVER_NAME) == 'sqlite') {
foreach ($in as $row) {
$where[] = "$row LIKE '%' || $search || '%'";
}
@@ -935,7 +935,6 @@ class Model
}
}
if (static::$querySelect['where'] == '') {
static::$querySelect['where'] = join(' OR ', $where);
} else {