Bump flow-bin from 0.83.0 to 0.91.0 (#5302)
* Bump flow-bin from 0.83.0 to 0.91.0 Bumps [flow-bin](https://github.com/flowtype/flow-bin) from 0.83.0 to 0.91.0. - [Release notes](https://github.com/flowtype/flow-bin/releases) - [Commits](https://github.com/flowtype/flow-bin/compare/v0.83.0...v0.91.0) Signed-off-by: dependabot[bot] <support@dependabot.com> * fix flow issue
This commit is contained in:
committed by
Florent Vilmart
parent
30aa1ded1d
commit
3851641b5a
@@ -1963,12 +1963,14 @@ export class PostgresStorageAdapter implements StorageAdapter {
|
||||
const wherePattern =
|
||||
where.pattern.length > 0 ? `WHERE ${where.pattern}` : '';
|
||||
const qs = `SELECT count(*) FROM $1:name ${wherePattern}`;
|
||||
return this._client.one(qs, values, a => +a.count).catch(error => {
|
||||
if (error.code !== PostgresRelationDoesNotExistError) {
|
||||
throw error;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
return this._client
|
||||
.one(qs, values, a => +a.count)
|
||||
.catch(error => {
|
||||
if (error.code !== PostgresRelationDoesNotExistError) {
|
||||
throw error;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
|
||||
distinct(
|
||||
@@ -2093,32 +2095,34 @@ export class PostgresStorageAdapter implements StorageAdapter {
|
||||
index += 1;
|
||||
continue;
|
||||
}
|
||||
if (value.$sum) {
|
||||
if (typeof value.$sum === 'string') {
|
||||
columns.push(`SUM($${index}:name) AS $${index + 1}:name`);
|
||||
values.push(transformAggregateField(value.$sum), field);
|
||||
index += 2;
|
||||
} else {
|
||||
countField = field;
|
||||
columns.push(`COUNT(*) AS $${index}:name`);
|
||||
values.push(field);
|
||||
index += 1;
|
||||
if (typeof value === 'object') {
|
||||
if (value.$sum) {
|
||||
if (typeof value.$sum === 'string') {
|
||||
columns.push(`SUM($${index}:name) AS $${index + 1}:name`);
|
||||
values.push(transformAggregateField(value.$sum), field);
|
||||
index += 2;
|
||||
} else {
|
||||
countField = field;
|
||||
columns.push(`COUNT(*) AS $${index}:name`);
|
||||
values.push(field);
|
||||
index += 1;
|
||||
}
|
||||
}
|
||||
if (value.$max) {
|
||||
columns.push(`MAX($${index}:name) AS $${index + 1}:name`);
|
||||
values.push(transformAggregateField(value.$max), field);
|
||||
index += 2;
|
||||
}
|
||||
if (value.$min) {
|
||||
columns.push(`MIN($${index}:name) AS $${index + 1}:name`);
|
||||
values.push(transformAggregateField(value.$min), field);
|
||||
index += 2;
|
||||
}
|
||||
if (value.$avg) {
|
||||
columns.push(`AVG($${index}:name) AS $${index + 1}:name`);
|
||||
values.push(transformAggregateField(value.$avg), field);
|
||||
index += 2;
|
||||
}
|
||||
}
|
||||
if (value.$max) {
|
||||
columns.push(`MAX($${index}:name) AS $${index + 1}:name`);
|
||||
values.push(transformAggregateField(value.$max), field);
|
||||
index += 2;
|
||||
}
|
||||
if (value.$min) {
|
||||
columns.push(`MIN($${index}:name) AS $${index + 1}:name`);
|
||||
values.push(transformAggregateField(value.$min), field);
|
||||
index += 2;
|
||||
}
|
||||
if (value.$avg) {
|
||||
columns.push(`AVG($${index}:name) AS $${index + 1}:name`);
|
||||
values.push(transformAggregateField(value.$avg), field);
|
||||
index += 2;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user