classPgSqlTableSampleRewriter
final class PgSqlTableSampleRewriter
Table sample rewriter for PostgreSQL queries.
Methods§
public function __construct()Initializes the collaborators and state used by this table sample rewriter.
Calls 2
public function rewrite(string $sql, array<string, array<string, mixed>> $tables): stringParameters
$sql | string | |
$tables | array<string, array<string, mixed>> |
Returns
stringThrows
Test cases 6
PgSqlTableSampleRewriterTest::testIgnoresNonStringColumnMetadataAndReindexesNamescallsPgSqlTableSampleRewriterTest::testMultipleSamplesAreReplacedWithoutOffsetCorruptioncallsPgSqlTableSampleRewriterTest::testOrdinarySelectIsUnchangedcallsPgSqlTableSampleRewriterTest::testRejectsSampleWhenColumnsAreUnknowncallsPgSqlTableSampleRewriterTest::testRepeatableUsesProvidedSeedAndSystemUsesOneVirtualBlockcallsPgSqlTableSampleRewriterTest::testRewritesBernoulliSampleAsDerivedShadowRelationcalls
Called from 1
Calls 8
- method-call PgSqlTableSampleParser::parse() line 35
- function-call
usortline 36 - method-call TableColumns::columns() line 39
- new TableColumns line 39
- new UnsupportedSqlException line 41
- method-call SampleProjection::replacement() line 46
- new SampleProjection line 46
- function-call
substr_replaceline 47
Private surface 2§
Implementation details, listed for orientation only.
private PgSqlTableSampleParser $parserprivate PgSqlIdentifierQuoter $quoterTest cases 15§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 6
PgSqlTableSampleRewriterTest::testIgnoresNonStringColumnMetadataAndReindexesNamescallsPgSqlTableSampleRewriterTest::testMultipleSamplesAreReplacedWithoutOffsetCorruptioncallsPgSqlTableSampleRewriterTest::testOrdinarySelectIsUnchangedcallsPgSqlTableSampleRewriterTest::testRejectsSampleWhenColumnsAreUnknowncallsPgSqlTableSampleRewriterTest::testRepeatableUsesProvidedSeedAndSystemUsesOneVirtualBlockcallsPgSqlTableSampleRewriterTest::testRewritesBernoulliSampleAsDerivedShadowRelationcalls
Other tests reaching this symbol 9
PgSqlSessionFactoryTestcallsPgSqlRewriterTestcallsStatementRewriterTestcallsDeleteTransformerTestcallsInsertTransformerTestcallsMergeTransformerTestcallsPgSqlTransformerTestcallsSelectTransformerTestcallsUpdateTransformerTestcalls