classPostgreSqlRelease
final class PostgreSqlRelease
Resolves a PostgreSQL release number to the container that runs it.
Tests and fuzz targets start the release named by PG_VERSION, so CI runs the newest release and a developer runs any other release locally by setting the variable.
assert(\Container\PostgreSqlRelease::container('16.6') === \Container\PostgreSql16Container::class);putenv('PG_VERSION');
assert(\Container\PostgreSqlRelease::fromEnvironment() === \Container\PostgreSql17Container::class);Constants§
public const DEFAULT = '17.2'public const VARIABLE = 'PG_VERSION'Methods§
public static function versions(): list<string>Lists the release numbers with a container, oldest first.
Returns
list<string>Called from 2
Calls 2
- function-call
array_keysline 43 - class-const PostgreSqlRelease::CONTAINERS() line 43
public static function latest(): stringNames the newest release with a container.
Returns
stringCalls 3
- static-call PostgreSqlRelease::versions() line 51
- function-call
countline 51 - class-const PostgreSqlRelease::CONTAINERS() line 51
public static function container(string|null $version = null): class-string<PostgreSqlContainer>Names the container of a release.
Parameters
$version | string|null | Release number such as `17.2`, or null for the default |
Returns
class-string<PostgreSqlContainer>Throws
RuntimeException If no container runs the releaseCalled from 1
Calls 6
- class-const PostgreSqlRelease::DEFAULT() line 63
- class-const PostgreSqlRelease::CONTAINERS() line 65
- new
RuntimeExceptionline 66 - function-call
sprintfline 66 - function-call
implodeline 66 - static-call PostgreSqlRelease::versions() line 66
public static function fromEnvironment(string $variable = self::VARIABLE): class-string<PostgreSqlContainer>Names the container of the release given by an environment variable.
Parameters
$variable | string | Environment variable holding the release number |
Returns
class-string<PostgreSqlContainer>Throws
RuntimeException If no container runs the releaseTest cases 115
CopyTest::testExecDelegatesUnsupportedCopyToTheSessioncallsCopyTest::testPrepareDelegatesUnsupportedCopyToTheSessioncallsCopyTest::testQueryDelegatesUnsupportedCopyToTheSessioncallsCopyTest::testStandardPdoMethodsHonorTheSessionsIgnorePolicyForCopycallsCreateTableTest::testCreateTableAndInsertcallsCreateTableTest::testCreateTableAsSelectPreservesColumnsForEmptyResultcallsCreateTableTest::testCreateTableAsSelectPreservesProjectedPostgreSqlTypescallsCreateTableTest::testCreateTableDoesNotModifyPhysicalDatabasecallsCreateTableTest::testCreateTableIfNotExistscallsCteDmlTest::testCteDefinitionsRemainVisibleToRewrittenInsertUpdateAndDeletecallsDeleteBasicTest::testDeleteAllRowsWithConditioncallsDeleteBasicTest::testDeleteDoesNotModifyPhysicalDatabasecallsDeleteBasicTest::testDeleteSingleRowcallsDoBlockTest::testDoBlockPassesThroughAndLaterShadowDmlStillWorkscallsDomainTypeTest::testDomainConstraintsAndDmlRemainNativeInTheShadowStorecallsDropTableTest::testDropTableIfExistscallsDropTableTest::testDropTableRemovesFromRegistrycallsForeignKeyCascadeTest::testForeignKeysValidateAndCascadeUpdatesAndDeletescallsFullTextSearchTest::testTextSearchFunctionsPreserveTsvectorShadowTypecallsGeneratedColumnTest::testGeneratedValuesDriveReadsAggregatesUpdatesAndDeletescallsInsertBasicTest::testInsertDoesNotModifyPhysicalDatabasecallsInsertBasicTest::testInsertSelectPreservesExpressionsDistinctAndWindowscallsInsertBasicTest::testMultiRowInsertcallsInsertBasicTest::testOmittedExplicitAndDefaultValuesMatchPostgreSqlcallsInsertBasicTest::testSerialUsesShadowSequenceWithoutAdvancingPhysicalSequencecallsInsertBasicTest::testSingleRowInsertcallsInsertOnConflictTest::testConditionalOnConflictAndReturningMatchPostgrescallsInsertOnConflictTest::testOnConflictDoNothingcallsInsertOnConflictTest::testOnConflictDoUpdatecallsInsertOnConflictTest::testPreparedOnConflictDoUpdateReplacesExistingRowcallsMergeTest::testMergeSimulatesEveryActionSourceShapeAndPreparedParametercallsNativeUpsertExpressionTest::testDatabaseEvaluatesJsonUpsertExpressioncallsPartialIndexOnConflictTest::testPartialUniqueIndexUpsertsRemainInTheShadowStorecallsPartitionChildTest::testParentAndChildDmlSharePartitionedShadowRowscallsPreparedExecutionTest::testNativePositionsRemainBoundAcrossExpressionsAndMutationscallsReturningTest::testReturningAndLastInsertIdMatchPostgresDmlcallsSelectBitTypeTest::testBitStringsPreserveWidthAndOperatorscallsSelectCteTest::testMultipleCtescallsSelectCteTest::testSimpleCtecallsSelectDistinctTest::testSelectDistinctcallsSelectForUpdateTest::testForShareReturnsDatacallsSelectForUpdateTest::testForUpdateReturnsDatacallsSelectFromTest::testFromKeywordInsideExtractIsNotTreatedAsTableClausecallsSelectFromTest::testSelectAllColumnscallsSelectFromTest::testSelectSpecificColumnscallsSelectFromTest::testSelectWithAliascallsSelectFromTest::testSelectWithTableAliascallsSelectGroupByTest::testGroupByWithCountcallsSelectGroupByTest::testGroupByWithSumcallsSelectHavingTest::testHavingWithCountcallsSelectHavingTest::testHavingWithSumcallsSelectJoinTest::testCrossJoincallsSelectJoinTest::testFullJoincallsSelectJoinTest::testInnerJoincallsSelectJoinTest::testJoinWithTableWithoutPrimaryKeycallsSelectJoinTest::testLeftJoincallsSelectJoinTest::testNaturalJoincallsSelectJoinTest::testRightJoincallsSelectLimitOffsetTest::testLimitcallsSelectLimitOffsetTest::testLimitOffsetcallsSelectOrderByTest::testOrderByAsccallsSelectOrderByTest::testOrderByDesccallsSelectOrderByTest::testOrderByNullsFirstcallsSelectOrderByTest::testOrderByNullsLastcallsSelectQualifiedTableTest::testSchemaQualifiedTableReadsShadowRowscallsSelectRecursiveCteTest::testRecursiveCtecallsSelectSubqueryTest::testScalarSubquerycallsSelectSubqueryTest::testSubqueryInFromcallsSelectSubqueryTest::testSubqueryInWherecallsSelectUnionTest::testExceptcallsSelectUnionTest::testIntersectcallsSelectUnionTest::testUnioncallsSelectUnionTest::testUnionAllcallsSelectWhereTest::testWhereAndcallsSelectWhereTest::testWhereBetweencallsSelectWhereTest::testWhereComparisoncallsSelectWhereTest::testWhereEqualitycallsSelectWhereTest::testWhereIncallsSelectWhereTest::testWhereLikecallsSelectWindowTest::testRankPartitionBycallsSelectWindowTest::testRowNumbercallsSelectWindowTest::testSumOvercallsTableSampleTest::testTableSampleUsesShadowRowscallsTemporaryTableTest::testDmlContinuesAcrossTemporaryTableLifecyclecallsTruncateTest::testTruncateDoesNotModifyPhysicalDatabasecallsTruncateTest::testTruncateMultipleTablescallsTruncateTest::testTruncateTablecallsTruncateTest::testTruncateWithoutTableKeywordcallsUpdateBasicTest::testUpdateDoesNotModifyPhysicalDatabasecallsUpdateBasicTest::testUpdateMultipleColumnscallsUpdateBasicTest::testUpdateReplacesExistingTextWithEmptyStringcallsUpdateBasicTest::testUpdateSetPreservesFromKeywordsInsideFunctionscallsUpdateBasicTest::testUpdateSingleRowcallsUpdateBasicTest::testUpdateWithGroupedInSubquerycallsViewTest::testViewsReadShadowWritesAcrossFiltersJoinsAggregatesAndPreparationcallsPostgreSqlCteShadowingTest::testArrayAndBinaryValuesRetainNativeTypescallsPostgreSqlCteShadowingTest::testCommentsRemainLexicalWhitespaceAcrossPostgreSqlMutationscallsPostgreSqlCteShadowingTest::testDeleteDoesNotModifyPhysicalDatabasecallsPostgreSqlCteShadowingTest::testDisableZtdBypassesRewritingcallsPostgreSqlCteShadowingTest::testEnableDisableTogglecallsPostgreSqlCteShadowingTest::testInsertDoesNotModifyPhysicalDatabasecallsPostgreSqlCteShadowingTest::testInsertIsVisibleViaZtdSelectcallsPostgreSqlCteShadowingTest::testInsertWithoutColumnListSupportsConstraintKeywordPrefixescallsPostgreSqlCteShadowingTest::testJsonExistenceOperatorsRemainDistinctFromPlaceholderscallsPostgreSqlCteShadowingTest::testMultipleInsertsAccumulatecallsPostgreSqlCteShadowingTest::testPhysicalDatabaseRemainsUnchangedAfterMutationscallsPostgreSqlCteShadowingTest::testPostgreSqlQuotedStringFormsPreserveWhereOffsetscallsPostgreSqlCteShadowingTest::testPreparedBooleanAndBigIntValuesRetainTheirTypescallsPostgreSqlCteShadowingTest::testQuotedInsertSourceKeywordsRemainIdentifierscallsPostgreSqlCteShadowingTest::testSelectOnCleanShadowReturnsEmptycallsPostgreSqlCteShadowingTest::testSelectWithWhereOnShadowDatacallsPostgreSqlCteShadowingTest::testUpdateDoesNotModifyPhysicalDatabasecallsPostgreSqlDriverDetectionTest::testAutoDetectionCreatesPgSqlSessioncallsPostgreSqlDriverDetectionTest::testCustomConfigPassedToSessioncallsPostgreSqlDriverDetectionTest::testExplicitPlatformInjectioncalls
Calls 3
- class-const PostgreSqlRelease::VARIABLE() line 76
- function-call
getenvline 78 - static-call PostgreSqlRelease::container() line 80
Private surface 1§
Implementation details, listed for orientation only.
private const array<string, class-string<PostgreSqlContainer>> CONTAINERS = ['16.6' => \Container\PostgreSql16Container::class, '17.2' => \Container\Postgr…Test cases 116§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Other tests reaching this symbol 116
CopyTest::testExecDelegatesUnsupportedCopyToTheSessioncallsCopyTest::testPrepareDelegatesUnsupportedCopyToTheSessioncallsCopyTest::testQueryDelegatesUnsupportedCopyToTheSessioncallsCopyTest::testStandardPdoMethodsHonorTheSessionsIgnorePolicyForCopycallsCreateTableTest::testCreateTableAndInsertcallsCreateTableTest::testCreateTableAsSelectPreservesColumnsForEmptyResultcallsCreateTableTest::testCreateTableAsSelectPreservesProjectedPostgreSqlTypescallsCreateTableTest::testCreateTableDoesNotModifyPhysicalDatabasecallsCreateTableTest::testCreateTableIfNotExistscallsCteDmlTest::testCteDefinitionsRemainVisibleToRewrittenInsertUpdateAndDeletecallsDeleteBasicTest::testDeleteAllRowsWithConditioncallsDeleteBasicTest::testDeleteDoesNotModifyPhysicalDatabasecallsDeleteBasicTest::testDeleteSingleRowcallsDoBlockTest::testDoBlockPassesThroughAndLaterShadowDmlStillWorkscallsDomainTypeTest::testDomainConstraintsAndDmlRemainNativeInTheShadowStorecallsDropTableTest::testDropTableIfExistscallsDropTableTest::testDropTableRemovesFromRegistrycallsForeignKeyCascadeTest::testForeignKeysValidateAndCascadeUpdatesAndDeletescallsFullTextSearchTest::testTextSearchFunctionsPreserveTsvectorShadowTypecallsGeneratedColumnTest::testGeneratedValuesDriveReadsAggregatesUpdatesAndDeletescallsInsertBasicTest::testInsertDoesNotModifyPhysicalDatabasecallsInsertBasicTest::testInsertSelectPreservesExpressionsDistinctAndWindowscallsInsertBasicTest::testMultiRowInsertcallsInsertBasicTest::testOmittedExplicitAndDefaultValuesMatchPostgreSqlcallsInsertBasicTest::testSerialUsesShadowSequenceWithoutAdvancingPhysicalSequencecallsInsertBasicTest::testSingleRowInsertcallsInsertOnConflictTest::testConditionalOnConflictAndReturningMatchPostgrescallsInsertOnConflictTest::testOnConflictDoNothingcallsInsertOnConflictTest::testOnConflictDoUpdatecallsInsertOnConflictTest::testPreparedOnConflictDoUpdateReplacesExistingRowcallsMergeTest::testMergeSimulatesEveryActionSourceShapeAndPreparedParametercallsNativeUpsertExpressionTest::testDatabaseEvaluatesJsonUpsertExpressioncallsPartialIndexOnConflictTest::testPartialUniqueIndexUpsertsRemainInTheShadowStorecallsPartitionChildTest::testParentAndChildDmlSharePartitionedShadowRowscallsPreparedExecutionTest::testNativePositionsRemainBoundAcrossExpressionsAndMutationscallsReturningTest::testReturningAndLastInsertIdMatchPostgresDmlcallsSelectBitTypeTest::testBitStringsPreserveWidthAndOperatorscallsSelectCteTest::testMultipleCtescallsSelectCteTest::testSimpleCtecallsSelectDistinctTest::testSelectDistinctcallsSelectForUpdateTest::testForShareReturnsDatacallsSelectForUpdateTest::testForUpdateReturnsDatacallsSelectFromTest::testFromKeywordInsideExtractIsNotTreatedAsTableClausecallsSelectFromTest::testSelectAllColumnscallsSelectFromTest::testSelectSpecificColumnscallsSelectFromTest::testSelectWithAliascallsSelectFromTest::testSelectWithTableAliascallsSelectGroupByTest::testGroupByWithCountcallsSelectGroupByTest::testGroupByWithSumcallsSelectHavingTest::testHavingWithCountcallsSelectHavingTest::testHavingWithSumcallsSelectJoinTest::testCrossJoincallsSelectJoinTest::testFullJoincallsSelectJoinTest::testInnerJoincallsSelectJoinTest::testJoinWithTableWithoutPrimaryKeycallsSelectJoinTest::testLeftJoincallsSelectJoinTest::testNaturalJoincallsSelectJoinTest::testRightJoincallsSelectLimitOffsetTest::testLimitcallsSelectLimitOffsetTest::testLimitOffsetcallsSelectOrderByTest::testOrderByAsccallsSelectOrderByTest::testOrderByDesccallsSelectOrderByTest::testOrderByNullsFirstcallsSelectOrderByTest::testOrderByNullsLastcallsSelectQualifiedTableTest::testSchemaQualifiedTableReadsShadowRowscallsSelectRecursiveCteTest::testRecursiveCtecallsSelectSubqueryTest::testScalarSubquerycallsSelectSubqueryTest::testSubqueryInFromcallsSelectSubqueryTest::testSubqueryInWherecallsSelectUnionTest::testExceptcallsSelectUnionTest::testIntersectcallsSelectUnionTest::testUnioncallsSelectUnionTest::testUnionAllcallsSelectWhereTest::testWhereAndcallsSelectWhereTest::testWhereBetweencallsSelectWhereTest::testWhereComparisoncallsSelectWhereTest::testWhereEqualitycallsSelectWhereTest::testWhereIncallsSelectWhereTest::testWhereLikecallsSelectWindowTest::testRankPartitionBycallsSelectWindowTest::testRowNumbercallsSelectWindowTest::testSumOvercallsTableSampleTest::testTableSampleUsesShadowRowscallsTemporaryTableTest::testDmlContinuesAcrossTemporaryTableLifecyclecallsTruncateTest::testTruncateDoesNotModifyPhysicalDatabasecallsTruncateTest::testTruncateMultipleTablescallsTruncateTest::testTruncateTablecallsTruncateTest::testTruncateWithoutTableKeywordcallsUpdateBasicTest::testUpdateDoesNotModifyPhysicalDatabasecallsUpdateBasicTest::testUpdateMultipleColumnscallsUpdateBasicTest::testUpdateReplacesExistingTextWithEmptyStringcallsUpdateBasicTest::testUpdateSetPreservesFromKeywordsInsideFunctionscallsUpdateBasicTest::testUpdateSingleRowcallsUpdateBasicTest::testUpdateWithGroupedInSubquerycallsViewTest::testViewsReadShadowWritesAcrossFiltersJoinsAggregatesAndPreparationcallsPostgreSqlCteShadowingTest::testArrayAndBinaryValuesRetainNativeTypescallsPostgreSqlCteShadowingTest::testCommentsRemainLexicalWhitespaceAcrossPostgreSqlMutationscallsPostgreSqlCteShadowingTest::testDeleteDoesNotModifyPhysicalDatabasecallsPostgreSqlCteShadowingTest::testDisableZtdBypassesRewritingcallsPostgreSqlCteShadowingTest::testEnableDisableTogglecallsPostgreSqlCteShadowingTest::testInsertDoesNotModifyPhysicalDatabasecallsPostgreSqlCteShadowingTest::testInsertIsVisibleViaZtdSelectcallsPostgreSqlCteShadowingTest::testInsertWithoutColumnListSupportsConstraintKeywordPrefixescallsPostgreSqlCteShadowingTest::testJsonExistenceOperatorsRemainDistinctFromPlaceholderscallsPostgreSqlCteShadowingTest::testMultipleInsertsAccumulatecallsPostgreSqlCteShadowingTest::testPhysicalDatabaseRemainsUnchangedAfterMutationscallsPostgreSqlCteShadowingTest::testPostgreSqlQuotedStringFormsPreserveWhereOffsetscallsPostgreSqlCteShadowingTest::testPreparedBooleanAndBigIntValuesRetainTheirTypescallsPostgreSqlCteShadowingTest::testQuotedInsertSourceKeywordsRemainIdentifierscallsPostgreSqlCteShadowingTest::testSelectOnCleanShadowReturnsEmptycallsPostgreSqlCteShadowingTest::testSelectWithWhereOnShadowDatacallsPostgreSqlCteShadowingTest::testUpdateDoesNotModifyPhysicalDatabasecallsPostgreSqlDriverDetectionTest::testAutoDetectionCreatesPgSqlSessioncallsPostgreSqlDriverDetectionTest::testCustomConfigPassedToSessioncallsPostgreSqlDriverDetectionTest::testExplicitPlatformInjectioncallsPlatformFactoryTest::providerDatabaseVersionscalls