@@ -870,8 +870,7 @@ export class PostgresStorageAdapter implements StorageAdapter {
870
870
// rejection reason are TBD.
871
871
getAllClasses ( ) {
872
872
return this . _ensureSchemaCollectionExists ( )
873
- . then ( ( ) => this . _client . map ( 'SELECT * FROM "_SCHEMA"' , null , row => ( { className : row . className , ...row . schema } ) ) )
874
- . then ( res => res . map ( toParseSchema ) )
873
+ . then ( ( ) => this . _client . map ( 'SELECT * FROM "_SCHEMA"' , null , row => toParseSchema ( { className : row . className , ...row . schema } ) ) ) ;
875
874
}
876
875
877
876
// Return a promise for the schema with the given name, in Parse format. If
@@ -1408,7 +1407,7 @@ export class PostgresStorageAdapter implements StorageAdapter {
1408
1407
const constraintName = `unique_${ fieldNames . sort ( ) . join ( '_' ) } ` ;
1409
1408
const constraintPatterns = fieldNames . map ( ( fieldName , index ) => `$${ index + 3 } :name` ) ;
1410
1409
const qs = `ALTER TABLE $1:name ADD CONSTRAINT $2:name UNIQUE (${ constraintPatterns . join ( ',' ) } )` ;
1411
- return this . _client . none ( qs , [ className , constraintName , ...fieldNames ] )
1410
+ return this . _client . none ( qs , [ className , constraintName , ...fieldNames ] )
1412
1411
. catch ( error => {
1413
1412
if ( error . code === PostgresDuplicateRelationError && error . message . includes ( constraintName ) ) {
1414
1413
// Index already exists. Ignore error.
@@ -1558,8 +1557,7 @@ export class PostgresStorageAdapter implements StorageAdapter {
1558
1557
1559
1558
const qs = `SELECT ${ columns . join ( ',' ) } FROM $1:name ${ wherePattern } ${ sortPattern } ${ limitPattern } ${ skipPattern } ${ groupPattern } ` ;
1560
1559
debug ( qs , values ) ;
1561
- return this . _client . any ( qs , values )
1562
- . then ( results => results . map ( object => this . postgresObjectToParseObject ( className , object , schema ) ) )
1560
+ return this . _client . map ( qs , values , a => this . postgresObjectToParseObject ( className , a , schema ) )
1563
1561
. then ( results => {
1564
1562
if ( countField ) {
1565
1563
results [ 0 ] [ countField ] = parseInt ( results [ 0 ] [ countField ] , 10 ) ;
@@ -1585,7 +1583,7 @@ export class PostgresStorageAdapter implements StorageAdapter {
1585
1583
} ) ;
1586
1584
return Promise . all ( promises )
1587
1585
. then ( ( ) => {
1588
- return this . _client . tx ( t => {
1586
+ return this . _client . tx ( 'perform-initialization' , t => {
1589
1587
return t . batch ( [
1590
1588
t . none ( sql . misc . jsonObjectSetKeys ) ,
1591
1589
t . none ( sql . array . add ) ,
0 commit comments