File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -979,6 +979,13 @@ abstract public function getSupportForIndexArray(): bool;
979979 */
980980 abstract public function getSupportForCastIndexArray (): bool ;
981981
982+ /**
983+ * Does the adapter use GIN indexes for array columns?
984+ *
985+ * @return bool
986+ */
987+ abstract public function getSupportForGinIndex (): bool ;
988+
982989 /**
983990 * Is unique index supported?
984991 *
Original file line number Diff line number Diff line change @@ -3221,6 +3221,11 @@ public function getSupportForCastIndexArray(): bool
32213221 return false ;
32223222 }
32233223
3224+ public function getSupportForGinIndex (): bool
3225+ {
3226+ return false ;
3227+ }
3228+
32243229 public function getSupportForUpserts (): bool
32253230 {
32263231 return true ;
Original file line number Diff line number Diff line change @@ -388,6 +388,11 @@ public function getSupportForCastIndexArray(): bool
388388 return $ this ->delegate (__FUNCTION__ , \func_get_args ());
389389 }
390390
391+ public function getSupportForGinIndex (): bool
392+ {
393+ return $ this ->delegate (__FUNCTION__ , \func_get_args ());
394+ }
395+
391396 public function getSupportForUniqueIndex (): bool
392397 {
393398 return $ this ->delegate (__FUNCTION__ , \func_get_args ());
Original file line number Diff line number Diff line change @@ -2142,6 +2142,11 @@ public function getSupportForCastIndexArray(): bool
21422142 return true ;
21432143 }
21442144
2145+ public function getSupportForGinIndex (): bool
2146+ {
2147+ return true ;
2148+ }
2149+
21452150 /**
21462151 * Does the adapter handle Query Array Overlaps?
21472152 *
Original file line number Diff line number Diff line change @@ -1545,6 +1545,11 @@ public function getSupportForCastIndexArray(): bool
15451545 return false ;
15461546 }
15471547
1548+ public function getSupportForGinIndex (): bool
1549+ {
1550+ return false ;
1551+ }
1552+
15481553 public function getSupportForRelationships (): bool
15491554 {
15501555 return true ;
Original file line number Diff line number Diff line change @@ -1150,7 +1150,7 @@ public function testArrayIndexUsedInQuery(): void
11501150 $ ns = $ database ->getNamespace ();
11511151 $ db = $ database ->getDatabase ();
11521152
1153- if ($ adapter instanceof \ Utopia \ Database \ Adapter \Postgres ) {
1153+ if ($ adapter-> getSupportForGinIndex () ) {
11541154 $ table = "\"{$ db }\". \"{$ ns }_ {$ collection }\"" ;
11551155
11561156 // Verify GIN index exists
You can’t perform that action at this time.
0 commit comments