migrations boolean() -> smallInteger()

This commit is contained in:
xiaomlove
2026-04-14 13:12:56 +07:00
parent 4d4af87dc9
commit 4d54e08918
45 changed files with 136 additions and 103 deletions
+5 -6
View File
@@ -63,9 +63,9 @@ class NexusDB
return self::$instance = $instance;
}
public function connect($host, $username, $password, $database, $port)
public function connect($host, $username, $password, $database, $port, $driver = 'mysql')
{
$result = $this->driver->connect($host, $username, $password, $database, $port);
$result = $this->driver->connect($host, $username, $password, $database, $port, $driver);
if (!$result) {
throw new DatabaseException(sprintf('[%s]: %s', $this->errno(), $this->error()));
}
@@ -78,8 +78,9 @@ class NexusDB
if ($this->isConnected()) {
return null;
}
$config = nexus_config('nexus.mysql');
return $this->connect($config['host'], $config['username'], $config['password'], $config['database'], $config['port']);
$dbType = self::getConnectionName();
$config = nexus_config('nexus.database.connections.' . $dbType);
return $this->connect($config['host'], $config['username'], $config['password'], $config['database'], $config['port'], $dbType);
}
public function query(string $sql)
@@ -485,6 +486,4 @@ class NexusDB
return $indexesNames;
}
}