final class SchemaBuilder
Deprecated: Use \SqlSemantics\Facade\Schema::analyze() to read state declarations.
Public API: explicitly declared with @visibility public.

Compatibility entry point for closed catalog binding.

Accept this semantic value in a database-independent consumerdoctest
$consume = static fn (\SqlSemantics\Core\SchemaBuilder $value): string => $value::class;
    $consume instanceof \Closure // => true

Properties§

public string $defaultSchema

Namespace used for unqualified table declarations and references.

public Dialect $dialect

Methods§

public function __construct(
    public Dialect $dialect,
    string|null $defaultSchema = null,
    string|null $grammarVersion = null,
)

Parameters

$dialectDialectLanguage used for declarations and subsequent statement binding
$defaultSchemastring|nullDefaults to the platform declaration namespace
$grammarVersionstring|nullsql-parser release tag; null selects its default release
Calls 2
public function build(string ...$sql): Schema

Builds an independent schema from zero or more SQL strings containing CREATE TABLE statements.

Parameters

$sqlstringDDL strings in declaration order; no arguments builds an empty schema

Returns

Throws

SemanticException When declarations conflict or use unsupported semantics
LexicalException When SQL contains invalid tokens
SyntaxException When SQL does not match the selected grammar
Test cases 112
Calls 1

Private surface 1§

Implementation details, listed for orientation only.

private SchemaAnalyzer $semantics

Test cases 132§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 7
Other tests reaching this symbol 125