classSqlVersion
final class SqlVersion
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
A supported SQL release and its grammar AST; lexical rules are declared in PHP.
Properties§
public string $dialectpublic string $namepublic string $astPathMethods§
public function __construct(public string $dialect, public string $name, public string $astPath)Parameters
$dialect | string | Dialect the artifacts describe |
$name | string | Release the artifacts describe |
$astPath | string | Where the grammar AST is read from or written to |
public static function resolve(string $dialect, string|null $version = null): selfAnswers the artifacts this package ships for one release.
Parameters
$dialect | string | Dialect the caller generates SQL for |
$version | string|null | Release to resolve, or null for the dialect default |
Returns
self Artifacts committed for that releaseThrows
RuntimeException When the dialect or the release is not one this package shipsTest cases 3
SqlVersionTest::testResolveAnswersTheDefaultReleaseWithItsGrammarcovers and callsSqlVersionTest::testResolveRejectsADialectThePackageDoesNotShipcovers and callsSqlVersionTest::testResolveRejectsAReleaseThePackageDoesNotShipcovers and calls
Called from 9
- static-call SqlFaker\MySql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/MySql/Generation/Lexeme/DefinitionFactory.php:88
- static-call SqlFaker\MySql\Grammar\MySqlGrammar::load() packages/sql-faker/src/MySql/Grammar/MySqlGrammar.php:27
- static-call SqlFaker\MySql\Grammar\MySqlGrammar::resolveVersion() packages/sql-faker/src/MySql/Grammar/MySqlGrammar.php:43
- static-call SqlFaker\PostgreSql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/PostgreSql/Generation/Lexeme/DefinitionFactory.php:43
- static-call SqlFaker\PostgreSql\Grammar\PgGrammar::load() packages/sql-faker/src/PostgreSql/Grammar/PgGrammar.php:27
- static-call SqlFaker\PostgreSql\Grammar\PgGrammar::resolveVersion() packages/sql-faker/src/PostgreSql/Grammar/PgGrammar.php:43
- static-call SqlFaker\Sqlite\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/Sqlite/Generation/Lexeme/DefinitionFactory.php:44
- static-call SqlFaker\Sqlite\Grammar\SqliteGrammar::load() packages/sql-faker/src/Sqlite/Grammar/SqliteGrammar.php:27
- static-call SqlFaker\Sqlite\Grammar\SqliteGrammar::resolveVersion() packages/sql-faker/src/Sqlite/Grammar/SqliteGrammar.php:43
Calls 2
- method-call SqlVersionRegistry::resolve() line 39
- new SqlVersionRegistry line 39
public static function names(string $dialect): list<string>Answers every release one dialect ships, oldest first.
Parameters
$dialect | string | Dialect to enumerate |
Returns
list<string> Release names in the order they were registeredThrows
RuntimeException When the dialect is not one this package shipsTest cases 3
SqlVersionTest::testNamesEnumeratesTheReleasesOfOneDialectcovers and callsSqlVersionTest::testNamesRejectsADialectThePackageDoesNotShipcovers and callsMySqlProviderTest::providerMySqlVersioncalls
Calls 2
- method-call SqlVersionRegistry::names() line 53
- new SqlVersionRegistry line 53
public static function all(): list<self>Answers every release of every dialect, so a caller can act on all of them.
Returns
list<self> Artifacts committed for each registered releaseThrows
RuntimeException When the record names a release it does not describeTest cases 1
SqlVersionTest::testAllEnumeratesEveryRegisteredReleasecovers and calls
Calls 2
- method-call SqlVersionRegistry::all() line 65
- new SqlVersionRegistry line 65
Test cases 28§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 6
SqlVersionTest::testAllEnumeratesEveryRegisteredReleasecovers and callsSqlVersionTest::testNamesEnumeratesTheReleasesOfOneDialectcovers and callsSqlVersionTest::testNamesRejectsADialectThePackageDoesNotShipcovers and callsSqlVersionTest::testResolveAnswersTheDefaultReleaseWithItsGrammarcovers and callsSqlVersionTest::testResolveRejectsADialectThePackageDoesNotShipcovers and callsSqlVersionTest::testResolveRejectsAReleaseThePackageDoesNotShipcovers and calls
Other tests reaching this symbol 22
GrammarWriterTest::testPublishFailsBeforeStagingWhenTheParentIsAFilecallsGrammarWriterTest::testPublishReplacesTheCompleteAstAndCleansItsStagingFilecallsLexicalExceptionTestcallsSqlVersionRegistryTestcallsGenerationContextTestcallsCharsetValueLexemeGeneratorTestcallsDefinitionFactoryTestcallsLexicalGrammarTestcallsStartRuleResolverTestcallsMySqlGrammarTestcallsMySqlProviderTest::providerMySqlVersioncallsGenerationContextTestcallsDefinitionFactoryTestcallsLexicalGrammarTestcallsPgGrammarTestcallsPostgreSqlProviderTestcallsSqlGeneratorFactoryTestcallsGenerationContextTestcallsDefinitionFactoryTestcallsLexicalGrammarTestcallsSqliteGrammarTestcallsSqliteProviderTestcalls
Relations§
Instantiated in 1
Static calls 9
- static-call SqlFaker\MySql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/MySql/Generation/Lexeme/DefinitionFactory.php:88
- static-call SqlFaker\MySql\Grammar\MySqlGrammar::load() packages/sql-faker/src/MySql/Grammar/MySqlGrammar.php:27
- static-call SqlFaker\MySql\Grammar\MySqlGrammar::resolveVersion() packages/sql-faker/src/MySql/Grammar/MySqlGrammar.php:43
- static-call SqlFaker\PostgreSql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/PostgreSql/Generation/Lexeme/DefinitionFactory.php:43
- static-call SqlFaker\PostgreSql\Grammar\PgGrammar::load() packages/sql-faker/src/PostgreSql/Grammar/PgGrammar.php:27
- static-call SqlFaker\PostgreSql\Grammar\PgGrammar::resolveVersion() packages/sql-faker/src/PostgreSql/Grammar/PgGrammar.php:43
- static-call SqlFaker\Sqlite\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/Sqlite/Generation/Lexeme/DefinitionFactory.php:44
- static-call SqlFaker\Sqlite\Grammar\SqliteGrammar::load() packages/sql-faker/src/Sqlite/Grammar/SqliteGrammar.php:27
- static-call SqlFaker\Sqlite\Grammar\SqliteGrammar::resolveVersion() packages/sql-faker/src/Sqlite/Grammar/SqliteGrammar.php:43