Grammars
3 weeks ago
Blueprint.php
3 weeks ago
Builder.php
3 weeks ago
ColumnDefinition.php
3 weeks ago
ForeignIdColumnDefinition.php
3 weeks ago
ForeignKeyDefinition.php
3 weeks ago
IndexDefinition.php
3 weeks ago
MySqlBuilder.php
3 weeks ago
MySqlSchemaState.php
3 weeks ago
PostgresBuilder.php
3 weeks ago
PostgresSchemaState.php
3 weeks ago
SQLiteBuilder.php
3 weeks ago
SchemaState.php
3 weeks ago
SqlServerBuilder.php
3 weeks ago
SqliteSchemaState.php
3 weeks ago
SqlServerBuilder.php
66 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWPSCOPED\Illuminate\Database\Schema; |
| 4 | |
| 5 | /** @internal */ |
| 6 | class SqlServerBuilder extends Builder |
| 7 | { |
| 8 | /** |
| 9 | * Create a database in the schema. |
| 10 | * |
| 11 | * @param string $name |
| 12 | * @return bool |
| 13 | */ |
| 14 | public function createDatabase($name) |
| 15 | { |
| 16 | return $this->connection->statement($this->grammar->compileCreateDatabase($name, $this->connection)); |
| 17 | } |
| 18 | /** |
| 19 | * Drop a database from the schema if the database exists. |
| 20 | * |
| 21 | * @param string $name |
| 22 | * @return bool |
| 23 | */ |
| 24 | public function dropDatabaseIfExists($name) |
| 25 | { |
| 26 | return $this->connection->statement($this->grammar->compileDropDatabaseIfExists($name)); |
| 27 | } |
| 28 | /** |
| 29 | * Drop all tables from the database. |
| 30 | * |
| 31 | * @return void |
| 32 | */ |
| 33 | public function dropAllTables() |
| 34 | { |
| 35 | $this->connection->statement($this->grammar->compileDropAllForeignKeys()); |
| 36 | $this->connection->statement($this->grammar->compileDropAllTables()); |
| 37 | } |
| 38 | /** |
| 39 | * Drop all views from the database. |
| 40 | * |
| 41 | * @return void |
| 42 | */ |
| 43 | public function dropAllViews() |
| 44 | { |
| 45 | $this->connection->statement($this->grammar->compileDropAllViews()); |
| 46 | } |
| 47 | /** |
| 48 | * Drop all tables from the database. |
| 49 | * |
| 50 | * @return array |
| 51 | */ |
| 52 | public function getAllTables() |
| 53 | { |
| 54 | return $this->connection->select($this->grammar->compileGetAllTables()); |
| 55 | } |
| 56 | /** |
| 57 | * Get all of the view names for the database. |
| 58 | * |
| 59 | * @return array |
| 60 | */ |
| 61 | public function getAllViews() |
| 62 | { |
| 63 | return $this->connection->select($this->grammar->compileGetAllViews()); |
| 64 | } |
| 65 | } |
| 66 |