Skip to content

Commit 4c7be10

Browse files
committed
Support pointers in postgres
1 parent ab06055 commit 4c7be10

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
@@ -329,6 +329,10 @@ export class PostgresStorageAdapter {
329329
updatePatterns.push(`$${index}:name = $${index + 1}`);
330330
values.push(fieldName, fieldValue);
331331
index += 2;
332+
} else if (fieldValue.__type === 'Pointer') {
333+
updatePatterns.push(`$${index}:name = $${index + 1}`);
334+
values.push(fieldName, fieldValue.objectId);
335+
index += 2;
332336
} else {
333337
return Promise.reject(new Parse.Error(Parse.Error.OPERATION_FORBIDDEN, `Postgres doesn't support update ${JSON.stringify(fieldValue)} yet`));
334338
}

0 commit comments

Comments
 (0)