classAttach
final class Attach
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.A request to add a database file to the connection under a schema name.
Rule: SQLITE-ATTACH-001. The file, the schema name and the optional key are expressions evaluated where no relation is visible; a column name in them is a missing column, and an operand that is a single identifier is the text of its name (NameOperand). The optional DATABASE keyword is not written. The attached schema is connection state: the statement provides no declaration and changes no context. Source: https://sqlite.org/lang_attach.html. Status: Implemented.
(new \SqlSemantics\Platform\Sqlite\Semantics())->analyze("ATTACH DATABASE 'file.db' AS aux")->toString() // => "ATTACH 'file.db' AS aux"Properties§
public Scalar $filepublic Scalar $schemapublic Scalar|null $key = nullMethods§
public function __construct(
public Scalar $file,
public Scalar $schema,
public Scalar|null $key = null,
)Parameters
$file | Scalar | The expression that names the database file |
$schema | Scalar | The expression that names the schema |
$key | Scalar|null | The expression of the encryption key, which only builds with encryption support use |
public function deriveStatement(Derivation $derivation): voidDerives each operand where no relation is visible.
Parameters
$derivation | Derivation |
Calls 2
- method-call Derivation::scalar() line 46
- method-call Derivation::environment() line 46
public function render(Output $out): voidTest cases 6§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.