MySqlBuilder
class MySqlBuilder extends Builder (View source)
Traits
Properties
static protected array | $macros | The registered string macros. |
from Macroable |
protected Connection | $connection | The database connection instance. |
from Builder |
protected Grammar | $grammar | The schema grammar instance. |
from Builder |
protected Closure | $resolver | The Blueprint resolver callback. |
from Builder |
static int|null | $defaultStringLength | The default string length for migrations. |
from Builder |
static | $defaultTimePrecision | The default time precision for migrations. |
from Builder |
static string | $defaultMorphKeyType | The default relationship morph key type. |
from Builder |
Methods
Mix another object into the class.
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Set the default string length for migrations.
Set the default time precision for migrations.
Set the default morph key type for migrations.
Drop a database from the schema if the database exists.
Get the tables that belong to the connection.
Get the names of the tables that belong to the connection.
Get the views that belong to the connection.
Get the user-defined types that belong to the connection.
Determine if the given table has a given column.
Determine if the given table has given columns.
Execute a table builder callback if the given table has a given column.
Execute a table builder callback if the given table doesn't have a given column.
Get the data type for the given column name.
Determine if the given table has a given index.
Drop columns from a table schema.
Drop all tables from the database.
Drop all views from the database.
Disable foreign key constraints during the execution of a callback.
Create a new command set with a Closure.
Get the names of current schemas for the connection.
Parse the given database object reference and extract the schema and table.
Details
static void
defaultTimePrecision(int|null $precision)
Set the default time precision for migrations.
array
getTableListing(string|string[]|null $schema = null, bool $schemaQualified = true)
Get the names of the tables that belong to the connection.
array
getTypes(string|string[]|null $schema = null)
Get the user-defined types that belong to the connection.
void
whenTableHasColumn(string $table, string $column, Closure $callback)
Execute a table builder callback if the given table has a given column.
void
whenTableDoesntHaveColumn(string $table, string $column, Closure $callback)
Execute a table builder callback if the given table doesn't have a given column.
string
getColumnType(string $table, string $column, bool $fullDefinition = false)
Get the data type for the given column name.
bool
hasIndex(string $table, string|array $index, string|null $type = null)
Determine if the given table has a given index.
mixed
withoutForeignKeyConstraints(Closure $callback)
Disable foreign key constraints during the execution of a callback.
protected Blueprint
createBlueprint(string $table, Closure|null $callback = null)
Create a new command set with a Closure.
array
parseSchemaAndTable(string $reference, string|bool|null $withDefaultSchema = null)
Parse the given database object reference and extract the schema and table.