@@ -863,8 +863,7 @@ export class PostgresStorageAdapter {
|
|||||||
// rejection reason are TBD.
|
// rejection reason are TBD.
|
||||||
getAllClasses() {
|
getAllClasses() {
|
||||||
return this._ensureSchemaCollectionExists()
|
return this._ensureSchemaCollectionExists()
|
||||||
.then(() => this._client.map('SELECT * FROM "_SCHEMA"', null, row => ({ className: row.className, ...row.schema })))
|
.then(() => this._client.map('SELECT * FROM "_SCHEMA"', null, row => toParseSchema({ className: row.className, ...row.schema })));
|
||||||
.then(res => res.map(toParseSchema))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return a promise for the schema with the given name, in Parse format. If
|
// Return a promise for the schema with the given name, in Parse format. If
|
||||||
@@ -1552,8 +1551,7 @@ export class PostgresStorageAdapter {
|
|||||||
|
|
||||||
const qs = `SELECT ${columns} FROM $1:name ${wherePattern} ${sortPattern} ${limitPattern} ${skipPattern} ${groupPattern}`;
|
const qs = `SELECT ${columns} FROM $1:name ${wherePattern} ${sortPattern} ${limitPattern} ${skipPattern} ${groupPattern}`;
|
||||||
debug(qs, values);
|
debug(qs, values);
|
||||||
return this._client.any(qs, values)
|
return this._client.map(qs, values, a => this.postgresObjectToParseObject(className, a, schema))
|
||||||
.then(results => results.map(object => this.postgresObjectToParseObject(className, object, schema)))
|
|
||||||
.then(results => {
|
.then(results => {
|
||||||
if (countField) {
|
if (countField) {
|
||||||
results[0][countField] = parseInt(results[0][countField], 10);
|
results[0][countField] = parseInt(results[0][countField], 10);
|
||||||
@@ -1579,7 +1577,7 @@ export class PostgresStorageAdapter {
|
|||||||
});
|
});
|
||||||
return Promise.all(promises)
|
return Promise.all(promises)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
return this._client.tx(t => {
|
return this._client.tx('perform-initialization', t => {
|
||||||
return t.batch([
|
return t.batch([
|
||||||
t.none(sql.misc.jsonObjectSetKeys),
|
t.none(sql.misc.jsonObjectSetKeys),
|
||||||
t.none(sql.array.add),
|
t.none(sql.array.add),
|
||||||
|
|||||||
Reference in New Issue
Block a user