SchemaConnection
class SchemaConnection
| internal |
The schema facts of the connection that migrations run on, which its pooled and routed connections share.
A table missing from an incomplete connection is unknown rather than absent.
Properties
| SchemaTable> | $tables | ||
| array<string, null|Domain|EnumType> | $types | ||
| bool | $complete | Whether every relation is known, so that a missing table is a claim. |
|
| list<array{path: string, line: int, message: string}> | $unusableDumps |
Methods
Create a new schema connection instance.
Copy the tables, so that each branch of a migration changes its own copy.
Get the identity key of a schema-qualified name, which ignores ASCII case where SQLite does.
Find the identity key of a relation, or return null when it is absent and false when it is ambiguous.
Add a parsed table, linking the known relations it inherits from or partitions.
Get the identity keys of other relations whose schema and name differ only in letter case.
Make a relation and its known inheritance and partition descendants unknown.
Make the known inheritance and partition descendants of a relation unknown.
Remove a relation that no longer exists, making its descendants unknown.
Make a user type uncertain after a script altered or dropped it.
Make every fact unknown.
Details
at line 43
__construct(string $name, string $driver)
Create a new schema connection instance.
at line 50
void
__clone()
Copy the tables, so that each branch of a migration changes its own copy.
at line 60
string
key(string|null $schema, string $name)
Get the identity key of a schema-qualified name, which ignores ASCII case where SQLite does.
at line 79
false|string|null
findTableKey(string|null $schema, string $name, string|null $defaultSchema, array $searchPath)
Find the identity key of a relation, or return null when it is absent and false when it is ambiguous.
Unqualified MySQL and SQLite names use the connection's default schema. An unqualified PostgreSQL name resolves through the search path. An unqualified definition was created in the first existing schema of its connection's path, so it only matches the same path when no qualified candidate exists.
at line 116
void
addTable(Table $definition, ConnectionConfig $connection, bool $complete)
Add a parsed table, linking the known relations it inherits from or partitions.
at line 145
array
caseVariants(string|null $schema, string $name)
Get the identity keys of other relations whose schema and name differ only in letter case.
MySQL compares database and table names without case on some servers, so a change to one spelling can change another. Identities stay exact, since other servers keep them distinct.
at line 170
void
forgetTable(string|null $schema, string $name)
Make a relation and its known inheritance and partition descendants unknown.
The relation may no longer exist or have its earlier columns. PostgreSQL applies ALTER TABLE without ONLY, and the drop of a partitioned table, to descendants too.
at line 183
void
forgetDescendants(string $key)
Make the known inheritance and partition descendants of a relation unknown.
at line 201
void
dropTable(string $key)
Remove a relation that no longer exists, making its descendants unknown.
at line 218
void
forgetType(string|null $schema, string $name, array $searchPath)
Make a user type uncertain after a script altered or dropped it.
A qualified name is marked even when nothing recorded it, which stops any search along a path through its schema, so a definition recorded without a schema stays known: it was created in a path schema. An unqualified name can denote any recorded definition along the search path.
at line 238
void
forget()
Make every fact unknown.