Skip to content

Commit 8edc5a3

Browse files
committed
update
1 parent ea7145b commit 8edc5a3

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

packages/orm/src/client/executor/zenstack-query-executor.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,14 @@ export class ZenStackQueryExecutor<Schema extends SchemaDef> extends DefaultQuer
5555
) {
5656
super(compiler, adapter, connectionProvider, plugins);
5757

58-
if (this.schemaHasCustomPostgresSchema(client.$schema) || this.schemaHasMappedNames(client.$schema)) {
58+
if (
59+
client.$schema.provider.type === 'postgresql' || // postgres queries need to be schema-qualified
60+
this.schemaHasMappedNames(client.$schema)
61+
) {
5962
this.nameMapper = new QueryNameMapper(client.$schema);
6063
}
6164
}
6265

63-
private schemaHasCustomPostgresSchema(schema: SchemaDef) {
64-
if (schema.provider.type !== 'postgresql') {
65-
return false;
66-
}
67-
return Object.values(schema.models).some((model) => model.attributes?.some((attr) => attr.name === '@@schema'));
68-
}
69-
7066
private schemaHasMappedNames(schema: Schema) {
7167
const hasMapAttr = (decl: ModelDef | TypeDefDef) => {
7268
if (decl.attributes?.some((attr) => attr.name === '@@map')) {

0 commit comments

Comments
 (0)