classGenerationPlans
final class GenerationPlans
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
Names the generation plans this dialect's provider is built from.
A plan is how a caller says which SQL it wants, and the ones a provider offers are a fixed vocabulary rather than something each caller assembles. Naming them here keeps that vocabulary in one place and lets the provider read as a list of what it can generate.
Methods§
public static function quotedIdentifier(int $minLength, int $maxLength): GenerationPlan<true>Parameters
$minLength | int | |
$maxLength | int |
Returns
GenerationPlan<true>Test cases 1
GenerationPlansTest::testQuotedIdentifierPlansThatLexemecovers and calls
Called from 1
Calls 2
- static-call GenerationPlan::lexical() line 29
- function-call
compactline 29
public static function stringLiteral(int $minLength, int $maxLength): GenerationPlan<true>Parameters
$minLength | int | |
$maxLength | int |
Returns
GenerationPlan<true>Test cases 1
GenerationPlansTest::testStringLiteralPlansThatLexemecovers and calls
Called from 1
Calls 2
- static-call GenerationPlan::lexical() line 37
- function-call
compactline 37
public static function integerLiteral(int $min, int $max): GenerationPlan<true>Parameters
$min | int | |
$max | int |
Returns
GenerationPlan<true>Test cases 1
GenerationPlansTest::testIntegerLiteralPlansThatLexemecovers and calls
Called from 1
Calls 2
- static-call GenerationPlan::lexical() line 45
- function-call
compactline 45
public static function decimalLiteral(int $precision, int $scale): GenerationPlan<true>Parameters
$precision | int | |
$scale | int |
Returns
GenerationPlan<true>Test cases 1
GenerationPlansTest::testDecimalLiteralPlansThatLexemecovers and calls
Called from 1
Calls 2
- static-call GenerationPlan::lexical() line 53
- function-call
compactline 53
public static function multiDmlStatement(
int $firstChoice,
int $secondChoice,
): GenerationPlan<true>Parameters
$firstChoice | int | |
$secondChoice | int |
Returns
GenerationPlan<true>Throws
InvalidArgumentException When a choice does not name one of the three DML statementsTest cases 1
Called from 1
Calls 4
- static-call ProductionPattern::containing() line 64
- new
InvalidArgumentExceptionline 68 - static-call GenerationPlan::constrained() line 71
- static-call ProductionPattern::exactly() line 73
public static function fullTextSearchStatement(): GenerationPlan<true>Returns
GenerationPlan<true>Test cases 1
GenerationPlansTest::testFullTextSearchStatementRequiresMatchGrammarcovers and calls
Called from 1
Calls 4
- static-call GenerationPlan::constrained() line 97
- static-call ProductionPattern::exactly() line 98
- static-call ProductionPattern::containing() line 99
- static-call ProductionPattern::nonEmpty() line 102
public static function insertFunctionUpsertStatement(): GenerationPlan<true>Returns
GenerationPlan<true>Test cases 1
Called from 1
Calls 3
- static-call GenerationPlan::constrained() line 121
- static-call ProductionPattern::containing() line 122
- static-call ProductionPattern::exactly() line 123
public static function temporaryTableStatement(): GenerationPlan<true>Returns
GenerationPlan<true>Test cases 1
Called from 1
Calls 2
- static-call GenerationPlan::constrained() line 145
- static-call ProductionPattern::containing() line 146
public static function viewStatement(): GenerationPlan<true>Returns
GenerationPlan<true>Test cases 1
GenerationPlansTest::testViewStatementRestrictsTheCreateGrammarcovers and calls
Called from 1
Calls 2
- static-call GenerationPlan::constrained() line 156
- static-call ProductionPattern::containing() line 157
public static function generatedColumnStatement(): GenerationPlan<true>Returns
GenerationPlan<true>Test cases 1
Called from 1
Calls 3
- static-call GenerationPlan::constrained() line 167
- static-call ProductionPattern::containing() line 168
- static-call ProductionPattern::exactly() line 171
public static function foreignKeyCascadeStatement(): GenerationPlan<true>Returns
GenerationPlan<true>Test cases 1
Called from 1
Calls 4
- static-call GenerationPlan::constrained() line 183
- static-call ProductionPattern::containing() line 184
- static-call ProductionPattern::nonEmpty() line 186
- static-call ProductionPattern::exactly() line 189
public static function foreignKeyConstraint(): GenerationPlan<true>Returns
GenerationPlan<true>Test cases 1
Called from 1
Calls 4
- static-call GenerationPlan::constrained() line 209
- static-call ProductionPattern::exactly() line 211
- static-call ProductionPattern::containing() line 215
- static-call ProductionPattern::nonEmpty() line 219
public static function statement(
non-empty-string $startRule,
int $maxDepth,
): GenerationPlan<false>Directs a bounded walk that grows one statement from its own rule.
Parameters
$startRule | non-empty-string | Rule the statement is grown from |
$maxDepth | int | How deep the walk may recurse |
Returns
GenerationPlan<false> Plan for one bounded statementTest cases 3
Called from 19
- static-call SqlFaker\Sqlite\Generation\GenerationPlans::statementOfType() packages/sql-faker/src/Sqlite/Generation/GenerationPlans.php:248
- static-call SqlFaker\SqliteProvider::selectStatement() packages/sql-faker/src/SqliteProvider.php:125
- static-call SqlFaker\SqliteProvider::insertStatement() packages/sql-faker/src/SqliteProvider.php:141
- static-call SqlFaker\SqliteProvider::updateStatement() packages/sql-faker/src/SqliteProvider.php:157
- static-call SqlFaker\SqliteProvider::deleteStatement() packages/sql-faker/src/SqliteProvider.php:173
- static-call SqlFaker\SqliteProvider::createTableStatement() packages/sql-faker/src/SqliteProvider.php:189
- static-call SqlFaker\SqliteProvider::alterTableStatement() packages/sql-faker/src/SqliteProvider.php:205
- static-call SqlFaker\SqliteProvider::dropTableStatement() packages/sql-faker/src/SqliteProvider.php:221
- static-call SqlFaker\SqliteProvider::simpleStatement() packages/sql-faker/src/SqliteProvider.php:237
- static-call SqlFaker\SqliteProvider::expr() packages/sql-faker/src/SqliteProvider.php:253
- static-call SqlFaker\SqliteProvider::term() packages/sql-faker/src/SqliteProvider.php:269
- static-call SqlFaker\SqliteProvider::whereClause() packages/sql-faker/src/SqliteProvider.php:284
- static-call SqlFaker\SqliteProvider::orderByClause() packages/sql-faker/src/SqliteProvider.php:299
- static-call SqlFaker\SqliteProvider::limitClause() packages/sql-faker/src/SqliteProvider.php:314
- static-call SqlFaker\SqliteProvider::groupByClause() packages/sql-faker/src/SqliteProvider.php:329
- static-call SqlFaker\SqliteProvider::havingClause() packages/sql-faker/src/SqliteProvider.php:344
- static-call SqlFaker\SqliteProvider::fullname() packages/sql-faker/src/SqliteProvider.php:360
- static-call SqlFaker\SqliteProvider::withClause() packages/sql-faker/src/SqliteProvider.php:375
- static-call SqlFaker\SqliteProvider::identifier() packages/sql-faker/src/SqliteProvider.php:409
Calls 1
- static-call GenerationPlan::fromRule() line 233
public static function statementOfType(
Generator $faker,
?StatementRule $type,
int $maxDepth,
): GenerationPlan<false>Selects a statement type when omitted and bounds its generation plan.
Parameters
$faker | Generator | |
$type | ?StatementRule | |
$maxDepth | int |
Returns
GenerationPlan<false>Test cases 2
Called from 1
Calls 3
- method-call
Generator::randomElement()line 245 - static-call StatementRule::cases() line 245
- static-call GenerationPlans::statement() line 248
Test cases 16§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 15
GenerationPlansTest::testDecimalLiteralPlansThatLexemecovers and callsGenerationPlansTest::testForeignKeyCascadeStatementRequiresBothCascadeActionscovers and callsGenerationPlansTest::testForeignKeyConstraintRestrictsTheTableConstraintGrammarcovers and callsGenerationPlansTest::testFullTextSearchStatementRequiresMatchGrammarcovers and callsGenerationPlansTest::testGeneratedColumnStatementRequiresTheGeneratedConstraintcovers and callsGenerationPlansTest::testInsertFunctionUpsertStatementRestrictsTheConflictFunctionGrammarcovers and callsGenerationPlansTest::testIntegerLiteralPlansThatLexemecovers and callsGenerationPlansTest::testMultiDmlStatementDirectsBothStatementOccurrencescovers and callsGenerationPlansTest::testQuotedIdentifierPlansThatLexemecovers and callsGenerationPlansTest::testStatementBoundsTheWalkAtTheRuleItIsGrownFromcovers and callsGenerationPlansTest::testStatementOfTypePreservesAnExplicitTypeWithoutConsumingRandomnesscovers and callsGenerationPlansTest::testStatementOfTypeUsesTheSeededFakerChoiceWhenNoTypeIsSpecifiedcovers and callsGenerationPlansTest::testStringLiteralPlansThatLexemecovers and callsGenerationPlansTest::testTemporaryTableStatementRequiresTheTemporaryProductioncovers and callsGenerationPlansTest::testViewStatementRestrictsTheCreateGrammarcovers and calls
Other tests reaching this symbol 1
SqliteProviderTestcalls
Relations§
Static calls 31
- static-call SqlFaker\SqliteProvider::sql() packages/sql-faker/src/SqliteProvider.php:109
- static-call SqlFaker\SqliteProvider::selectStatement() packages/sql-faker/src/SqliteProvider.php:125
- static-call SqlFaker\SqliteProvider::insertStatement() packages/sql-faker/src/SqliteProvider.php:141
- static-call SqlFaker\SqliteProvider::updateStatement() packages/sql-faker/src/SqliteProvider.php:157
- static-call SqlFaker\SqliteProvider::deleteStatement() packages/sql-faker/src/SqliteProvider.php:173
- static-call SqlFaker\SqliteProvider::createTableStatement() packages/sql-faker/src/SqliteProvider.php:189
- static-call SqlFaker\SqliteProvider::alterTableStatement() packages/sql-faker/src/SqliteProvider.php:205
- static-call SqlFaker\SqliteProvider::dropTableStatement() packages/sql-faker/src/SqliteProvider.php:221
- static-call SqlFaker\SqliteProvider::simpleStatement() packages/sql-faker/src/SqliteProvider.php:237
- static-call SqlFaker\SqliteProvider::expr() packages/sql-faker/src/SqliteProvider.php:253
- static-call SqlFaker\SqliteProvider::term() packages/sql-faker/src/SqliteProvider.php:269
- static-call SqlFaker\SqliteProvider::whereClause() packages/sql-faker/src/SqliteProvider.php:284
- static-call SqlFaker\SqliteProvider::orderByClause() packages/sql-faker/src/SqliteProvider.php:299
- static-call SqlFaker\SqliteProvider::limitClause() packages/sql-faker/src/SqliteProvider.php:314
- static-call SqlFaker\SqliteProvider::groupByClause() packages/sql-faker/src/SqliteProvider.php:329
- static-call SqlFaker\SqliteProvider::havingClause() packages/sql-faker/src/SqliteProvider.php:344
- static-call SqlFaker\SqliteProvider::fullname() packages/sql-faker/src/SqliteProvider.php:360
- static-call SqlFaker\SqliteProvider::withClause() packages/sql-faker/src/SqliteProvider.php:375
- static-call SqlFaker\SqliteProvider::foreignKeyConstraint() packages/sql-faker/src/SqliteProvider.php:393
- static-call SqlFaker\SqliteProvider::identifier() packages/sql-faker/src/SqliteProvider.php:409
- static-call SqlFaker\SqliteProvider::quotedIdentifier() packages/sql-faker/src/SqliteProvider.php:425
- static-call SqlFaker\SqliteProvider::stringLiteral() packages/sql-faker/src/SqliteProvider.php:441
- static-call SqlFaker\SqliteProvider::integerLiteral() packages/sql-faker/src/SqliteProvider.php:455
- static-call SqlFaker\SqliteProvider::decimalLiteral() packages/sql-faker/src/SqliteProvider.php:471
- static-call SqlFaker\SqliteProvider::insertFunctionUpsertStatement() packages/sql-faker/src/SqliteProvider.php:489
- static-call SqlFaker\SqliteProvider::multiDmlStatement() packages/sql-faker/src/SqliteProvider.php:507
- static-call SqlFaker\SqliteProvider::fullTextSearchStatement() packages/sql-faker/src/SqliteProvider.php:529
- static-call SqlFaker\SqliteProvider::temporaryTableStatement() packages/sql-faker/src/SqliteProvider.php:547
- static-call SqlFaker\SqliteProvider::viewStatement() packages/sql-faker/src/SqliteProvider.php:565
- static-call SqlFaker\SqliteProvider::generatedColumnStatement() packages/sql-faker/src/SqliteProvider.php:582
- static-call SqlFaker\SqliteProvider::foreignKeyCascadeStatement() packages/sql-faker/src/SqliteProvider.php:599