PHINX_TYPE_STRING
PHINX_TYPE_STRING = 'string'
Adapter Interface.
setOptions(array $options) : \Phinx\Db\Adapter\AdapterInterface
Set adapter configuration options.
array | $options |
setInput(\think\console\Input $input) : \Phinx\Db\Adapter\AdapterInterface
Sets the console input.
\think\console\Input | $input | Input |
getInput() : \think\console\Input
Gets the console input.
setOutput(\think\console\Output $output) : \Phinx\Db\Adapter\AdapterInterface
Sets the console output.
\think\console\Output | $output | Output |
getOutput() : \think\console\Output
Gets the console output.
migrated(\Phinx\Migration\MigrationInterface $migration, string $direction, integer $startTime, integer $endTime) : \Phinx\Db\Adapter\AdapterInterface
Records a migration being run.
\Phinx\Migration\MigrationInterface | $migration | Migration |
string | $direction | Direction |
integer | $startTime | Start Time |
integer | $endTime | End Time |
toggleBreakpoint(\Phinx\Migration\MigrationInterface $migration) : \Phinx\Db\Adapter\AdapterInterface
Toggle a migration breakpoint.
\Phinx\Migration\MigrationInterface | $migration |
None found |
None found |
connect() : void
Initializes the database connection.
When the requested database driver is not installed.
None found |
None found |
hasTransactions() : boolean
Does the adapter support transactions?
None found |
None found |
None found |
None found |
execute(string $sql) : integer
Executes a SQL statement and returns the number of affected rows.
string | $sql | SQL |
None found |
query(string $sql) : array
Executes a SQL statement and returns the result as an array.
string | $sql | SQL |
None found |
fetchRow(string $sql) : array
Executes a query and returns only one row as an array.
string | $sql | SQL |
None found |
fetchAll(string $sql) : array
Executes a query and returns an array of rows.
string | $sql | SQL |
None found |
insert(\Phinx\Db\Table $table, array $row) : void
Inserts data into a table.
\Phinx\Db\Table | $table | where to insert data |
array | $row |
None found |
quoteTableName(string $tableName) : string
Quotes a table name for use in a query.
string | $tableName | Table Name |
None found |
quoteColumnName(string $columnName) : string
Quotes a column name for use in a query.
string | $columnName | Table Name |
None found |
hasTable(string $tableName) : boolean
Checks to see if a table exists.
string | $tableName | Table Name |
None found |
createTable(\Phinx\Db\Table $table) : void
Creates the specified database table.
\Phinx\Db\Table | $table | Table |
None found |
renameTable(string $tableName, string $newName) : void
Renames the specified database table.
string | $tableName | Table Name |
string | $newName | New Name |
None found |
dropTable(string $tableName) : void
Drops the specified database table.
string | $tableName | Table Name |
None found |
getColumns(string $tableName) : array<mixed,\Phinx\Db\Table\Column>
Returns table columns
string | $tableName | Table Name |
None found |
hasColumn(string $tableName, string $columnName) : boolean
Checks to see if a column exists.
string | $tableName | Table Name |
string | $columnName | Column Name |
None found |
addColumn(\Phinx\Db\Table $table, \Phinx\Db\Table\Column $column) : void
Adds the specified column to a database table.
\Phinx\Db\Table | $table | Table |
\Phinx\Db\Table\Column | $column | Column |
None found |
renameColumn(string $tableName, string $columnName, string $newColumnName) : void
Renames the specified column.
string | $tableName | Table Name |
string | $columnName | Column Name |
string | $newColumnName | New Column Name |
None found |
changeColumn(string $tableName, string $columnName, \Phinx\Db\Table\Column $newColumn) : \Phinx\Db\Table
Change a table column type.
string | $tableName | Table Name |
string | $columnName | Column Name |
\Phinx\Db\Table\Column | $newColumn | New Column |
None found |
dropColumn(string $tableName, string $columnName) : void
Drops the specified column.
string | $tableName | Table Name |
string | $columnName | Column Name |
None found |
hasIndex(string $tableName, mixed $columns) : boolean
Checks to see if an index exists.
string | $tableName | Table Name |
mixed | $columns | Column(s) |
None found |
hasIndexByName(string $tableName, string $indexName) : boolean
Checks to see if an index specified by name exists.
string | $tableName | Table Name |
string | $indexName |
None found |
addIndex(\Phinx\Db\Table $table, \Phinx\Db\Table\Index $index) : void
Adds the specified index to a database table.
\Phinx\Db\Table | $table | Table |
\Phinx\Db\Table\Index | $index | Index |
None found |
dropIndex(string $tableName, mixed $columns) : void
Drops the specified index from a database table.
string | $tableName | |
mixed | $columns | Column(s) |
None found |
dropIndexByName(string $tableName, string $indexName) : void
Drops the index specified by name from a database table.
string | $tableName | |
string | $indexName |
None found |
hasForeignKey(string $tableName, array<mixed,string> $columns, string $constraint = null) : boolean
Checks to see if a foreign key exists.
string | $tableName | |
array<mixed,string> | $columns | Column(s) |
string | $constraint | Constraint name |
None found |
addForeignKey(\Phinx\Db\Table $table, \Phinx\Db\Table\ForeignKey $foreignKey) : void
Adds the specified foreign key to a database table.
\Phinx\Db\Table | $table | |
\Phinx\Db\Table\ForeignKey | $foreignKey |
None found |
dropForeignKey(string $tableName, array<mixed,string> $columns, string $constraint = null) : void
Drops the specified foreign key from a database table.
string | $tableName | |
array<mixed,string> | $columns | Column(s) |
string | $constraint | Constraint name |
None found |
getColumnTypes() : array
Returns an array of the supported Phinx column types.
None found |
isValidColumnType(\Phinx\Db\Table\Column $column) : boolean
Checks that the given column is of a supported type.
\Phinx\Db\Table\Column | $column |
None found |
getSqlType(string $type, integer $limit = null) : string
Converts the Phinx logical type to the adapter's SQL type.
string | $type | |
integer | $limit |
None found |
createDatabase(string $name, array $options = array()) : void
Creates a new database.
string | $name | Database Name |
array | $options | Options |
None found |
hasDatabase(string $name) : boolean
Checks to see if a database exists.
string | $name | Database Name |
None found |
dropDatabase(string $name) : void
Drops the specified database.
string | $name | Database Name |
None found |