| @@ 78-88 (lines=11) @@ | ||
| 75 | /** |
|
| 76 | * {@inheritdoc} |
|
| 77 | */ |
|
| 78 | protected function fetchColumns(): array |
|
| 79 | { |
|
| 80 | $query = "SHOW FULL COLUMNS FROM {$this->driver->identifier($this->getName())}"; |
|
| 81 | ||
| 82 | $result = []; |
|
| 83 | foreach ($this->driver->query($query) as $schema) { |
|
| 84 | $result[] = MySQLColumn::createInstance($this->getName(), $schema); |
|
| 85 | } |
|
| 86 | ||
| 87 | return $result; |
|
| 88 | } |
|
| 89 | ||
| 90 | /** |
|
| 91 | * {@inheritdoc} |
|
| @@ 74-88 (lines=15) @@ | ||
| 71 | /** |
|
| 72 | * {@inheritdoc} |
|
| 73 | */ |
|
| 74 | protected function fetchReferences(): array |
|
| 75 | { |
|
| 76 | $query = "PRAGMA foreign_key_list({$this->driver->quote($this->getName())})"; |
|
| 77 | ||
| 78 | $result = []; |
|
| 79 | foreach ($this->driver->query($query) as $schema) { |
|
| 80 | $result[] = SQLiteReference::createInstance( |
|
| 81 | $this->getName(), |
|
| 82 | $this->getPrefix(), |
|
| 83 | $schema |
|
| 84 | ); |
|
| 85 | } |
|
| 86 | ||
| 87 | return $result; |
|
| 88 | } |
|
| 89 | ||
| 90 | /** |
|
| 91 | * Fetching primary keys from table. |
|
| @@ 71-85 (lines=15) @@ | ||
| 68 | /** |
|
| 69 | * {@inheritdoc} |
|
| 70 | */ |
|
| 71 | protected function fetchReferences(): array |
|
| 72 | { |
|
| 73 | $references = $this->driver->query('sp_fkeys @fktable_name = ?', [$this->getName()]); |
|
| 74 | ||
| 75 | $result = []; |
|
| 76 | foreach ($references as $schema) { |
|
| 77 | $result[] = SQlServerReference::createInstance( |
|
| 78 | $this->getName(), |
|
| 79 | $this->getPrefix(), |
|
| 80 | $schema |
|
| 81 | ); |
|
| 82 | } |
|
| 83 | ||
| 84 | return $result; |
|
| 85 | } |
|
| 86 | ||
| 87 | /** |
|
| 88 | * {@inheritdoc} |
|