mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-05-16 05:07:34 +08:00
migrations boolean() -> smallInteger()
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user