SQLiteBuilder
class SQLiteBuilder extends Builder (View source)
Traits
| Macroable |
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 string | $defaultMorphKeyType | The default relationship morph key type. | from Builder |
Methods
| static void | macro(string $name, object|callable $macro)
Register a custom macro. | from Macroable |
| static void | mixin(object $mixin, bool $replace = true)
Mix another object into the class. | from Macroable |
| static bool | hasMacro(string $name)
Checks if macro is registered. | from Macroable |
| static void | flushMacros()
Flush the existing macros. | from Macroable |
| static mixed | __callStatic(string $method, array $parameters)
Dynamically handle calls to the class. | from Macroable |
| mixed | __call(string $method, array $parameters)
Dynamically handle calls to the class. | from Macroable |
| void | __construct(Connection $connection)
Create a new database Schema manager. | from Builder |
| static void | defaultStringLength(int $length)
Set the default string length for migrations. | from Builder |
| static void | defaultMorphKeyType(string $type)
Set the default morph key type for migrations. | from Builder |
| static void | morphUsingUuids()
Set the default morph key type for migrations to UUIDs. | from Builder |
| static void | morphUsingUlids()
Set the default morph key type for migrations to ULIDs. | from Builder |
| bool | createDatabase(string $name)
Create a database in the schema. | |
| bool | dropDatabaseIfExists(string $name)
Drop a database from the schema if the database exists. | |
| bool | hasTable(string $table)
Determine if the given table exists. | from Builder |
| bool | hasView(string $view)
Determine if the given view exists. | from Builder |
| array | getTables(bool $withSize = true)
Get the tables for the database. | |
| array | getTableListing()
Get the names of the tables that belong to the database. | from Builder |
| array | getViews()
Get the views that belong to the database. | from Builder |
| array | getTypes()
Get the user-defined types that belong to the database. | from Builder |
| bool | hasColumn(string $table, string $column)
Determine if the given table has a given column. | from Builder |
| bool | hasColumns(string $table, array $columns)
Determine if the given table has given columns. | from Builder |
| void | whenTableHasColumn(string $table, string $column, Closure $callback)
Execute a table builder callback if the given table has a given column. | from Builder |
| void | whenTableDoesntHaveColumn(string $table, string $column, Closure $callback)
Execute a table builder callback if the given table doesn't have a given column. | from Builder |
| string | getColumnType(string $table, string $column, bool $fullDefinition = false)
Get the data type for the given column name. | from Builder |
| array | getColumnListing(string $table)
Get the column listing for a given table. | from Builder |
| array | getColumns(string $table)
Get the columns for a given table. | |
| array | getIndexes(string $table)
Get the indexes for a given table. | from Builder |
| array | getIndexListing(string $table)
Get the names of the indexes for a given table. | from Builder |
| bool | hasIndex(string $table, string|array $index, string|null $type = null)
Determine if the given table has a given index. | from Builder |
| array | getForeignKeys(string $table)
Get the foreign keys for a given table. | from Builder |
| void | table(string $table, Closure $callback)
Modify a table on the schema. | from Builder |
| void | create(string $table, Closure $callback)
Create a new table on the schema. | from Builder |
| void | drop(string $table)
Drop a table from the schema. | from Builder |
| void | dropIfExists(string $table)
Drop a table from the schema if it exists. | from Builder |
| void | dropColumns(string $table, string|array $columns)
Drop columns from a table schema. | from Builder |
| void | dropAllTables()
Drop all tables from the database. | |
| void | dropAllViews()
Drop all views from the database. | |
| void | dropAllTypes()
Drop all types from the database. | from Builder |
| void | rename(string $from, string $to)
Rename a table on the schema. | from Builder |
| bool | enableForeignKeyConstraints()
Enable foreign key constraints. | from Builder |
| bool | disableForeignKeyConstraints()
Disable foreign key constraints. | from Builder |
| mixed | withoutForeignKeyConstraints(Closure $callback)
Disable foreign key constraints during the execution of a callback. | from Builder |
| void | build(Blueprint $blueprint)
Execute the blueprint to build / modify the table. | from Builder |
| Blueprint | createBlueprint(string $table, Closure|null $callback = null)
Create a new command set with a Closure. | from Builder |
| Connection | getConnection()
Get the database connection instance. | from Builder |
| $this | setConnection(Connection $connection)
Set the database connection instance. | from Builder |
| void | blueprintResolver(Closure $resolver)
Set the Schema Blueprint resolver callback. | from Builder |
| bool | setBusyTimeout(int $milliseconds)
Set the busy timeout. | |
| bool | setJournalMode(string $mode)
Set the journal mode. | |
| bool | setSynchronous(int $mode)
Set the synchronous mode. | |
| void | refreshDatabaseFile()
Empty the database file. |
Details
static void macro(string $name, object|callable $macro)
Register a custom macro.
static void mixin(object $mixin, bool $replace = true)
Mix another object into the class.
static bool hasMacro(string $name)
Checks if macro is registered.
static void flushMacros()
Flush the existing macros.
static mixed __callStatic(string $method, array $parameters)
Dynamically handle calls to the class.
mixed __call(string $method, array $parameters)
Dynamically handle calls to the class.
void __construct(Connection $connection)
Create a new database Schema manager.
static void defaultStringLength(int $length)
Set the default string length for migrations.
static void defaultMorphKeyType(string $type)
Set the default morph key type for migrations.
static void morphUsingUuids()
Set the default morph key type for migrations to UUIDs.
static void morphUsingUlids()
Set the default morph key type for migrations to ULIDs.
bool createDatabase(string $name)
Create a database in the schema.
bool dropDatabaseIfExists(string $name)
Drop a database from the schema if the database exists.
bool hasTable(string $table)
Determine if the given table exists.
bool hasView(string $view)
Determine if the given view exists.
array getTables(bool $withSize = true)
Get the tables for the database.
array getTableListing()
Get the names of the tables that belong to the database.
array getViews()
Get the views that belong to the database.
array getTypes()
Get the user-defined types that belong to the database.
bool hasColumn(string $table, string $column)
Determine if the given table has a given column.
bool hasColumns(string $table, array $columns)
Determine if the given table has given columns.
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.
array getColumnListing(string $table)
Get the column listing for a given table.
array getColumns(string $table)
Get the columns for a given table.
array getIndexes(string $table)
Get the indexes for a given table.
array getIndexListing(string $table)
Get the names of the indexes for a given table.
bool hasIndex(string $table, string|array $index, string|null $type = null)
Determine if the given table has a given index.
array getForeignKeys(string $table)
Get the foreign keys for a given table.
void table(string $table, Closure $callback)
Modify a table on the schema.
void create(string $table, Closure $callback)
Create a new table on the schema.
void drop(string $table)
Drop a table from the schema.
void dropIfExists(string $table)
Drop a table from the schema if it exists.
void dropColumns(string $table, string|array $columns)
Drop columns from a table schema.
void dropAllTables()
Drop all tables from the database.
void dropAllViews()
Drop all views from the database.
void dropAllTypes()
Drop all types from the database.
void rename(string $from, string $to)
Rename a table on the schema.
bool enableForeignKeyConstraints()
Enable foreign key constraints.
bool disableForeignKeyConstraints()
Disable foreign key constraints.
mixed withoutForeignKeyConstraints(Closure $callback)
Disable foreign key constraints during the execution of a callback.
protected void build(Blueprint $blueprint)
Execute the blueprint to build / modify the table.
protected Blueprint createBlueprint(string $table, Closure|null $callback = null)
Create a new command set with a Closure.
Connection getConnection()
Get the database connection instance.
$this setConnection(Connection $connection)
Set the database connection instance.
void blueprintResolver(Closure $resolver)
Set the Schema Blueprint resolver callback.
bool setBusyTimeout(int $milliseconds)
Set the busy timeout.
bool setJournalMode(string $mode)
Set the journal mode.
bool setSynchronous(int $mode)
Set the synchronous mode.
void refreshDatabaseFile()
Empty the database file.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/11.x/Illuminate/Database/Schema/SQLiteBuilder.html