@exulu/backend 0.2.9 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -10
- package/dist/index.js +1 -10
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1641,16 +1641,7 @@ var ExuluSource = class {
|
|
|
1641
1641
|
}
|
|
1642
1642
|
};
|
|
1643
1643
|
var updateStatistic = async (statistic) => {
|
|
1644
|
-
|
|
1645
|
-
const { db: db2 } = await postgresClient();
|
|
1646
|
-
await db2.from("statistics").update({
|
|
1647
|
-
total: db2.raw("total + ?", [statistic.count ?? 1]),
|
|
1648
|
-
timeseries: db2.raw('CASE WHEN "createdAt" = ? THEN array_append(timeseries, ?) ELSE timeseries END', [currentDate, { date: currentDate, count: statistic.count ?? 1 }])
|
|
1649
|
-
}).where({
|
|
1650
|
-
name: statistic.name,
|
|
1651
|
-
label: statistic.label,
|
|
1652
|
-
type: statistic.type
|
|
1653
|
-
}).onConflict("name").merge();
|
|
1644
|
+
return;
|
|
1654
1645
|
};
|
|
1655
1646
|
|
|
1656
1647
|
// src/registry/index.ts
|
package/dist/index.js
CHANGED
|
@@ -1599,16 +1599,7 @@ var ExuluSource = class {
|
|
|
1599
1599
|
}
|
|
1600
1600
|
};
|
|
1601
1601
|
var updateStatistic = async (statistic) => {
|
|
1602
|
-
|
|
1603
|
-
const { db: db2 } = await postgresClient();
|
|
1604
|
-
await db2.from("statistics").update({
|
|
1605
|
-
total: db2.raw("total + ?", [statistic.count ?? 1]),
|
|
1606
|
-
timeseries: db2.raw('CASE WHEN "createdAt" = ? THEN array_append(timeseries, ?) ELSE timeseries END', [currentDate, { date: currentDate, count: statistic.count ?? 1 }])
|
|
1607
|
-
}).where({
|
|
1608
|
-
name: statistic.name,
|
|
1609
|
-
label: statistic.label,
|
|
1610
|
-
type: statistic.type
|
|
1611
|
-
}).onConflict("name").merge();
|
|
1602
|
+
return;
|
|
1612
1603
|
};
|
|
1613
1604
|
|
|
1614
1605
|
// src/registry/index.ts
|