mirror of
https://github.com/fosrl/pangolin.git
synced 2026-04-03 16:36:38 +00:00
Type cast data
This commit is contained in:
@@ -173,7 +173,7 @@ export async function flushSiteBandwidthToDb(): Promise<void> {
|
||||
// PostgreSQL: batch UPDATE … FROM (VALUES …) — single round-trip per chunk.
|
||||
const valuesList = chunk.map(
|
||||
([publicKey, { bytesIn, bytesOut }]) =>
|
||||
sql`(${publicKey}, ${bytesIn}, ${bytesOut})`
|
||||
sql`(${publicKey}, ${bytesIn}::bigint, ${bytesOut}::bigint)`
|
||||
);
|
||||
const valuesClause = sql.join(valuesList, sql`, `);
|
||||
return dbQueryRows<{ orgId: string; pubKey: string }>(sql`
|
||||
|
||||
Reference in New Issue
Block a user