Skip to content

Commit 77e5775

Browse files
committed
Support pointers in postgres
1 parent 5ecd34d commit 77e5775

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

spec/ParseObject.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ describe('Parse.Object testing', () => {
4949
});
5050
});
5151

52-
it_exclude_dbs(['postgres'])("save cycle", function(done) {
52+
it("save cycle", done => {
5353
var a = new Parse.Object("TestObject");
5454
var b = new Parse.Object("TestObject");
5555
a.set("b", b);

spec/PurchaseValidation.spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,7 @@ describe("test validate_receipt endpoint", () => {
135135
});
136136
});
137137

138-
it("should fail at appstore validation", (done) => {
139-
138+
it("should fail at appstore validation", done => {
140139
request.post({
141140
headers: {
142141
'X-Parse-Application-Id': 'test',

spec/helper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use strict"
22
// Sets up a Parse API server for testing.
33

4-
jasmine.DEFAULT_TIMEOUT_INTERVAL = process.env.PARSE_SERVER_TEST_TIMEOUT || 3000;
4+
jasmine.DEFAULT_TIMEOUT_INTERVAL = process.env.PARSE_SERVER_TEST_TIMEOUT || 5000;
55

66
var cache = require('../src/cache').default;
77
var DatabaseAdapter = require('../src/DatabaseAdapter');

src/Adapters/Storage/Postgres/PostgresStorageAdapter.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,10 @@ export class PostgresStorageAdapter {
331331
updatePatterns.push(`$${index}:name = $${index + 1}`);
332332
values.push(fieldName, fieldValue);
333333
index += 2;
334+
} else if (fieldValue.__type === 'Pointer') {
335+
updatePatterns.push(`$${index}:name = $${index + 1}`);
336+
values.push(fieldName, fieldValue.objectId);
337+
index += 2;
334338
} else {
335339
return Promise.reject(new Parse.Error(Parse.Error.OPERATION_FORBIDDEN, `Postgres doesn't support update ${JSON.stringify(fieldValue)} yet`));
336340
}

0 commit comments

Comments
 (0)