classSampleClause
final class SampleClause
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
Sample clause operations for PostgreSQL sampling.
Methods§
public function parseSample(
string $sql,
list<SqlToken> $tokens,
array{name: string, start: int, unqualifiedStart: int, end: int} $reference,
int $sampleIndex,
SqlToken $referenceToken,
): PgSqlTableSampleParameters
Returns
Throws
Test cases 1
Called from 1
Calls 14
- static-call PgSqlTableSampleMethod::tryFrom() line 33
- function-call
strtoupperline 33 - new UnsupportedSqlException line 36
- method-call SampleTokens::isOpeningParenthesis() line 41
- new SampleTokens line 41
- method-call SampleTokens::closingParenthesisIndex() line 44
- function-call
trimline 49 - function-call
substrline 49 - function-call
countline 50 - static-call SqlTokenStream::tokenize() line 50
- static-call PgSqlLexerProfile::create() line 50
- method-call SampleClause::repeatable() line 54
- method-call SampleClause::aliasSql() line 57
- new PgSqlTableSample line 59
public function repeatable(
string $sql,
list<SqlToken> $tokens,
SqlToken $referenceToken,
int $closeIndex,
): array{seed: string|null, end: int}Reads the optional REPEATABLE seed following the percentage expression.
Returns
array{seed: string|null, end: int}Throws
Test cases 1
Called from 1
Calls 10
- method-call SampleTokens::sameLevel() line 82
- new SampleTokens line 82
- method-call SampleTokens::isOpeningParenthesis() line 86
- new UnsupportedSqlException line 87
- method-call SampleTokens::closingParenthesisIndex() line 89
- function-call
trimline 94 - function-call
substrline 94 - function-call
countline 95 - static-call SqlTokenStream::tokenize() line 95
- static-call PgSqlLexerProfile::create() line 95
public function aliasSql(
string $sql,
list<SqlToken> $tokens,
array{name: string, start: int, unqualifiedStart: int, end: int} $reference,
SqlToken $referenceToken,
SqlToken $sampleToken,
): stringPreserves the alias between a relation or inheritance marker and TABLESAMPLE.
Parameters
Returns
stringTest cases 1
Called from 1
Calls 4
- method-call SampleTokens::tokenAfter() line 112
- new SampleTokens line 112
- function-call
trimline 116 - function-call
substrline 116
Test cases 14§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 3
Other tests reaching this symbol 11
PgSqlSessionFactoryTestcallsPgSqlRewriterTestcallsPgSqlTableSampleRewriterTestcallsStatementRewriterTestcallsDeleteTransformerTestcallsInsertTransformerTestcallsMergeTransformerTestcallsPgSqlTransformerTestcallsSelectTransformerTestcallsUpdateTransformerTestcallsPgSqlTableSampleParserTestcalls