feat: add support for Postgres 14 (#7644)
This commit is contained in:
@@ -1983,10 +1983,10 @@ export class PostgresStorageAdapter implements StorageAdapter {
|
||||
|
||||
return this._client
|
||||
.one(qs, values, a => {
|
||||
if (a.approximate_row_count != null) {
|
||||
return +a.approximate_row_count;
|
||||
if (a.approximate_row_count == null || a.approximate_row_count == -1) {
|
||||
return !isNaN(+a.count) ? +a.count : 0;
|
||||
} else {
|
||||
return +a.count;
|
||||
return +a.approximate_row_count;
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
@@ -2111,7 +2111,7 @@ export class PostgresStorageAdapter implements StorageAdapter {
|
||||
columns.push(
|
||||
`EXTRACT(${
|
||||
mongoAggregateToPostgres[operation]
|
||||
} FROM $${index}:name AT TIME ZONE 'UTC') AS $${index + 1}:name`
|
||||
} FROM $${index}:name AT TIME ZONE 'UTC')::integer AS $${index + 1}:name`
|
||||
);
|
||||
values.push(source, alias);
|
||||
index += 2;
|
||||
|
||||
Reference in New Issue
Block a user