This commit is contained in:
2021-02-25 17:57:20 +08:00
parent e1fa0a6b12
commit fd001e6fbb
13 changed files with 93 additions and 469 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ declare(strict_types=1);
namespace Database\Mysql;
use Database\SqlBuilder;
use Snowflake\Abstracts\Component;
use Database\Connection;
use Exception;
@@ -276,7 +276,7 @@ class Columns extends Component
private function structure($table): array|static
{
if (!isset($this->columns[$table]) || empty($this->columns[$table])) {
$column = $this->db->createCommand($this->db->getBuild()->getColumn($table))->all();
$column = $this->db->createCommand(SqlBuilder::builder(null)->columns($table))->all();
if (empty($column)) {
throw new Exception("The table " . $table . " not exists.");
}