Skip to content

Commit 069684d

Browse files
committed
Fix postgres tests
1 parent d289740 commit 069684d

File tree

1 file changed

+10
-7
lines changed
  • modules/module-postgres/src/types

1 file changed

+10
-7
lines changed

modules/module-postgres/src/types/cache.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,16 @@ WHERE t.oid = ANY($1)
6262
if (!this.registry.knows(oid)) {
6363
// This type is an array of another custom type.
6464
const inner = Number(element_type);
65-
requireType(inner);
66-
this.registry.set(oid, {
67-
type: 'array',
68-
innerId: inner,
69-
separatorCharCode: (delim as string).charCodeAt(0),
70-
sqliteType: () => 'text' // Since it's JSON
71-
});
65+
if (inner != 0) {
66+
// Some array types like macaddr[] don't seem to have their inner type set properly - skip!
67+
requireType(inner);
68+
this.registry.set(oid, {
69+
type: 'array',
70+
innerId: inner,
71+
separatorCharCode: (delim as string).charCodeAt(0),
72+
sqliteType: () => 'text' // Since it's JSON
73+
});
74+
}
7275
}
7376
break;
7477
case 'c':

0 commit comments

Comments
 (0)