DbDelta final readonly class
Minn\Runtime\DbDelta · public/minn/src/Minn/Runtime/DbDelta.php · 125 lines
dbDelta as the reference does it: a CREATE TABLE statement creates the table when it is missing, otherwise the columns and keys the statement has and the table lacks are added. Nothing is ever dropped or altered.
Constants and properties
| private | readonly Minn\Db $db | Promoted from the constructor. |
Public
| new | __construct(Minn\Db $db)# | ||||
| static | creates(array $queries): array# | The CREATE TABLE statements in a batch, keyed by table name. @param list<string> $queries @return array<string, string>
| |||
| method | apply(array $creates, bool $execute): array# | Applies CREATE TABLE statements as dbDelta does; the statements run.
| |||
| method | tables(): array# | Every table in the database. @return list<string> | |||
| method | columns(string $table): array# | A table's columns with their definitions. @return array<string, array<string, mixed>> by column name | |||
| method | indexNames(string $table): array# | A table's index names. @return list<string> lowercase key names | |||
| method | run(string $ddl): void# | Runs one DDL statement. |
Internals 1
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | definitions(string $body): array# | @return array{0: array<string, string>, 1: list<string>} column definitions by lowercase name, and the index lines |
Nothing matches.