Skip to content

Commit 671b621

Browse files
authored
SQL AST inference is only supported for mysql backends for now (#567)
1 parent 6b8f112 commit 671b621

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/QueryReflection/QueryReflection.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ public function getResultType(string $queryString, int $fetchType): ?Type
114114
return null;
115115
}
116116

117-
$resultType = self::reflector()->getResultType($queryString, $fetchType);
117+
$reflector = self::reflector();
118+
$resultType = $reflector->getResultType($queryString, $fetchType);
118119

119120
if (null !== $resultType) {
120121
if (! $resultType instanceof ConstantArrayType) {
@@ -127,6 +128,9 @@ public function getResultType(string $queryString, int $fetchType): ?Type
127128
if (! InstalledVersions::isInstalled('sqlftw/sqlftw')) {
128129
throw new \Exception('sqlftw/sqlftw is required to utilize the sql ast. Please install it via composer.');
129130
}
131+
if ($reflector instanceof PdoPgSqlQueryReflector) {
132+
throw new \Exception('SQL AST inference is only supported for mysql backends for now.');
133+
}
130134
$parserInference = new ParserInference($this->getSchemaReflection());
131135
$resultType = $parserInference->narrowResultType($queryString, $resultType);
132136
}

0 commit comments

Comments
 (0)