Skip to content

Commit eef3eac

Browse files
drew-grossRafael Santos
authored andcommitted
Revert "Update PostgresStorageAdapter.js" (parse-community#2241)
1 parent 1550aad commit eef3eac

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Adapters/Storage/Postgres/PostgresStorageAdapter.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,13 @@ export class PostgresStorageAdapter {
220220
// this adapter doesn't know about the schema, return a promise that rejects with
221221
// undefined as the reason.
222222
getClass(className) {
223-
return this._client.one('SELECT * FROM "_SCHEMA" WHERE "className"=$<className>', { className }, res=>res.schema)
224-
.catch(error => {
223+
return this._client.query('SELECT * FROM "_SCHEMA" WHERE "className"=$<className>', { className })
224+
.then(result => {
225+
if (result.length === 1) {
226+
return result[0].schema;
227+
} else {
225228
throw undefined;
229+
}
226230
});
227231
}
228232

0 commit comments

Comments
 (0)