Skip to content

Commit 072a884

Browse files
committed
fix count
1 parent ad1831f commit 072a884

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

spec/RestQuery.spec.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,15 @@ describe('rest query', () => {
229229
expect(results.length).toBe(0);
230230
});
231231

232+
it('count internal field that has no database column', async () => {
233+
const user = new Parse.User();
234+
user.setUsername('user1');
235+
user.setPassword('password');
236+
await user.signUp();
237+
const count = await new Parse.Query(Parse.User).exists('_tombstone').count({ useMasterKey: true });
238+
expect(count).toBe(0);
239+
});
240+
232241
it('query protected field', async () => {
233242
const user = new Parse.User();
234243
user.setUsername('username1');

src/Adapters/Storage/Postgres/PostgresStorageAdapter.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2191,7 +2191,10 @@ export class PostgresStorageAdapter implements StorageAdapter {
21912191
}
21922192
})
21932193
.catch(error => {
2194-
if (error.code !== PostgresRelationDoesNotExistError) {
2194+
if (
2195+
error.code !== PostgresRelationDoesNotExistError &&
2196+
error.code !== PostgresMissingColumnError
2197+
) {
21952198
throw error;
21962199
}
21972200
return 0;

0 commit comments

Comments
 (0)